Ask Your Question
0

How to setup ROS for controlling servos

asked 2015-04-19 21:17:33 -0500

Cerin gravatar image

I'm new to ROS, and I'm trying to create a ROS setup for a simple 4 legged robot, with 2 DOF per leg. Since there's no physical robot, I'll have to simulate everything in Gazebo. However, I'm not really sure where to begin. I've reading a lot of the ROS tutorials, but they're either too low-level (browsing the file system, creating a package, etc) or too high-level (how to navigate using SLAM and planners). I can't find anything on "how to setup a basic project for your robot".

Also, there are a lot of disconnects between ROS and Gazebo. Following the Gazebo tutorials, I've been able to model my platform and apply torque to joints to move limbs, but I'm unsure how to simulate a servo PID and actuate joints from ROS. Where do I begin?

Also, Gazebo seems to use SDF to model everything, while ROS uses URDF. Which should I use? I've already modelled my platform in SDF. Am I going to have to rewrite it in URDF to get it to work with ROS?

edit retag flag offensive close merge delete

Comments

Here I have a code for servo_controller which may help. You may add comments for further doubts. Here I've used urdf files for convience, but sdf files can also be integrated. There is also a ros package which controls the servo which will aid you further https://github.com/Gauraviitkgp/Servo...

Gaurav Suryawanshi gravatar imageGaurav Suryawanshi ( 2018-06-02 03:35:44 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-04-20 03:30:36 -0500

I do not really know about legged robots, but they are normally not just simple. But I guess a good start would be to check out an existing legged robot like the Nao: http://wiki.ros.org/action/show/nao?a...

The control on your robot you need to do on your own, also the state output, but you need to check for the used topics so that they might fit available software.

SDF or URDF: Use URDF! You maybe read that SDF is so nice, actually true, but the Robot State Publisher does not support it (yet?)! Also if you use XACRO macros you can create SDF from your URDF. So I would definitely go for URDF,

(I started with SDF because I also read the Gazebo Documentation where they say, that SDF is super awesome etc... but they do not lose a word about not being supported by ROS Tools ...)

Regards,

Christian

edit flag offensive delete link more

Comments

The only SDF I've written is for the physical model, which is just the 4 legs and body. Is there no way to use that from ROS? Isn't the SDF just used to render the robot in Gazebo? Why would ROS need to support it?

Cerin gravatar imageCerin ( 2015-04-20 07:52:08 -0500 )edit

Check out the robot state publisher, it will publish the static transforms of your robot, so that it can be displayed in rviz and other nodes can use the tf::transforms to do calculations on them. The transforms for the joint states you will have to publish with your own node (on the real robot).

cyborg-x1 gravatar imagecyborg-x1 ( 2015-04-21 05:51:00 -0500 )edit

For some robot types there are already existing plugins like the diff drive plugin in ros gazebo plugins which will publish the states from ros to gazebo. The question is: "Is there one for a 4 leged robot?" I do not know but I am in doubt that there is one,so maybe you have to write it on your own.

cyborg-x1 gravatar imagecyborg-x1 ( 2015-04-21 05:53:34 -0500 )edit
cyborg-x1 gravatar imagecyborg-x1 ( 2015-04-21 05:54:30 -0500 )edit
0

answered 2018-06-02 03:36:00 -0500

Here I have a code for servo_controller which may help. You may add comments for further doubts. Here I've used urdf files for convience, but sdf files can also be integrated. There is also a ros package which controls the servo which will aid you furth https://github.com/Gauraviitkgp/Servo...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-04-19 21:17:33 -0500

Seen: 1,436 times

Last updated: Apr 20 '15