Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Answer to what your intent likely is:

Since you're going through the Navigation Tutorials, I will assume your main goal is to get a robot navigating. With that assumption I'll say you do not need to do what you are trying to do. The navigation nodes AMCL/move_base will do any transforming required between the laser scan info and the laser to base transform. The TF tutorial was showing you how to do a single point as an example. You don't need to do this to get Navigation Stack working. You need to publish the TF of laser to base for NAV stack, but you do not need to write any listener for NAV stack (if memory serves).

Answer to your direct question:

If you really want to convert the entire laser scan to the base_link frame point by point then you'd have to do it point by point.

To start, convert first laser data point from polar to rectangular coordinates and then add/subtract off the transform between laser and base. Then store that back into an array. Move to next point and start again.