From base_laser_link to odom frame transformation?
I'm trying to solve a problem related to frame transformations. I have two frames, /odom and /base_laser_link. I can calculate coordinates of obstacle from laser_scan ( base_laser_link is frame), but I'm having a problem transforming those coordinates from /base_laser_link to /odom. I need real coordinates of obstacles. I tried to use tf class, but problem is i don't know how to transform that point from one frame to another using this class.
Edit:
terminate called after throwing an instance of 'tf2::InvalidArgumentException'
what(): Invalid argument passed to lookupTransform argument source_frame in tf2 frame_ids cannot be empty
This is the error that I got. Anyway I'm trying to calculate coordinates of obstacle points using LaserScan msgs. I made a callback function in witch I'm calculating those coordinates and now I'm trying to recalculate them using TranformListener , so that I can get coordinates in /odom frame. I need this approach in order to exclude points from optimization problem. Template that I used for converting LaserScan msgs to 2D coordinates is as folows:
For the Hokuyo URG-04LX-UG01 (as an example), the angular resolution is 0.36° which is what you would get if you do 240/ranges.size().
Therefore, assuming the X axes (phi=0) is following ROS convention, you have to set -120° to ranges[0] and then increase it by 0.36°. In summary: phi = (i * 0.36)-120. And then, convert to radians.
Hope you understand the problem. And thanks for help :)
@ANY: please don't post answers unless you are answering your own question. For the rest, please use comments or update your original question. Use the edit link/button for that. Thanks.