-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TF NaN errors when starting navigation after amcl #1458
Comments
What specifically are the values you’re putting into it? NaNs usually show up from poor conditioning of quaternions. |
I don‘t have them by hand now, but the Parameter values passed in, are definitely correct. |
Try to find those values for me. Also make sure your TF tree is fully defined. The only way you get NaN in position and orientation is by having messed up quaternions if you think about how homogenous transforms are calculated |
These are my inputs: Odom - base link tf:
And after trying to reproduce this, I found out that if I start odom driver, amcl and laser, all is fine.
If I start navigation before amcl, it's fine also. |
Mhm. Is someone sending a transform on startup with an uninitialized quaternion for its (0,0,0,0) or something? I'm not going to have cycles to look into this this week, but it sounds like you have a pretty good bet of where the issue is. PRs always welcome :-) |
https://github.com/ros-planning/navigation2/blob/master/nav2_amcl/src/amcl_node.cpp#L600 That line shows that it should exit if it can't get odometry. Above it also checks for the laser -> base link transform. |
No, I am not really sure anymore. :-) Update |
Wait, are you saying you have both a SLAM library and AMCL running? That’s not how this works. AMCL is a localizer and ST is a mapper. They both produce map->odom transformations, essentially replaceable with each other. Having both run at the same time in the same namespace will have undefined behavior. Ok, from that comment, I need to know alot more about your setup. |
Oh, no I don‘t think so, because I switched off publishing tf in mapping node. I need to check parameter tomorrow, but I am quite sure. |
Then why mention or run SLAM? Can you try this without that running anywhere? |
It was only coincidence. I was just running the mapping process as I wanted to try something out and then got the error again. |
Ah ok. So you think its something upstream of AMCL, and also ST. That would place it squarely on the TF from base->sensor, TF odom->base. It could be actually an invalid report from the first reading of the base driver’s odometry or gazebo. Is this simulation or hardware? Any info you can provide there? And I think it would make sense in gazebo if navigation isn’t launched yet. I think that provides the robot state publisher (not sure off hand) so there’s no valid transformations which the gazebo plugin might not check for. |
It‘s on real hardware. Didn‘t try to reproduce in gazebo yet. The first reading of the drivers odometry I posted a few comments before. |
Try in gazebo. Lets try to isolate where its coming from. I suspect highly its the odometry source. |
It might also be worthwhile to log the transforms by doing |
Well the problem is it could also be not a direct transform but NaNs introduced in multiplying transforms. I do agree though that is likely to find the culprit but just a note that if you don't see it, that doesn't rule it out. |
So on the real hardware I recorded tf. NaN transforms after amcl is running ok and navigation is started
...
Complete logfiles: Update Next update |
Please post your amcl configuration, TF tree from RQT, and a sample laser message |
Scan msg
Amcl config
TF tree coming soon. Can't see RQT plugin atm... tf monitor
|
Your config has x/y/yaw, what are those specific values? I might guess that your yaw is invalid. Your z_* variables, the ones in use for your specific sensor model, must add up to exactly 1.0. Make sure that is true, I forget off hand which ones your sensor model uses. Post your TF tree when you can. |
The last one is yaw. |
Whats your scanner to base link transform? I dont see it in tf (it'll be in tf_static) |
TF graph is not working as |
Your frames are incorrect. You have If you look at your TF monitor, you'll see all but 3 have the |
Well I don't do that intentionally. So
If you say that |
Frankly at this point, I'm not exactly sure. I'd need you to give me exact instructions to reproduce to look any further. Do you see this with the default stack or is it only with your specific hardware / configurations / software? If you start with default stuff and change things block-by-block until it occurs again that will at least give you an idea of where to look. Unfortunately, from what you've described above, there's not much more I can do without more context or ability to trigger myself. |
Can someone explain the idea behind this here:
So when I start another node, in my case navigation stack, the parameter callback of amcl is triggered, because we can't subscribe to a specific parameter yet. So amcl
For now I just commented the functions in |
In AMCL (https://github.com/ros-planning/navigation/blob/melodic-devel/amcl/src/amcl_node.cpp#L499) for ROS1, the dynamic reconfigure (the way we think about updating parameters) callback would change all the parameters, initialize a new particle filter, odometry model, etc. For ROS2, that's done with the parameter callbacks. What you point out there is essentially the same process but factored into steps. This is give or take, a direct port. This PR reverted the function you listed above as a problem for the current master branch. So that method is no longer even in the codebase. |
Omfg, why didn‘t I see this pr ...!? |
Well, PR was only for master. |
reopens ticket
Commentary aside, that would be lovely. I think we're at a point for a Eloquent sync. @crdelsey do you mind setting up an Eloquent release with commits? |
Closing ticket, we've figured out the issue. Next time eloquent is synced it will be handled there |
I am passing the initial pose by parameter at startup.
But occasionally I get this error:
And only solution without restarting amcl is to pass a new inital pose with rviz for example.
And I found out, that if I start amcl with a delay, there is no problem.
So I think it has to do something with odometry missing when amcl is setting the intial pose.
And therefore the odom covariance not being set and so the filter is not correct, ... something like that
I am setting these parameters:
Is setting initial pose via parameters supported or is this something from ROS1 times?
Bug report
Required Info:
Steps to reproduce issue
Set intial pose parameters and start amcl without odometry and pass it a laser scan.
Expected behavior
AMCL waits till all data is correctly set and then starts up
Actual behavior
AMCL covariance or pose is NaN, likely due to an invalid configuration or faulty sensor measurements! Pose is not available!
The text was updated successfully, but these errors were encountered: