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

what's the meaning of using tf here?

asked 2022-03-26 08:56:46 -0500

DC pig gravatar image

updated 2022-04-30 13:46:20 -0500

lucasw gravatar image

I'm learning how to get the cost of costmap in Nav2, so I read the costmap_tester.cpp to learn how to get the costmap_2d data structure. But I'm confused at this: tfl and the line 167. Is the using of tf necessary? If so, what's the effect of the tf here? Thank you very much for your effort.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-27 08:30:58 -0500

Mike Scheutzow gravatar image

updated 2022-03-27 08:37:09 -0500

The costmap object needs to transform all of the input data into a common frame before it can be combined. Usually the map frame is used as the common frame. That's why costmap needs a TF Buffer object.

Make sure you understand the distinction between "creating/updating a costmap", and "reading costmap data". Normally move_base does the first, and your ros node does the second (by subscribing to a topic.)

edit flag offensive delete link more

Comments

I have see verify the test, it shows that the tester.cpp if out of date in ROS2 foxy. And the constructor using tf is dropped. And I found the way to get costmap by getting the map topic and constructing the costmap2d using the data from the topic. Thanks much!

DC pig gravatar image DC pig  ( 2022-03-28 06:44:57 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-03-26 08:56:46 -0500

Seen: 128 times

Last updated: Mar 27 '22