ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Raspberry + ROS + Servo

asked 2016-11-21 13:43:28 -0600

zpguedes gravatar image

updated 2016-11-23 22:09:56 -0600

Hi guys,

could anyone tell me some tutorial that teaches to control servoss via ROS installed in a Raspberry PI 3 (Ubuntu Mate

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-12-10 12:53:34 -0600

updated 2016-12-11 14:23:23 -0600

I've been working through this scenario. (See if this description is what you are attempting: )

Here are a few things which may make your life a bit easier:

Using Ubuntu server for RPi3 (rather than raspbian jessie) does make your query easier as you can install most packages using "apt-get install" and not need to "git" the source.

For PWM for positional control of standard servos as well as speed and direction control of continuous servos, you might check out the ros_i2cpwmboard package:

Short description of end-to-end demonstration: and accompanying video:

The documentation ( ) for the ros_i2cpwmboard package gives simple test examples of rostopic() and rosservice(). The package supports controlling servos using direct PWM values, proportional values (-1.0 .. 1.0) and using geometry_msgs::Twist - the latter makes it easier to integrate with the turtlesim tutorials.

edit flag offensive delete link more

answered 2016-11-22 07:24:35 -0600

bluehash gravatar image

I'm assuming you have ROS installed on your Pi3. I would first start by controlling a servo using the Pi PWM or any of the widely used Pi GPIO libraries. . Then start by writing a ROS servo subscriber node. You can use this ROS tutorial) as an example.

Once you have the two parts running, you will have to merge the servo code to the subscriber code, so that the servo node listens on a ros topic, say /pi/servoAngle. You can then send commands to the topic using the rostopic pub command.

If you are not familiar with ROS concepts, I would start with the basic ROS tutorials first.

edit flag offensive delete link more


Now I'm going to sleep but tomorrow I'll follow your advice, thank you, it was already a great help!

zpguedes gravatar image zpguedes  ( 2016-11-23 22:06:23 -0600 )edit

Question Tools



Asked: 2016-11-21 13:43:28 -0600

Seen: 5,633 times

Last updated: Dec 11 '16