0
$\begingroup$

Rosanswers logo

I recently try to run SLAM gmapping on PR2. Here's my procedure:

1.roslaunch gmapping slam_gmapping_pr2.launch on PR2. I've set the parameter odom_frame to odom_combined to suit PR2.

2.roslaunch pr2_teleop teleop_joystick.launch on my computer to move the robot around.

3.rosrun rviz rviz on my computer to show the map

However, the gmapping node would not publish the transform from /map->odom_combined. Therefore, if I want to show the Map, I have to manually set the fixed frame to /map, which does not exist. I can show the map and it will expand when I teleop the robot around. Only the transform is missing.

What might the problem be? Thanks for any advise.


Originally posted by Albert K on ROS Answers with karma: 301 on 2013-09-26

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hey,

The way I understand the question is that, gmapping is working fine but to visualize it in rviz u have to manually set fixed frame as "/map".

If the problem is only with visualization then u can save rviz settings once so that u don't have to set fixed frame every single time, but if gmapping is not publishing map frame then its a different problem.

To confirm whether gmapping is publishing frame use following command

rosrun tf tf_echo /map /odom_combined If u see the tf output then gmapping is working fine.

Originally posted by ayush_dewan with karma: 1610 on 2013-09-26

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Albert K on 2013-09-27:
Yeah, I've tried both view_frame and tf_echo, the frame does not exist. Since the /map->/odom_combined transform is missing, we cannot localize the robot correctly. The SLAM functionality is reduced to only mapping.

Comment by ayush_dewan on 2013-09-27:
That seems a little weird. Is gmapping not publishing any frame or it is not publishing map->odom_combined?? In rviz check the tf tree once and confirm whether frame "/map" exists or not??

Comment by Albert K on 2013-09-29:
It seems to be the problem of time synchronization problem between c1 and c2 computer on PR2. It is said that the tf is very sensitive to time. After I run the time sync command on basestation, c1, c2, everything gets fine.

Comment by Albert K on 2013-09-29:
The clock sync command can be found here: http://pr2support.willowgarage.com/wiki/PR2%20Manual/Chapter13#Clock_Synchronization

$\endgroup$

Your Answer

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