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

What controllers does ROS provide for non-pr2 robots

asked 2013-02-06 12:30:53 -0600

MartinW gravatar image

Hello,

I was wondering what controllers does ROS provide that can run with a robot that publishes position and velocity measurements? I have my hardware up and running and publishing on the /joint_states topic but I am unsure how to approach either designing my own controller or implementing one that has already been created. Does anyone have some insights?

Kind Regards, Martin

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-02-06 16:11:20 -0600

Thomas gravatar image

updated 2013-02-06 16:12:06 -0600

There is no unified control package so far, this is why people are often relying on Orocos and Orocos RTT so far for non-PR2 robots.

You can divide your software into two parts, the low and high level. The low-level talks with your actuators in a real-time way to ensure proper motion execution. AFAIK (except the Orocos packages), the only controller available for now is the pr2_controller_manager. This control framework embeds different controllers, in particular one to move the base and others to move the arms following a pre-planned trajectory. One can communicate with these controllers using actionlib. It is interesting because it allows you to replace the control layer easily. See pr2_controllers for more information.

Basically you have two options right now:

  1. use Orocos,
  2. fork pr2_controller_manager. Note that 2. is not that hard actually as the software is not that PR2-centric (at least on the architecture point of view).

And depending on your choice controllers may or may not come with the infrastructure. But AFAIK most of them are tightly coupled with the control architecture they depend on.

Please note that there is on-going discussion about how to write a unified framework.

edit flag offensive delete link more

Comments

Thanks, this is a great help! I think I will try to do number 2, just to stay within the ROS framework but it's good to know there are other options! I have one more question though, I have encoders for 4 of the joints (pos/vel) but servers for the other 4 joints, Do I need 4 controllers for 2 arms?

MartinW gravatar image MartinW  ( 2013-02-07 06:38:47 -0600 )edit
2

There is currently a port of pr2_controller_manager to be more generic. It is ongoing here: https://github.com/willowgarage/ros_control and https://github.com/willowgarage/ros_controllers

fergs gravatar image fergs  ( 2013-02-07 11:13:10 -0600 )edit
1

answered 2013-02-06 21:10:08 -0600

dbworth gravatar image

Thomas is correct, ROS is used to give DrRobot a brain, so @MartinW you have to write your own "controller" to make it move first. It's difficult and you will have to figure most of it out by yourself.

Assuming you are using this platform called DrRobot, it must be something like this
http://www.drrobot.com/products_H20.asp
which looks like a bad-ass robot, so you should contact the company and ask about ROS support.

This got me interested...
From googling, it seems they have already released a ROS driver for some of their mobile ground robots:
http://jaguar.drrobot.com/specification_V4.asp
http://code.google.com/p/drrobot-ros-demo-base/

As for writing a controller for your robot, googling
site:answers.ros.org controllers or drivers
gives many great answers, including:
http://answers.ros.org/question/12182/controllers-vs-drivers/
http://answers.ros.org/question/11833/i-have-a-mobile-robot-that-isnt-currently-supported-by-ros-how-should-i-structure-the-driver-nodes-to-expose-my-robots-integrated-sensors-and/

First do the rest of the ROS tutorials, including the 2D turtle in simulation, and install the Turtlebot simulator (by Yujin/Willow) and do the tutorials for that too.
Then buy and read the ROS book.
Look at the ROS robots page and look at the code for all robots that are like yours e.g. low cost mobile robot.
Google will also find you great blogs by fellow users who have documented the process e.g. the Pi Robot tutorials, and Clam robot
There is less information about writing ROS wrapper for a robot arm, but there are examples of ROS packages that control the Bioloid/Dynamixel motors (wrappers for the Dynamixel driver) and the Katana stack (wrapper for the Katana control library).

To write your own ROS controller for your robot, you need to check what existing code is available in C/C++/Python to control the robot, and write a ROS wrapper (google it) for that code. In the best case, you can take some example code that comes with DrRobot, that maybe controls the robot via wireless link, then link to the ROS libraries (as per the ROS C++ tutorials) and simply bolt-on ROS topics to that code. You already have a joint state publisher, so obviously you know how to read from the encoders. Now you need to write some subscribers.

For the base: Look at the functions you have for controlling DrRobot, like stop/go/left/right or velocity=0to100 and decide what ROS message type matches that, like a Boolean or Velocity message. (google ROS message types) Like in the tutorials, there will be a callback for receiving the message, which is where you pass the data to the DrRobot function. Make it so that when you send a ROS message to your drrobot_driver node, it makes the robot move.

Then from your reading above, you will have seen that other mobile robots use 1 ROS message type in particular: "twist". So you can integrate that into your driver. Then if you launch an existing ROS joystick controller, that outputs messages on the /twist topic, your robot ... (more)

edit flag offensive delete link more

Comments

Hey dbworth! Thanks for responding, this is a great answer. Right now, I can send C++ commands through their driver and I have it publishing joint states. So do I write my controller within this driver? Or get it to subscribe to a controller that publishes on a different topic?

MartinW gravatar image MartinW  ( 2013-02-07 06:41:42 -0600 )edit

I think I understand how we call trajectories with a traj_client, and I've looked at other peoples action servers, joint_trajectory_action (the motoman one you suggested). But it's the interaction with the hardware code (working in ROS), the controllers, and the action server.Cant I make it all one?

MartinW gravatar image MartinW  ( 2013-02-07 06:46:01 -0600 )edit

Also, I'm just working on the robot's arms right now, the code I adapted was the ROS Jaguar code for their mobile robot :) My research colleague is going to start working on the base when he gets back from vacation! Thanks again for all the help

MartinW gravatar image MartinW  ( 2013-02-07 06:48:28 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2013-02-06 12:30:53 -0600

Seen: 779 times

Last updated: Feb 06 '13