ROBOTIS-GIT/OpenCR

LIMIT_X_MAX_VELOCITY is scaled for XM430 W210-T (Waffle) and not W250-T (Burger)

Raphtor opened this issue · 1 comments

(See ROBOTIS-GIT/turtlebot3#765 (comment))

The ignorance of the linear velocity of 0.22 seems to be caused by the out of range data error from XL430 DYNAMIXEL.
The max linear velocity of XL430 is set to 265.

The constraining logic in the turtlebot3.cpp file, cannot filter the data that exceeds the maximum value in the turtlebot3_motro_driver.cpp file.

The LIMIT_X_MAX_VELOCITY is set to 337 for some reason (looks like it is an old max velocity value of the XM430 in TurtleBot3 Waffle Pi), and this does not help filtering the goal_velocity passed from turtlebot3.cpp.

This can be identified as below.

When publishing the linear velocity 0.22,
goal_velocity_from_cmd[VelocityType::LINEAR] is constrained by the max_linear_velocity = 0.033 * 2 * pi * 61 / 60 = 0.2108...
wheel_velocity[LEFT] does not exceed the LIMIT_X_MAX_VELOCITY(which is 337) and therefore, 0.2108... * VELOCITY_CONSTANT_VALUE(1263.632935) = 266.3749...
casting 266.3749... to int32_t will return 266 which is out of range for XL430 Max Velocity (265)
Meanwhile, publishing 0.21,
goal_velocity_from_cmd[VelocityType::LINEAR] = 0.21
wheel_velocity[LEFT] does not exceed the LIMIT_X_MAX_VELOCITY(which is 337) and therefore, 0.21 * VELOCITY_CONSTANT_VALUE(1263.632935) = 265.3629...
casting 265.3629... to int32_t will return 265 which is acceptable for XL430 Max Velocity (265).
Recently we have also found some issues in TurtleBot3 ROS2 OpenCR firmware, and this will be fixed along with it.

PR here: #322