-
Notifications
You must be signed in to change notification settings - Fork 980
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
Publishing transforms both directions is incorrect #1278
Comments
We brought this up here before: #1252 (comment) @TSC21 FYI |
@tfoote you were right with your you comment on issue #388 . The tf loop in mavros seems to be responsible for getting always the tf at ros::Time::now(). I put a tf listener in the avoidance code which retrieved the transforms at the timestamp of the last pointcloud and at ros::Time::now() and printed both transforms. As the drone was moving I would expect the transforms to be slightly different. Using Mavros 0.29.2. both transforms were always identical even thought the timestamps were not. Using Mavros PR #1252 the transforms were different. |
OK, I suspect why the See ros/ros_comm#146 and https://answers.ros.org/question/261815/how-can-i-access-all-static-tf2-transforms/. The workaround for this is to construct a vector of all the transforms and publish them in one shot (pass to specialized TF2 function http://docs.ros.org/melodic/api/tf2_ros/html/c++/classtf2__ros_1_1StaticTransformBroadcaster.html#a83d0664cb0cc85688b60a2236e9d81ff) |
Fixed #1300. |
The comment that you need to publish the transform the other way is incorrect.
mavros/mavros/src/lib/uas_data.cpp
Line 57 in bdc5c73
Only one of these should be used:
mavros/mavros/src/lib/uas_data.cpp
Lines 56 to 58 in 366a9a7
They will fight with each other and cause continuous reparenting such that at any given time the last one recieved will win. Likely the first version tested caused a disconnected tree by inadvertent reparenting and adding the second call masked it out.
And while I'm looking at this code. It's cleaner and more efficient to publish a vector of static transforms to take advantage of latching rather than publishing a sequence of individual transforms.
The text was updated successfully, but these errors were encountered: