Home | Tutorials | Wiki | Issues
Ask Your Question
3

joint_state ROS topic from Gazebo and ros_control

asked 2013-08-20 20:10:35 -0500

munnveed gravatar image

updated 2013-08-20 23:03:43 -0500

I am trying to learn Gazebo/ROS from the tutorials and I am confused about a couple of things.

  1. When I run Gazebo as a ROS node, does Gazebo publish to the /joint_state topic? It does not seem like it does from looking at the topic subscriber/publisher graph. Is there a way for me to do this? It seems like necessary information to have for programming the robot from ROS. Also, I would like to view the state of the robot in rviz, which needs /tf data which in turn needs /joint_states (afaik).

  2. I do not understand ros_control and how it works with gazebo at all. ros_control is pretty much undocumented in ROS. Any suggestions on where to start looking for information? Or if somebody could give me a quick high level overview that would be incredibly helpful.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
4

answered 2013-08-21 02:52:13 -0500

Adolfo Rodríguez T gravatar image

Question 1

When using ros_control, the /joint_states topic is published by an instance of the JointStateController. This is a read-only controller that does not command any joint, but rather publishes the current joint states at a configurable frequency.

To run this controller you need to load its configuration to the ROS parameter server and load/start it in the controller manager. This launch file in the controller's repository does just that.

Once you have a valid joint_states topic, tf should start publishing frame data, and tf-dependent Rviz plugins like RobotModel should also work.

Question 2

These resources are currently available:

At some point these should probably be consolidated in a single place.

If you still have unanswered questions, don't hesitate to ask. There's a ROS Control SIG you might be interested in joining for ros_control-specific discussions.

Finally, consider that ros_control is not yet officially released, and not all parts of the documentation have reached maturity. Feature requests and patches are always welcome.

edit flag offensive delete link more

Comments

Question 1: That explains it! Ok, I got my /joint_states published. It turns out there was a bug in the ROS control with Gazebo tutorial. The configuration of the joint_state_controller is setup in the parameter server but the controller was not loaded into the manager. I updated the wiki to fix that.

munnveed gravatar imagemunnveed ( 2013-08-21 12:26:05 -0500 )edit

Question 2: Given that ros_control is not quite released, is there an alternative standard way in which control joints in Gazebo from ROS? How was it done before ros_control? Do I have to write my own plugin to interface with ROS? I very much appreciate your help. This is clarifying a lot of things for me.

munnveed gravatar imagemunnveed ( 2013-08-21 12:32:18 -0500 )edit

Before ros_control it was mostly a do-it-yourself thing. To save time, many people ended up adapting the pr2_controller_manager to their simulated robot, but that often resulted in different interfaces for the simulated and real robot scenarios. The ros_control project is in fact an evolution of the pr2_controller_manager aimed at being robot-agnostic.

Leveraging ros_control should be much less work than you doing a rewrite from scratch of a Gazebo plugin.

Adolfo Rodríguez T gravatar imageAdolfo Rodríguez T ( 2013-08-22 02:11:41 -0500 )edit

Thanks. I think I have gotten to the point where I can at least proceed further. I'm getting /joint_state updates and I can publish to the controllers to move my (toy) robot.

munnveed gravatar imagemunnveed ( 2013-08-22 02:50:45 -0500 )edit

I remap /joint_states to /MY_ROBOT_NAME/joint_states when node robot_state_publisher is started. Even if joint_state_publisher is not started, why there will be a joint_states topic?

dauker gravatar imagedauker ( 2018-04-04 09:31:46 -0500 )edit

Hi Munnveed, how did you manage to solve the question 1? Do you need to write your own .yaml file to map all the joints?

Kloping gravatar imageKloping ( 2018-05-18 04:36:11 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-08-20 20:10:35 -0500

Seen: 6,138 times

Last updated: Aug 21 '13