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

Revision history [back]

click to hide/show revision 1
initial version

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 will move. Now you have a driver and you've leveraged existing ROS code to control it with a joystick.

For an arm: Look at the functions you have for moving the arm e.g. move absolute 20 degrees or relative 1.2 radians. Then add a subscriber using the same joint states ROS Message type, which will accommodate position and velocity if required. The callback in your code will take those position or velocity values and send them to the DrRobot function. Now you can move the arm.

Lastly, you will need to modify a copy of the (Follow)JointTrajectory node to convert between trajectory messages to position/velocity messages for your robot. That step will be the most difficult. The only information currently available is looking at this code from other robot arms.