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

Using Real Robot Data in Warehouse Scene Planning

asked 2013-01-22 09:50:34 -0500

MartinW gravatar image

Hello all,

First off, I am having a successful time working with all the ROS tutorials for my robot. It's great to have all this support from an online community :)

So far for my robot, I have created a URDF file, ran the planning wizard and created a launch file to be used in Warehouse Viewer for my robot. I have done most of the tutorials in Warehouse Viewer and now I would like to use my real-time robot data as the inputs for Warehouse Viewer.

However, I do not know where to start from here. The tutorial informs me of this warning:

Warning: Do not check "Use Robot Data" while the Execute Left Trajectory and Execute Right Trajectory services are not being advertised. Make sure they are running by invoking rosservice. Otherwise, the viewer will hang on startup while waiting for these (or any other) services.

As for my hardware, I am publishing motor encoder data (position and velocity) under topics /The_H20_Player/drrobot_motor_left and /The_H20_Player/drrobot_motor_right at 10Hz.

I would like to somehow use this data as the inputs for Warehouse Viewer. Does anyone know I can do this? Moreover, how should I structure the encoder data? Right now I just have it as an array of ints.

Thank you to everyone at!

Kind Regards, Martin

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-01-23 05:56:13 -0500

dbworth gravatar image

Okay first you have to fix how you publish that encoder data...

The ROS standard is that your robot driver code should publish the encoder data to the /joint_states topic.
At a minimum you need to have the position data in radians.
Look at some other robot (simulation) models to see how they work.
This joint states topic is a vector joints, with names matching the joints in your URDF file.
Publishing this topic correctly is the first thing you should test with a real robot.

It sounds like your data is currently in a different format/topic.
If you can't, or don't want to modify the driver code to publish the joint states correctly, you could create a node that reads the drrobot_motor_* topics and re-publishes that data onto /joint_states.
You can look in the code for other robots, or google "ros joint state publisher" to find the code you need.

Next, you need to get Rviz loading and display your encoder data.
If you are publishing a joint states topic with joint names matching your URDF, then Rviz will display the current state of your real robot!

Then, you can look at the Warehouse...
Download the motoman stack from ROS industrial. The SIA20D_Mesh_arm_navigation directories contain 2 launch files which show you the parameters that need to be changed for simulation VS. real robot.
Or, Google this forum for your same question, because it's been posted on here too!

*### Lastly, there is a useful node called The Joint State Publisher, which is a GUI for publishing fake joint angles. You can use this to read in your robot's URDF, and publish a fake /joint_states topic so you can test the Warehouse with "real robot data" before you fix your driver.
Use the top 4 lines from this launch file:

edit flag offensive delete link more


Thanks for the answer, dbworth! What are some other robot (simulation) models I can look at to see how they work? I can definitely augment the published data however I like so I will try to make it a proper /joint_states topic

MartinW gravatar image MartinW  ( 2013-01-23 08:45:07 -0500 )edit

Excellent, so I was able to easily transform the joint angles into joint_states msgs, so now I just have to ensure these are in radians and I'm all set to import this into warehouse :)

MartinW gravatar image MartinW  ( 2013-01-23 09:13:49 -0500 )edit

Hey dbworth, so I am publishing the data under joint_states, but how do I run rviz and have my urdf loaded. From the tutorials I made my launch file look like this: But I get an error in rviz here: Any ideas? Thanks for the help!

MartinW gravatar image MartinW  ( 2013-01-23 11:30:03 -0500 )edit

Other robots? Use Google and look here: . Find a robot (mobile or arm) this simple and similar to your own. For a manipulator, some examples are Clam or Katana. For a mobile robot, there's TurtleBot.

dbworth gravatar image dbworth  ( 2013-01-23 23:08:33 -0500 )edit

Testing your robot model in Rviz: write a launch file with the top 4 parts from the launch file I linked. It loads the URDF, loads the Robot State Publisher, loads a fake Joint State Publisher with GUI, and loads Rviz with a saved configuration. You will need need to save your own config from Rviz

dbworth gravatar image dbworth  ( 2013-01-23 23:13:29 -0500 )edit

Viewing your real robot in Rviz: copy the above new launch file, and remove the fake joint state publisher. You will then need to include the node (your hardware driver) that publishes the real joint states (encoders).

dbworth gravatar image dbworth  ( 2013-01-23 23:14:49 -0500 )edit

Ahh, okay! So I've got the fake joint state publisher to open with my robot, but when I take that part out and try to use the robot drivers I don't get the transformation. Here is my launch file, "H20_player" publishes the encoder data. How do I connect this with rviz

MartinW gravatar image MartinW  ( 2013-01-24 06:30:49 -0500 )edit

The "H20_player" publishes the /joint_states_left_arm and /joint_states_right_arm (sensor_msgs/JointState) but I am unsure how to make rviz subscribe to this in the launch file. If I'm thinking about this correctly haha thanks for all the help :)

MartinW gravatar image MartinW  ( 2013-01-24 06:38:00 -0500 )edit

Question Tools


Asked: 2013-01-22 09:50:34 -0500

Seen: 538 times

Last updated: Jan 23 '13