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

robot_description synchronization gazebo RViz

asked 2011-05-15 20:09:56 -0600

szokei gravatar image

My objective is to synchronize the position of the robot in Gazebo and RViz. In Gazebo the robot model is launched into a position different than the origin while in RViz the position is set from the transform odom->base_footprint sent by gazebo, but the robot didn't moved from it's initial position hence is clear why im getting (0,0). How to load the Robot Model into RViz in a specified location.Thank you!

edit retag flag offensive close merge delete

Comments

Thanks for adding to ROS Answers. For additions to your original question. Please use the 'edit' link below your question. The 'Answers' field should be reserved for answers so we can keep the system working correctly.
Asomerville gravatar image Asomerville  ( 2011-05-17 04:41:07 -0600 )edit

5 Answers

Sort by ยป oldest newest most voted
0

answered 2011-05-23 05:21:51 -0600

dornhege gravatar image

I think I understand your problem now. RViz only displays the robot's view of the world, so you can't really set something directly. I also don't know why you would need that. I can think of some ways to achieve what you want. Bascially you need a transformation going from <some_frame> -> /base_link that equals the gazebo pose.

  • In your map, change the map offset so it fits the position. /map -> /base_footprint should now work with localization.
  • Use a fake_localization with the gazebo position.
  • Publish a custom tf /gazebo_pose -> /base_footprint
edit flag offensive delete link more
1

answered 2011-05-16 03:08:08 -0600

dornhege gravatar image

I'm not sure what you want to achieve. Where are you getting (0,0)?

As it is set, rviz does not get the transform from odom->base_footprint, but from what you defined to be the fixed frame or for viewing in the GUI from target frame. So, if you are running in a localization configuration you want to set the fixed frame to /map. You might want to have a look at this page: RViz Coordinate Frames.

edit flag offensive delete link more

Comments

I've attached the tree. I've created a path planning method and I want to run it in both simulators. In Gazebo I was able to set the initial position of the robot but in RViz the robot's position is calculated from the transform odom->base_footprint, the odom is still 0,0 which is correct, the robot didn't moved yet. Although this transform is needed for the whole process in the initial step something needs to be changed.
szokei gravatar image szokei  ( 2011-05-16 20:02:14 -0600 )edit
I'm not sure what you think should be changed. Perhaps one note: rviz is not a simulator, but only displays data from the system (gazebo, SLAM, etc.)
dornhege gravatar image dornhege  ( 2011-05-16 22:58:49 -0600 )edit
-1

answered 2011-05-17 03:38:28 -0600

szokei gravatar image
edit flag offensive delete link more

Comments

I've compared the screenshots and to me they look correct.
dornhege gravatar image dornhege  ( 2011-05-17 05:05:08 -0600 )edit
In Gazebo the robot's position is in (0.9, 7.7, 0) while in RViz is (0,0,0), I would like to have the same initial position in RViz also. Thank you.
szokei gravatar image szokei  ( 2011-05-18 20:42:01 -0600 )edit
-1

answered 2011-05-17 00:34:37 -0600

szokei gravatar image

Gazebo_robot.png

RViz_robot.png

PLease check the 2 screenshots, the initial pose in gazebo is successfully set while in RViz the robot's initial position should be in the upper point of the dashed line. The "fixed frame" is set to /map. The "base_footprint" value is (0,0,0) due to the odom->base_footprint transform.Thank you.

edit flag offensive delete link more

Comments

You added the rviz screenshot twice. Besides all the markers it might be OK.
dornhege gravatar image dornhege  ( 2011-05-17 03:31:18 -0600 )edit
-1

answered 2011-05-16 20:02:23 -0600

szokei gravatar image
edit flag offensive delete link more

Comments

For your setup, you should set the "Fixed Frame" in rviz to /map. That should display the robot correctly.
dornhege gravatar image dornhege  ( 2011-05-16 22:57:19 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2011-05-15 20:09:56 -0600

Seen: 2,776 times

Last updated: May 23 '11