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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cfg
include
pics
src
CMakeLists.txt
LICENSE
README.md
SuperModifiedTest.launch
package.xml

README.md

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.

Installation

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

roscd
cd ../src
git clone https://github.com/zisi/SuperModifiedServo-ROS.git
cd ..
catkin_make #Build the package

Testing

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

License

#LGPLv2.1

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.