Ask Your Question

robot_localization with turtlebot3 [closed]

asked 2020-06-18 10:11:51 -0500

pfedom gravatar image

updated 2020-06-19 11:10:59 -0500

Hi guys,

I'm just getting started with the robot_localization package on Ros2 eloquent at the moment. I'm trying to fuse a noisy odom and the Imu signal from a Turtlebot3. I am producing the noisy odom from the odom message created by the Turtlebot3. Than I want to fuse it with the Imu that is also given by the turtlebot. I tried it with the same matrices like shown in this ROS live class (ekf launch):

odom0_config: [true, true, false, false, false, true, true, false, false, false, false, true, false, false, false]

imu0_config: [false, false, false, false, false, true, false, false, false, false, false, true, true, false, false]

If I visualize it in Rviz the odometry/filtered "Odometry" starts to move into one direction and just moves out of the view, while the turtlebot odometry is moving in a slow circle. In my understanding the goal should be that the filtered odometry is pretty similar to the odom without the noise ?

publish tf is set to false (as said in the tutorial). Here is my TF-tree while everything is running: image description

my set frames are: odom_frame: odom; base_link_frame: base_link; world_frame: odom

I also get this warning everytime I start the ekf node: [ekf_node-1] Warning: Invalid frame ID "base_link" passed to canTransform argument target_frame - frame does not exist

Is someone seeing the mistake I made or why it isnt working? I hope this is enough information, if you need more just tell me and I will add it.

Thanks in advance!

EDIT: I tried different things and changed the matrices. At the moment they are like shown in the robot_localization docs here: 3rd. box.

I quickly added the ekf launch and yaml file to a git repo:

current state: the robot is not moving. There is just the noise on the odom signal. After starting the ekf-node the filtered_odometry moves starts slowly and than moves out of the window (fixed frame: odom). Looks like an error is summing up or something like that maybe?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by pfedom
close date 2020-07-10 04:17:34.694439


yaml and launch files would be nice. The odometry frame shouldnt move at all, its the reference. It might be moved by a map -> odometry localization (odom correction) node via tf though. base_link frame should move relative to the odom reference. What is the default_authority node? Iam suspicious why it publishes odom frame tf. The linked tutorial is not good for reference, as its an hour long and not searchable. Is theere a github or something with the files from the tutorial?

Dragonslayer gravatar image Dragonslayer  ( 2020-06-19 08:58:29 -0500 )edit

By the way your odom config and imu config, do not seem to be the same as in the tutorial (at least as a quck scrub seem to indicate).

Dragonslayer gravatar image Dragonslayer  ( 2020-06-19 09:30:03 -0500 )edit

I loaded the files up to a repo: The odom signal (published by the turtlebot) is moving just like the bot itself in the fixed frame: odom. I dont know where the "default authority" comes from. Its what tf2_tools view frame says. I just started the turtlebot3. I updated the matrices like shown in the robot_localization docs for reference.

Sorry if I'm missing some easy steps, I am pretty new to this and I hope I formulated everything right. If I'm saying something wrong or missing something please do not hesitate to correct me. I want to understand this correct!

pfedom gravatar image pfedom  ( 2020-06-19 11:15:03 -0500 )edit

You are using ROS2 but the tutorial is ROS, Iam not sure how this should work out, but ROS2 is not just ROS with some bling, but different. I would suggest using explicit ROS2 tutorials and documentation. I dont know ROS2 so Iam sorry I cant help you here. But as you have this ekf error "invalid frame_id base_link" you could try base_footprint instead, or look up what this default_authority publisher is doing.

Dragonslayer gravatar image Dragonslayer  ( 2020-06-19 11:44:27 -0500 )edit

I haven't found a tutorial for ROS2, and I thought the matrices shouldn't differ much. The rest of the yaml file isn't changed from the github repo for eloquent.
Is there an official one for ROS2? On github, the ros wiki is linked.

Thanks for the tipp with base_footprint, I will test this!

pfedom gravatar image pfedom  ( 2020-06-20 03:13:05 -0500 )edit

Yes ROS2 should be similar in regards to paramters of ported nodes. But its really the tf tree that bothers me, also ROS2 has managed nodes Iam not sure how this comes into play here. I dont understand how you can have a odom/filtered frame as well as odom at the same time, in the same tf tree, without a map frame or similar. As I mentioned before odom frames are references and the child frames should move. Thats why I think its a tf problem somehow.

Dragonslayer gravatar image Dragonslayer  ( 2020-06-20 07:39:51 -0500 )edit

Yeah maybe your right. I will have a look at the tf's again. I am still a noob in tf but maybe I find the error. I will let you know if I find something out.

pfedom gravatar image pfedom  ( 2020-06-20 08:01:43 -0500 )edit

As a last note. It came to my mind, that sometime ago I red about issues with a hybrid robot. It had ROS2 and ROS connected via ros bridge. I believe to remember that in that situation there were actually two tf trees. That caused problems as somehow it all looked right (tf tree) but actually the tf frames were not connected. It could be that you get the transform error (and or strange behaviour), because you reference a frame from one tree to a frame (odom or odom/filtered) that is actually connected to a reference frame with the same name on another tree. I would also consider just make the navigation stack work, use simple odom first (ekf can give you headaches when not well configured) and only if the standard navigation stack works, go for ekf. You will find much more people that can help you with ...(more)

Dragonslayer gravatar image Dragonslayer  ( 2020-06-21 09:00:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-07-10 04:16:43 -0500

pfedom gravatar image

sorry I forgot to give an update here. After some restarts everything started working and the output was as expected. I think it was an error from the simulated sensors. Killing everything that was up from gazebo and restarting the VM helped. Right now I am trying to get RL going on a real robot but if I have problems there I will write a new seperate question. I am going to close this one here.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-06-18 10:11:51 -0500

Seen: 917 times

Last updated: Jun 19 '20