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

How to log a global path defined in "/map" frame.

asked 2013-02-26 14:24:36 -0500

moyashi gravatar image

Hi, everyone.
I'm using navigation stack and would like to log a global path defined in "/map" fame.
How can I do it ?

Navigation stack's setup has already done and it works well.
I thought that a global path defined in "/map" frame could be got
by subscribing "/move_base/TrajectoryPlannerROS/global_plan" topic
and transforming it from "/odom" frame to "/map" frame
with tf::TransformListener::transformPose() method
.

However it didn't work well and I had a following error.
Frame id /map does not exist! Frames (1):

A result of "rosrun tf view_frames" shows that there is a "/map" frame.
However, a result of "rosrun tf tf_monitor" doesn't show a "/map" frame
(Perhaps, because it is not broadcasted continuously?).

How can I log a global plan (an array of geometry_msgs::PoseStamped) defined in a "/map" frame?

Thanks for your attention.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-02-27 01:40:53 -0500

Achim gravatar image

One thing you could try is to wait a little for the transform: listener.waitForTransform(destination_frame, original_frame, ros::Time(0), ros::Duration(10.0) );

This would wait at most 10 seconds for the transform to show up.

Of course that won't help if there is some fundamental issue with your tf setup. But generally for a new run node you should call waitForTransform before you try to use transforms for the first time. Also you should be sure to keep the transformlistener over the whole runtime of your node. If you require the tf for a special timestamp, be sure to adjust the third param of the waitForTransform call, also. ros::Time(0) means "the latest transform" in the tf-context.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-02-26 14:24:36 -0500

Seen: 580 times

Last updated: Feb 27 '13