-
Notifications
You must be signed in to change notification settings - Fork 986
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
Timeout quicker for vision_position plugin #60
Comments
Don't know how do this now. And now i'am busy with asio cleanup. |
I'm going to do some research into if there is a check to see whether a new TF is available (I thought .waitForTransform() did this, and then only do .lookUpTransform(). If there is no way to do this then might have to add callback for /ar_pose_marker topic and then do .lookUpTransform() here. This will solve a couple of issues; sync the vision estimate message to PX4 with the estimate from ROS package (ar_track_alvar in my case), also it will stop sending estimates to PX4 as soon as the vision estimate stops. Then we get faster timeout response in PX4. This situation is only relevant to tf_listener function. |
@ggregory8 specifying code to ar_track_alvar in the plugin will remove it's general purpose. Finding a solution to the TF always sending a transform will be the best thing to do. The thing I came up with will be possibly reduce the lookup waiting time. |
Another thing we can do is creating a transform_old which takes the previous values of the transform, a transform_now, which takes the values of ros::Time(0) transform. Then we compare both by it's position and orientation and only send the vision_estimate if they are different. Note: a comparison between a tf that, for example, was listen a second ago, can be done by also considering the time stamp instead of a just the last tf. Say for example we create a auxiliar tf each second and compare them. (As a MAV is a dynamic vehicle (not stable at all), a tf comparison between the last tf and the actual one will always be different , which in this case benefit us since the tf won't always be sent and, in that case, we clean up the always sending part). |
I do like this last idea. Whilst still slightly hacky it will do what we want until we find another fix! I'll test it locally and let you know how it goes. Probably tomorrow job now.
|
I can also take a look at this ;) I think the priority should be on the PX4 side. What's left to be arranged so your PR can be accepted? |
We're just just discussing some items about fusing the multiple position estimates into the INAV filter. There really isn't any change between the existing branch and the PR though so it shouldn't told you back. Hopefully we can get it sorted soon.
|
If implemented your suggestion @TSC21 and its working great! The vision estimate will only be sent if the transform timestamp is new. This give a much fast timeout in PX4. `
` |
Add 4 spaces (or 1 tab) for code blocks. |
@ggregory8 Just added a patch. |
You can close this @vooon. I confirmed it's working! |
i think there's a bug here |
@MaMadDl if you read the comments on this issue carefully, you will see this is not a bug - it was inserted there for a purpose. |
Update your message timestamp instead of removing those lines (Check and update the msg |
@vooon
I think we need to find a way to stop sending the vision estimate if the tf is not updated (when using tf_listener). For example there is about an 8s delay from when I stop the vision estimate (ar_track_alvar) and when the vision_position plugin stops sending the vision_estimate to PX4.
Any ideas on this? Is there a way to check if a transform is older than a time, say 1s? Or alternatively we could also check the pose topic (/ar_pose_marker in the case of ar_track_alvar package) and only do the tf lookup if we get a valid estimate on this topic?
The text was updated successfully, but these errors were encountered: