Ask Your Question

rviz and c++

asked 2012-04-22 14:13:03 -0500

manang gravatar image

updated 2014-01-28 17:12:03 -0500

ngrennan gravatar image

Hi, I'm Angelo and I'm beginner. I want to know if it's possible to command a robot with c++ and rviz. That's, if I can calculate the value of non fixed joint and send the value to rviz and so I can see the effect. If yes, could you send me an example? Thank you very much Angelo

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-04-22 21:18:38 -0500

Lorenz gravatar image

updated 2012-04-23 01:55:43 -0500

Rviz doesn't visualize robots based on joint values. Instead, you have to create a urdf description of your robot and run a robot_state_publisher. The robot_state_publisher subscribes to the joint_state topic which is normally published by your robot driver and publishes the link poses of your robot. Rviz will then be able to visualize your robot. Have a look here and here for tutorials on URDF.

EDIT: You need to send commands to your robot driver. On the PR2, one specific robot driver node runs a lot of controllers that provide different action lib actions. When they receive an action goal, they calculate the corresponding motor commands and move the robot. Moving the robot changes the encoder values and the published joint states change, the robot moves in RViz. We don't know about your robot platform and how your hardware accepts commands, so we cannot give a more specific answer.

edit flag offensive delete link more

answered 2012-04-23 00:32:12 -0500

manang gravatar image

Ok, I'm a urdf of my robot and now i can visualize my robot in rviz. With giu:=True is possible to move my joint, but I want to move my joint with my program in c++.

edit flag offensive delete link more


This is not a forum. Please don't create new 'answers' to discuss but comment on existing answers or edit your question.

Lorenz gravatar image Lorenz  ( 2012-04-23 01:51:55 -0500 )edit

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


Asked: 2012-04-22 14:13:03 -0500

Seen: 626 times

Last updated: Apr 23 '12