How to transform from occupancyGrid-coordinates to map-coordinates [closed]

asked 2020-07-06 04:54:43 -0500

Flontis gravatar image

Hey ROS-community,

I am new to ROS and have the following problem: I got car which is driving around and scanning the world for obstacles. These scans are published via an OccupancyGrid. From the coordinates, i.e. the indices of the data-matrix, I want to calculate the map coordinates to know where the obstacle is and to compare later whether it is moving or not.

I tried already this, but the results are not correct. So I guess I have to take the orientation of the car/the occupancyGrid or something else into account, but I don't know how.

Can you help me or provide a suggestion how to solve this problem? I already encountered the TF-package, but since it seems to be a quite large package and my problem seems to me to be done in a few lines of code, I don't want to overshoot.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Flontis
close date 2020-07-11 13:46:54.920127


but the results are not correct

Can you detail exactly what you tried and why you believe the results aren't correct ?

Delb gravatar image Delb  ( 2020-07-07 03:07:26 -0500 )edit

Update: Was my fault. Thought the coordinates of my /pose topic are map-coordinates, but they were world-coordinates, so I had to transform again and then it worked :D

Flontis gravatar image Flontis  ( 2020-07-11 13:46:45 -0500 )edit