Ask Your Question
0

How can I change transform from "frame A" to "frame B" ?

asked 2019-10-01 06:33:33 -0500

kane_choigo gravatar image

updated 2019-10-01 06:38:36 -0500

Hi, I'm using ROS kinetic on ubuntu 16.04.

I'm working on multi-sensors conditions. (one RGB-D sensor and 2D-Lidar sensor)

As you might expect I have to fuse these two scan data for robustness measurement.

And unfortunately, each of these two topics has different frame names.

In detail, laser topic has "laser" frame but RGB-D topic's frame name is "base_footprint".

As I'm still new to ROS tools, I'm suffering from modifying the two topics.

Below is the warning I got

[ WARN] [1569927078.948303952]: Failed to lookup transform from frame laser into target frame base_footprint! Dropping input DetectedPersons message on topic /spencer/perception_internal/detected_persons/laser_front. Reason: "laser" passed to lookupTransform argument source_frame does not exist.

If anyone happened to know how to do it, can I get some advice? (I decided to modify frame name of "laser" to "base_footprint")

Thanks in advance :)

edit retag flag offensive close merge delete

Comments

Sorry, but why do you want to modify the frame names? It is meant to have a different name, since they probably are two different frames, right? It's not like a pub/sub topic, it is a coordinate frame in which the data is received. You should transform your data from laser into base_footprint or the other way aoround.

Have a look at this and this

LeoE gravatar image LeoE  ( 2019-10-01 07:00:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-01 14:05:49 -0500

Hello !

First you should take a look at @LeoE link in the comment, there is all you need to know about tf, take a look at this answers if you want some image.

I you want to fuse the sensor data, you don't want them to have the same Frame as they don't have the same location.

When you publish a Frame, you actually tell Tf that there is 2 frames : The source frame and target frame.

For example, here is the frame from the "rgbd_launch" package (you can see it with rosrun tf view_frames: image description

each broadcaster is broadcasting the target and the source. The Camera link, the source of all frame, is never broadcasted, instead ROS is waiting for an another node (the application node) to tell where is this frame.

If you launch your lidar node, you should have something like this (I don't have a lidar so I just assumed a single tf was published, I used static_transform_publisher :

image description

In this case, lookuptransform will fail, as the tf tree are not connected.

In your application you should tell Tf where are located the camera to the lidar (or the inverse), or even better if you have a reference point (A robot chassis ?) for the camera and the lidar

For example, I can tell TF that the lidar is 20cm above the camera (Z-axis) with rosrun tf static_transform_publisher 0 0 0.2 0 0 0 camera_link laser_base 10: image description

Or if both the camera and the lidar are connected to the same robot, I can tell tf too : image description

You can use different way to tell tf the transform between your sensors, the best way (I think) is an URDF with robot_state_publisher :

http://wiki.ros.org/tf/Tutorials

http://wiki.ros.org/robot_state_publi...

http://wiki.ros.org/urdf/Tutorials

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-10-01 06:33:33 -0500

Seen: 218 times

Last updated: Oct 01 '19