How can I fix my base_link to the z axis?
I am trying to make a self-navigating robot using slam gmapping and the navigationstack. The robot uses a zed stereo camera to navigate. the robot creates good laserscans and can also create maps. However, the tf of my base_link and base_frame drifts away from the map sometimes in the z axis. Im wondering if you could constrain it from not moving in the z-axis, so that even when the camera moves upwards, my program handles it as being on the same level as before.
Because now, as soon as my robot tilts, moves upward or anythin, it gets lost and stops creating a map...
Please edit your description to tell us the frame names in your transform tree from
map
down to `base_link
. Also tell us whatbase_frame
is, since that is not a standard name. Your problem is most likely that you are not correctly updating one of the parent frames ofbase_link
.Hi! I'm very new to ros, but i guess your talking about the tree you get from running "tf view_frames"? if that's the case, my tree goes from map-> odom -> baselink which then splits to zed_base_link and base_frame. I'm actully not sure what my base_frame is, I don't think it serves any purpose to be honest...
To give some more information, my base_link isn't restricted to odom when i'm looking at rviz. I assume my laser always should be connected to odom. Odom on the other hand doesn't drift away from the map, so if I could restrict my base_link to odom in one way I guess it would work...?
Your TF Tree is typical.Assuming it is solidly mounted on the robot, the TF of your lidar should be a child of
base_link
.What do you mean that "my base_link isn't restricted to odom when I'm looking at riviz"?
I mean that my base_link isn't linked to the odom tf. I want them to be linked? connected? Hard to explain, but the tf of base_link should always be on the same place and orientation as odom. If odom moves I want the base_link to move with it, but now they both move independantly.
I have tried to connect them using the "transform publisher" with odom as the parent and base_link as the child, but that doesn't work. I'm sorry if that's a bad description...
The base_link frame IS "linked" to odom because base_link declares the odom frame as its parent. You told us that your TF Tree shows that. Is your problem occurring while you do the gmapping, or afterward when you are trying to navigate using the generated map?
It's occurring when I'm doing the gmapping, and that is what I'm struggling with. I have ran the tf tree several times, but it always shows that odom is a parent of base_link... Could there be anything else or should they move together if they are parent and child?
Could include that even though map is parent to odom, map doesn't move with odom either
Could I maybe send a video or anything, if there's anything missing?