Exemplo n.º 1
0
 def rv(self, value):
     self._rv = clip(value, -self.RV_CAP, self.RV_CAP)
     if not self.simulated:
         try:
             self.arcos.send_command(RVEL, int(self._rv * 180 / pi))  # Convert radians/sec to degrees/sec
         except Timeout as e:  # Recast arcos errors as Soar errors
             raise SoarIOError(str(e)) from e
Exemplo n.º 2
0
 def fv(self, value):
     self._fv = clip(value, -self.FV_CAP, self.FV_CAP)
     if not self.simulated:  # For real robots, must send an ARCOS command
         try:
             self.arcos.send_command(VEL, int(self._fv*1000))  # Convert m/s to mm/s
         except Timeout as e:  # Recast arcos errors as Soar errors
             raise SoarIOError(str(e)) from e
Exemplo n.º 3
0
    def set_analog_voltage(self, v):
        """ Sets the robot's analog output voltage.

        Args:
            v (float): The output voltage to set. This is limited to the range of 0-10V.
        """
        if self.simulated:
            raise SoarIOError('Cannot set the analog output of a simulated robot (yet)')  # TODO: CMax integration
        else:  # Sent the analog-digital output required to read it later
            try:
                self.arcos.send_command(DIGOUT, int(clip(v, 0, 10)*25.5) | 0xff00)
            except Timeout as e:  # Recast arcos errors as Soar errors
                raise SoarIOError(str(e)) from e