Closed billmania closed 1 year ago
First, the joystick values for twist.linear.x and twist.angular.z are set between 0 and 100, inclusive. Those are not meters/second and radians/second but instead simply percentage of joystick maximum values. Next, in rq_manage.py, LINEAR_SCALE and ANGULAR_SCALE are arbitrary values.
First thing to determine is the minimum and maximum rotational velocity of the motors. Since the transformation from motor velocity to robot velocity is not known, configuration parameters will be required.
The minimum velocity is about 8%. There were two bugs. The SCALE values were both greater than 1, which generally transformed every linear and angular to a value greater than 100. Also, both the positive and negative angular velocity caused the motors to spin in the same direction. While I was there, I reduced the quantity of floating point multiplies by a factor of 3.
Set max motor speed to 100 and echo the cmd_vel topic. Carefully move the joystick from (0, 0) to (0, 100) and confirm the linear velocity attribute goes from 0 to 100. Observe the speed change of the motors.
Then set max motor speed to something less than 50 and move the joystick in the same way.
The joystick should be able to very the speed of the motors. When max motor speed is 100 and the joystick is command a speed of 100, the motors should rotate at their maximum rate.