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

what should the frame_id of topic "poseX" be, before use robot_localization package?

asked 2018-08-30 23:04:47 -0500

jxl gravatar image

updated 2018-09-05 22:41:06 -0500

Hello:

According to r_l(robot_localization) wiki, coordinate-frames-and-transforming-sensor-data doc, it can transforms geometry_msgs/PoseWithCovarianceStamped, on topic "poseX", in message header’s frame_id into the coordinate frame specified by the world_frame parameter (typically map or odom). I think this topic probably can be provided by a stereo VO, because mono VO cannot provide real scale info.

when i see the "poseX" callback function, it then calls preparePose func, in this line RosFilterUtilities::lookupTransformSafe(), it lookuptransform from "finalTargetFrame"(if we set it as odom), to pose msg.frame_id, what should this frame_id on this topic be? It looks like r_l thinks this frame is odom, the transform msg work should be done by users before use r_l, just like viso2_ros?

Generally speaking, the frame_id of pose on this topic is a fixed frame, such as a camera_0 frame(in some moment, camea is launched by its driver ros node). Only when we know what time stamp of camera is launched, we can get from odom frame to this camera_0 frame from tf tree, let we mark this as T_odom_to_camera0, and then we can transform msg on topic poseX to odom frame, T_odom_to_camera = T_odom_to_camera0 * T(msg_on_poseX), T_odom_to_baselink = T_odom_to_camera * T_camera_to_baselink., which T_odom_to_baselink is from odom frame to baselink with camera pictures estimated, T_camera_to_baselink is a tf static transform.

In other words, if robot base node and camera driver node are launched on the same time from start, T_odom_to_camera0 equals to T_baselink_to_camera ,we can get this TF directlly from tf tree. If they does not launched on the same time, we need to record time stamp of camera launched, because we need to record T_odom_to_camera0, anything wrong??

Currentlly, my idea is:

1: If we set world_frame is map, r_l thinks the default meaning of pose on topic poseX is base_link frame in map frame. The reason is : if the pose on topic poseX is base_link in odom, although with odom topic, we have no sources measuring base_link in map, r_l can not calculate a TF from map--->odom.

2: If we set world_frame is odom, r_l thinks the default meaning of pose on topic poseX is base_link frame in odom frame. r_l publishs a TF from odom--->base_link.

Regardless of which above case, when the poseX topic is provided by camera VO, the transform work including recording the TF between camera0 pose and odom(map), should be done by user before using r_l.

edit retag flag offensive close merge delete

Comments

I don't understand what "poseX" is supposed to be

fvd gravatar image fvd  ( 2018-09-02 20:41:46 -0500 )edit

"poseX" is pose0, pose1,..., posen topic of type geometry_msgs::PoseWithCovarianceStamped , defined in pose topic callback

jxl gravatar image jxl  ( 2018-09-03 06:40:51 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-09-05 20:50:16 -0500

Namal Senarathne gravatar image

I think specifying frame_id of the pose message published by camera_node to say camera_link and providing a static transform camera_link -> base_link should be sufficient (assuming you have set base_link_frame parameter to base_link and both world_frame and odom_frame to odom) if you only want fuse the camera pose data with some other sensor to generate an odometry.

If the robot already publishes an odometry (i.e. the transform odom -> base_link is already available through other means), setting world_frame to map would allow to fuse the pose to generate a global pose with respect to this world_frame

edit flag offensive delete link more

Comments

I don't agree that we should set frame_id of poseX as camera or camera_link, because geometry_msgs::PoseWithCovarianceStamped type's header frame id is a global frame, such as nav_msgs::Odometry 's pose component.

jxl gravatar image jxl  ( 2018-09-05 22:05:13 -0500 )edit

Ah yes, you are correct. My mistake! I

What I meant to say was to set frame_id to use the fixed frame id as you have suggested (to use camera0_frame) and providing a static transform between camera0_frame -> odom.

Namal Senarathne gravatar image Namal Senarathne  ( 2018-09-05 22:17:55 -0500 )edit

If you know that base_link starts at odom frame's origin each time, then camera0_frame -> odom is identical to the camera_link -> base_link transformation. Otherwise, you'd have to compute camera0_frame -> odom = base_link -> odom * camera_link -> base_link once at the start of pose node

Namal Senarathne gravatar image Namal Senarathne  ( 2018-09-05 22:27:17 -0500 )edit

Agree with you ^-^

jxl gravatar image jxl  ( 2018-09-05 22:54:26 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2018-08-30 23:04:47 -0500

Seen: 1,154 times

Last updated: Sep 05 '18