Ejemplo n.º 1
0
    def __init__(self, parent, uuid='SensorBoard'):
        SecureArduino.__init__(self, parent, uuid, default_result=self.DEFAULT)
        self.last_time = None

        try:
            self.addTopic(GET_ALL_TOPIC_OPCODE,
                      self.get_all_sensors_handler, "sensors", self.TIMESTEP)
        except:
            pass

        self.sensor1 = self.MAX_DIST
        self.sensor2 = self.MAX_DIST
        self.sensor3 = self.MAX_DIST
        self.sensor4 = self.MAX_DIST
        self.sensor5 = self.MAX_DIST
        self.sensor6 = self.MAX_DIST
        self.sensor7 = self.MAX_DIST
        self.sensor8 = self.MAX_DIST
Ejemplo n.º 2
0
 def __init__(self, parent, uuid='sensors'):
     SecureArduino.__init__(self, parent, uuid, default_result=self.DEFAULT)
     self.last_time = None
     self.last_both = (SensorsIR.ERROR_DIST, SensorsIR.ERROR_DIST)
Ejemplo n.º 3
0
 def __init__(self, parent, uuid='sensors'):
     SecureArduino.__init__(self, parent, uuid, Sensors._DEFAULT)
Ejemplo n.º 4
0
 def __init__(self, parent, uuid='/tmp/arduino/BMS'):
     SecureArduino.__init__(self, parent, uuid, BMS._DEFAULT)
Ejemplo n.º 5
0
    def __init__(self, parent, uuid='wheeledbase'):
        SecureArduino.__init__(self, parent, uuid, WheeledBase._DEFAULT)

        self.left_wheel_radius = WheeledBase.Parameter(self,
                                                       LEFTWHEEL_RADIUS_ID,
                                                       FLOAT)
        self.left_wheel_constant = WheeledBase.Parameter(
            self, LEFTWHEEL_CONSTANT_ID, FLOAT)
        self.left_wheel_maxPWM = WheeledBase.Parameter(self,
                                                       LEFTWHEEL_MAXPWM_ID,
                                                       FLOAT)

        self.right_wheel_radius = WheeledBase.Parameter(
            self, RIGHTWHEEL_RADIUS_ID, FLOAT)
        self.right_wheel_constant = WheeledBase.Parameter(
            self, RIGHTWHEEL_CONSTANT_ID, FLOAT)
        self.right_wheel_maxPWM = WheeledBase.Parameter(
            self, RIGHTWHEEL_MAXPWM_ID, FLOAT)

        self.left_codewheel_radius = WheeledBase.Parameter(
            self, LEFTCODEWHEEL_RADIUS_ID, FLOAT)
        self.left_codewheel_counts_per_rev = WheeledBase.Parameter(
            self, LEFTCODEWHEEL_COUNTSPERREV_ID, LONG)

        self.right_codewheel_radius = WheeledBase.Parameter(
            self, RIGHTCODEWHEEL_RADIUS_ID, FLOAT)
        self.right_codewheel_counts_per_rev = WheeledBase.Parameter(
            self, RIGHTCODEWHEEL_COUNTSPERREV_ID, LONG)

        self.codewheels_axletrack = WheeledBase.Parameter(
            self, ODOMETRY_AXLETRACK_ID, FLOAT)
        self.odometry_slippage = WheeledBase.Parameter(self,
                                                       ODOMETRY_SLIPPAGE_ID,
                                                       FLOAT)

        self.wheels_axletrack = WheeledBase.Parameter(
            self, VELOCITYCONTROL_AXLETRACK_ID, FLOAT)
        self.max_linacc = WheeledBase.Parameter(self,
                                                VELOCITYCONTROL_MAXLINACC_ID,
                                                FLOAT)
        self.max_lindec = WheeledBase.Parameter(self,
                                                VELOCITYCONTROL_MAXLINDEC_ID,
                                                FLOAT)
        self.max_angacc = WheeledBase.Parameter(self,
                                                VELOCITYCONTROL_MAXANGACC_ID,
                                                FLOAT)
        self.max_angdec = WheeledBase.Parameter(self,
                                                VELOCITYCONTROL_MAXANGDEC_ID,
                                                FLOAT)
        self.spin_shutdown = WheeledBase.Parameter(
            self, VELOCITYCONTROL_SPINSHUTDOWN_ID, BYTE)

        self.linvel_KP = WheeledBase.Parameter(self, LINVELPID_KP_ID, FLOAT)
        self.linvel_KI = WheeledBase.Parameter(self, LINVELPID_KI_ID, FLOAT)
        self.linvel_KD = WheeledBase.Parameter(self, LINVELPID_KD_ID, FLOAT)

        self.angvel_KP = WheeledBase.Parameter(self, ANGVELPID_KP_ID, FLOAT)
        self.angvel_KI = WheeledBase.Parameter(self, ANGVELPID_KI_ID, FLOAT)
        self.angvel_KD = WheeledBase.Parameter(self, ANGVELPID_KD_ID, FLOAT)

        self.linpos_KP = WheeledBase.Parameter(self,
                                               POSITIONCONTROL_LINVELKP_ID,
                                               FLOAT)
        self.angpos_KP = WheeledBase.Parameter(self,
                                               POSITIONCONTROL_ANGVELKP_ID,
                                               FLOAT)
        self.max_linvel = WheeledBase.Parameter(self,
                                                POSITIONCONTROL_LINVELMAX_ID,
                                                FLOAT)
        self.max_angvel = WheeledBase.Parameter(self,
                                                POSITIONCONTROL_ANGVELMAX_ID,
                                                FLOAT)
        self.linpos_threshold = WheeledBase.Parameter(
            self, POSITIONCONTROL_LINPOSTHRESHOLD_ID, FLOAT)
        self.angpos_threshold = WheeledBase.Parameter(
            self, POSITIONCONTROL_ANGPOSTHRESHOLD_ID, FLOAT)

        self.lookahead = WheeledBase.Parameter(self, PUREPURSUIT_LOOKAHEAD_ID,
                                               FLOAT)
        self.lookaheadbis = WheeledBase.Parameter(self,
                                                  PUREPURSUIT_LOOKAHEADBIS_ID,
                                                  FLOAT)
        self.x = 0
        self.y = 0
        self.theta = 0
        self.previous_measure = 0
        self.direction = self.NO_DIR
        self.final_angle = 0

        self.latch = None
        self.latch_time = None
Ejemplo n.º 6
0
 def __init__(self, parent, matrix_id, uuid='display'):
     SecureArduino.__init__(self, parent, uuid, dict())
     self.matrix_id = matrix_id
Ejemplo n.º 7
0
 def __init__(self, parent, uuid='display'):
     SecureArduino.__init__(self, parent, uuid, dict())
Ejemplo n.º 8
0
 def __init__(self, parent, uuid='ColorSensors'):
     SecureArduino.__init__(self, parent, uuid, self.DEFAULT)