Changing Motor Controllers


I saw that it was mentioned that it was possible to change the controllers for individual joints (to PID, velocity, etc) of the Stretch but was wondering how I would go about doing that. I was referencing the information that I saw in this portion of the documentation. Is it possible to implement custom controllers? As for the PID controller is it also possible to change its parameters? Additionally, is this functionality available in the ROS implementation?


Hi @nwagwu, there are other controllers (e.g. PID, velocity) for each joint and it is possible to implement additional custom controllers. Stretch’s controllers are implemented in its firmware.

If you wanted to implement custom controllers for Stretch’s four main joints, you’d start by writing a firmware implementation for the controller. For the Dynamixel joints, its controllers are implemented in the Dynamixel firmware.

Next, you’d use the Python library, Stretch Body, to use these controllers through Python. To use one of the existing controllers (e.g. trapezoidal, velocity, PID), you can use the existing Python API. The following links should be helpful:

Only a subset of the controllers are exposed at the ROS layer. But since Stretch ROS is built on Stretch Body, it’s always possible to create an API for them at the ROS layer. Currently, “position” mode in the driver maps to the trapezoidal motion profile controller, and “navigation” mode changes the mobile base to the velocity controller.

Let me know if you have any questions!

Alright, I’ll try it out it and tell you if I run into any issues. Thanks!

1 Like