change tf tree and determine camera poses

196 views
Skip to first unread message

Long Qian

unread,
Apr 4, 2022, 11:33:57 PM4/4/22
to tagslam
Hi Bernd,

Now I am trying to do sensor fusion with tagslam and turtlebot3. I encountered some problems about tf and camera poses. 

this is my tf tree
tf_tree.png
from your introduction in github, I know that rig is referred to robot body, so in this tree, I think rig is equal to basefootprint, but I don't know how to change it.

my camera is attached on turtlebot3, but I don't know how to change camera_pose.yaml to make a correct connection with turtlebot3. In rviz, they are sepreated from each other, and I think I need to connect them and then I can get right data.

Hope for your answer and thank your for help!
camera_poses.yaml
tagslam.yaml

Long Qian

unread,
Apr 5, 2022, 10:34:06 PM4/5/22
to tagslam
Hi Bernd,

I think my question can be asked by another way. That is how I can transform tags and cam0 to /map properly? Can tagslam finishes it or I need to pubulish a tf myself?

Hope for your answers and thank you.

Bernd Pfrommer

unread,
Apr 12, 2022, 8:48:36 AM4/12/22
to tagslam
This reply probably comes too late for you, sorr.y.
It turns out gmail put all emails from this group into the spam folder (hopefully no longer going forward).
Even though this reply probably comes too late:
I am not familiar with the turtlebot. It seems like something ("amd") is already publishing a tf between map and "odom". Does the turtlebot already provide a SLAM solution? In this case you need to configure tagslam to accept the odometry messages from the turtlebot (I hope it also publishes odom messages, not just transforms). Then tagslam provides the transform "map -> rig", and you will need to manually publish the transform rig->base_link. For instructions on how to configure odometry input to tagslam see the very bottom of the page here: https://berndpfrommer.github.io/tagslam_web/input_files/
Message has been deleted

Bernd Pfrommer

unread,
Apr 14, 2022, 11:02:27 AM4/14/22
to Long Qian, tagslam
I am hesitant to answer "yes" to your question about what the right tf chain is because the names of the reference frames ("map", "rig" , "base_link" etc) can have different meanings depending on how you define it.
So instead of yes-or-no answer, here a long one:
Tagslam publishes the following transforms:
1) From its world frame (defaults to "map", but you can set it with ROS parameter "fixed_frame_id") to all defined bodies that have a valid pose. This includes the "rig" body, if that is what your camera rig is named as in "tagslam.yaml".
2) A transform from each body to the tags that are attached to it
3) If the tag had a prior transform given, also the prior transform (so you can see how much the tag was moved from its original prior pose)
4) transform between camera rig and camera

You can *not* mix TagSLAM's transforms with those published by any other SLAM/odometry package. TagSLAM will publish the complete chain to put your robot into the world frame (aka "map"). Since your tags are specified in the world frame, it can directly provide the transform "map" -> "rig". And once you have the "rig" frame, then it's up to you to manually provide the transforms from "rig" to the rest of your robot (aka "base_link" etc). If you have any other packages publishing transforms from "map" -> "base_link" (or other parts of your robot) it will interfere with the transforms that TagSLAM provides and chaos ensues.
TagSLAM can however use input from other SLAM systems to provide a better tf "map" -> "rig". This is essential when no tags are visible. For that you feed *only odometry* messages from the SLAM/VIO system into TagSLAM, no transforms. Via the odometry messages, the SLAM/VIO system tells TagSLAM how the robot moves during times when no tags are visible. For an example on how to set this up TagSLAM with external odometry have a look at test case 19 in the tagslam_test repo.

To answer your second question: You only need to specify one ("root") tag. So long as there is overlap in vision between tags (e.g. Tag1 is seen in the same frame as the root tag) TagSLAM will deduce the pose of the second tag automatically. Even if there is no overlap this will work, so long as you have a SLAM/VIO system providing odometry in between.
If you see things going "crooked", for debugging operate TagSLAM only, without external SLAM/VIO to simplify your setup. If things still are screwy, here are some usual suspects:
- bad camera calibration
- wrong tag size specified
- bad camera calibration
- really poor lighting, tags are blurry in images (check debugging output of tag detector)
- bad camera calibration
If things work out without external odomertry, and bad stuff happens when you start using external odom, then usually it's the odom-to-rig transform that is wrong.

 

On Wed, Apr 13, 2022 at 10:07 PM Long Qian <qianlo...@gmail.com> wrote:
Yes, I also use Gmapping SLAM to build a map for navigation. Now what I want to do is to combine IMU, Odom, and Tagslam to improve localization and then feed the new Odom messages to navigation.
From your answer, if I understand correctly, the correct tf should be "map->rig->base_link" instead of "map->odom->base_footptint->base_link", right?
And I also have another question, whether all tags' poses should be specified when using tagslam? In my experiment, I only have known tag0 and other tags are randomly put. I make the robot move in a straight line but in rviz, I see it is a curved line. Is it because I didn't specify other tags' poses in tagslam.yaml?
Thank you for your help!

--
You received this message because you are subscribed to the Google Groups "tagslam" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tagslam+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tagslam/1b856fde-c3a9-4377-80cf-b136f94632f3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages