0
$\begingroup$

Rosanswers logo

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!


Originally posted by szokei on ROS Answers with karma: 80 on 2011-05-15

Post score: 0


Original comments

Comment by Asomerville on 2011-05-17:
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.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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

Originally posted by dornhege with karma: 31395 on 2011-05-23

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by dornhege with karma: 31395 on 2011-05-16

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by dornhege on 2011-05-16:
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.)

Comment by szokei on 2011-05-16:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.