def __init__(self): super(ManualMotionTask, self).__init__(task_name='Manual motion', requires_compass=False) self.bearing_zero = None self.max_trn = 0 self.max_rot = 0 self.dead_reckoning = None self.pose_display_interval = IntervalCheck(interval=0.2) self.pose_update_interval = IntervalCheck(interval=0.1) self.rate_limit = None ':type : triangula.dynamics.RateLimit' self.motion_limit = None ':type : triangula.dynamics.MotionLimit' self.limit_mode = 0
def __init__(self): """ Create a new serial connection and clear the display """ self.ser = serial.Serial(port='/dev/ttyAMA0', baudrate=9600) self.row1 = '' self.row2 = '' self.interval = IntervalCheck(interval=MIN_DELAY) self.clear()
def __init__(self, waypoints, loop=False, linear_offset=30, angular_offset=0.2, max_power=1.0): """ Create a new Patrol task, specifying a sequence of waypoints, whether to patrol continuously, and tolerances used to determine when we've hit a waypoint and should start executing the waypoint's task. :param waypoints: List of :class:`triangula.navigation.TaskWaypoint` defining the patrol route. :param loop: Whether to patrol continuously, defaults to False in which case this task will return an ExitTask when it has completed all its waypoints. If True the task will not exit, and will repeatedly run through its list of TaskWaypoint targets until otherwise interrupted. :param linear_offset: Maximum linear distance away from the target Pose for each waypoint before we consider that we've hit it. Specified in mm, defaults to 20 :param angular_offset: Maximum angular distance away from the target Pose for each waypoint before we consider that we've hit it. Specified in radians, defaults to 0.1 :param max_power: A scale applied to motor speeds being sent to the chassis, defaults to 1.0 to move as fast as possible, lower values might be helpful when testing! """ super(PatrolTask, self).__init__(task_name='Patrol', requires_compass=False) self.waypoints = waypoints self.loop = loop self.linear_offset = linear_offset self.angular_offset = angular_offset self.active_waypoint_index = None self.active_subtask = None self.dead_reckoning = None self.motion_limit = None self.pose_update_interval = IntervalCheck(interval=0.001) self.subtask_tick = 0 self.max_power = max_power