Library for super modified servo and ROS nodes examples
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Super Modified Servo - ROS

This repository contains C library that used from ROS in order to control Super Modified Servo. It is inspired by this arduino library. The description for all functions you can find here. This ROS package tested in fedora 22 with ROS indigo - 1.11.14.


To install the ROS package, clone the repository files in your ROS workspace:

cd ../src
git clone
cd ..
catkin_make #Build the package


Connect the controller to USB-RS485 or USB-UART as describe here. To find the device name:

$ dmesg | grep tty

Then change the device name in src/Commander.cpp

int fd = serialPortOpen("device name", B"baud rate");

for example serialPortOpen("/dev/ttyUSB0", B115200). The default baud rate is 57600.

For testing run the launch file:

$ roslaunch super_modified_servo SuperModifiedTest.launch

In other terminal run the "rqt_reconfigure" node:

rosrun rqt_reconfigure rqt_reconfigure

With rqt_reconfigure, the user can control the velocity of the super_modified_servo and change some parameters. The implemented functions are:

  • search: find the ID of connected super_modified_servo

  • start: start the super_modified_servo with ID "Motor ID"

  • stop: stop the super_modified_servo with ID "Motor ID"

  • reset: run the "resetIncrementalPosition()" function, with ID "Motor ID"

  • setID: change the "Motor ID" of the super_modified_servo to "New motor ID"

  • setBaud: change the baud rate to "Set baud rate", change the

    int fd = serialPortOpen("device name", B"baud rate");

in src/Commander.cpp to new baud rate and build the package.

  • error_reaction: set and get error reaction, the "errorReaction[20]" is default.
  • setGain: set the gains of PID position controller to P gain, I gain, D gain values.
  • getGain: get the gains of PID position controller.

The user can type the above commands in the "Send command" field. Also information or error messages appear in the "roslaunch" terminal. In the "set point" field, the user can change the position of super_modified_servo. In the "P gain", "I gain", "D gain", the user can change the control gains of super_modified_servo.

The state of motor is published in /JointsState topic:

rostopic echo /JointsState

or you can plot it by using:

rosrun rqt_plot rqt_plot



Known problems

  • If the user in your platform does not have permissions to read/write to serial device, run the roslaunch as super user or give him the permissions for this.
  • Communication with more than one super_modified_servo in high rate communication causes problem.