def build_msg(self, angle): msg = MotorCommand() msg.joint_name = self.args["name"] msg.position = angle # IF speed and acceleration is more than 1 default motor speed will be used msg.speed = 2 msg.acceleration = 2 return msg
def msg_angle(self, angle=None): """Builds a message given the target angle.""" msg = MotorCommand() msg.joint_name = self.motor_entry['name']+"@"+self.motor_entry['topic'] msg.position = self._saturatedAngle(angle or self.target) # Default values are set here, if speed or acceleration are not found in # the motor entry. if 'speed' in self.motor_entry.keys(): msg.speed = self.motor_entry['speed'] / 10.0 else: msg.speed = 2 if 'acceleration' in self.motor_entry.keys(): msg.acceleration = self.motor_entry['acceleration'] / 2.0 else: msg.acceleration = 2 return msg