<commit_before>#!/usr/bin/python2.7
#
# Based on code by <NAME>:
# https://github.com/miguelvelezmj25/turtlebot-monitoring-infrastructure/blob/develop/src/cp1_gazebo/instructions/localization/map_navigation.py
#
# Provided we trust the bump sensors, we can subscribe to /mobile_base/events/bumper
# to be informed of any bumps. For now, let's go ahead and trust this (then work
# on a better, more general solution for cases where we don't trust the bump
# sensor OR where the bump sensor is inadequate).
#
# * subscribe to bumper event topic
# * terminate test as soon as we collide
#
#
# Outcomes
#
# | Collision
# | ReachedGoal(time, distance, accuracy, power*) [should record node failures]
# | SystemCrashed
# | PowerExpired
#
#
# TODO:
# - need to be able to pass parameters to launch file
import signal
import os
import time
import sys
import rospy
import actionlib
import math
import subprocess
import roslaunch

#from roslaunch.scriptapi import ROSLaunch
from kobuki_msgs.msg import BumperEvent
from gazebo_msgs.msg import ModelStates
from nav_msgs.msg import Odometry
from actionlib_msgs.msg import GoalStatus
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from geometry_msgs.msg import Point, Quaternion

# TODO: should be passed as part of the mission description
MAX_RUN_TIME = 60

# The name of the model for the robot within Gazebo
# TODO: allow command line customisation (so we can use this with other robots)
ROBOT_MODEL_NAME = "mobile_base"

# Number of seconds to wait for roscore to initialise
ROSCORE_WAIT = 5

# Used to describe an outcome to the mission
class MissionOutcome(object):
    pass

class CollisionOutcome(MissionOutcome):
    def __str__(self):
        return "Collision()"

class GoalReachedOutcome(MissionOutcome):
    def __init__(self, time, distance, pos_error):
        self.time = time
        self.distance = distance
        self.pos_error = pos_error

    def __str__(self):
        return "ReachedGoal(Time = {}, Distance = {}, Pos. Error = {})".format(self.time, self.distance, self.pos_error)

class TimeExpiredOutcome(MissionOutcome):
    def __init__(self, distance, pos_error):
        self.distance = distance
        self.pos_error = pos_error 
<commit_msg>removed ROSCORE_WAIT<commit_after>#!/usr/bin/python2.7
#
# Based on code by <NAME>:
# https://github.com/miguelvelezmj25/turtlebot-monitoring-infrastructure/blob/develop/src/cp1_gazebo/instructions/localization/map_navigation.py
#
# Provided we trust the bump sensors, we can subscribe to /mobile_base/events/bumper
# to be informed of any bumps. For now, let's go ahead and trust this (then work
# on a better, more general solution for cases where we don't trust the bump
# sensor OR where the bump sensor is inadequate).
#
# * subscribe to bumper event topic
# * terminate test as soon as we collide
#
#
# Outcomes
#
# | Collision
# | ReachedGoal(time, distance, accuracy, power*) [should record node failures]
# | SystemCrashed
# | PowerExpired
#
#
# TODO:
# - need to be able to pass parameters to launch file
import signal
import os
import time
import sys
import rospy
import actionlib
import math
import subprocess
import roslaunch

#from roslaunch.scriptapi import ROSLaunch
from kobuki_msgs.msg import BumperEvent
from gazebo_msgs.msg import ModelStates
from nav_msgs.msg import Odometry
from actionlib_msgs.msg import GoalStatus
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from geometry_msgs.msg import Point, Quaternion

# TODO: should be passed as part of the mission description
MAX_RUN_TIME = 60

# The name of the model for the robot within Gazebo
# TODO: allow command line customisation (so we can use this with other robots)
ROBOT_MODEL_NAME = "mobile_base"

# Used to describe an outcome to the mission
class MissionOutcome(object):
    pass

class CollisionOutcome(MissionOutcome):
    def __str__(self):
        return "Collision()"

class GoalReachedOutcome(MissionOutcome):
    def __init__(self, time, distance, pos_error):
        self.time = time
        self.distance = distance
        self.pos_error = pos_error

    def __str__(self):
        return "ReachedGoal(Time = {}, Distance = {}, Pos. Error = {})".format(self.time, self.distance, self.pos_error)

class TimeExpiredOutcome(MissionOutcome):
    def __init__(self, distance, pos_error):
        self.distance = distance
        self.pos_error = pos_error 

{'fraction_non_alphanumeric': 0.07711613050422085, 'fraction_numerical': 0.0034223134839151265, 'mean_word_length': 4.385749385749386, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2159998', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1327, 'n_words': 464}