Changing Motor Controllers

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!