-
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
[Collision Monitor] Performance issue #3402
Comments
Please provide some reference to your claim that
I know this isn't precisely what you said, but are you sure that the issue here isn't that your static transforms from base_frame -> sensor_frame isn't actually throttling the system to 30 hz? I would agree publishing your global localization system (e.g. map->odom) faster isn't a good solution to a collision monitor specific problem -- but if that's actually what's happening, that means you have that same delay setup for anything transforming frames (e.g. your entire perception pipeline, getting robot poses, etc) that is not unique to just the collision monitor. As such, its really a system decision if you should increase this publication rate, and I'd argue, yes, you should, iregardless of the Collision Monitor due to the impact you describe where we actually require that global localization transformation in updating the costmaps or sensor processing. But like I said, I'm not totally convinced (from my first comment above) that we are doing as you describe in the collision monitor -- so please provide some context (e.g. lines of code + proof that its doing something in map/odom frame) that @AlexeyMerzlyakov and I can start to use to analyze the situation. We definitely should not be doing what you describe, if we are indeed doing it! |
Thank you for the reply!
I'm pointing to This implimentation The way I understand is that it was made like this in order to publish relevant information about the obstacle:
As a workaround in our fork we omited I'm not 100% sure that this is exaclty what happens, but since omiting fixed_frame when calling lookup_transform reduced the latency dramatically I'd blame getting the |
I see! So its our use of TF. @AlexeyMerzlyakov this seems like a bug for you to handle being primarily your development package. I'm assigning you the ticket. I see what the intent is with that API use - to get the data from time @HovorunB if you check for the time difference between
That's a bad call. I can go into more detail, but the error message you sent is what I would have predicted.
Oh, that's not the global localizer. Your odometry only publishes at 30 hz?! Yeah, that's way too slow, regardless of Collision Monitor. That should be closer to 100hz, at least, for reasonable state estimation via RL, Fuse, etc. That's definitely a contribution to this problem you should resolve. Again, that will impact your entire perception pipeline. |
Thank you for bringing this to our attention and explaining the situation to me in more detail |
Yes, the situation is known since CM development times. This
Typical rates for PCL or laser scan (e.g. TurtleBot3) are ~5Hz, which is
During the checking of the problem, I've already made these measurements on TB3 Gazebo simulation, so may I also answer this question? I've got even distribution of diffefence times over The results are as expected: while new sensor data is not received, the time shift linearly increased. After it, we are addressing updated data and time diff resets to The average time for lookupTransform(time considered) API was compared to simple use-case of lookupTransform(time ignored), and got the following results:
So, the way to use simple
Any other ideas? |
Most laser provide data at 10-20-40hz or higher, the TB3 is not a representative example. I can understand the issue if we use stale data - even though we process the collision monitor at the controller frequency (20+ hz). Are those increased delays on the table's left column due to the TF tree having the transform available to the global frame as @HovorunB points out? I'm surprised to see that be the case, if our TB3 model publishes its odometry transform at a usual rate of ~100hz. But, woof, it looks like its 30hz 🤦. If we update that to be more appropriate, does that lower our issue? A parameterization seems reasonable. Though, I think its worth documenting this phenomenon explicitly to help people understand. I do think that having reasonable odometry rates is the "real" solution, its worth supporting less well configured or hobbyist platforms where we can |
Yes,
Yes. The The slope is near
Well, I am ready to prepare the patch with new parameter for Collision Monitor and documentation update as well. |
Thanks for the comments about odom frequency! We are going to investigate and try publishing it faster 🚀
I'm getting up to 200ms, but our robot moves with the speed at most 0.7 m/s, so we can expect an error up to 14cm which for our case of using the FootprintApproach model is totally fine. So new parameter whether to use advanced or simple lookup transform API sounds great! Looking forward. |
Sounds like a solution! |
Terminally to be merged, thanks for bringing up the issue @HovorunB ! |
Hello! Recently when using the collision monitor I discovered that it adds too much latency to the cmd_vel path. The problem to that was waiting for the transform from data source frame to base frame on every callback. I saw that you are using an Advanced API of lookup_transform which relies not only on getting the transform data_source_frame->base_frame but also at fixed_frame->base_frame. This in our case adds latency (we publish fixed_frame->base_frame at 30Hz which adds at most ~33ms to the latency) Publishing fixed_frame->base_frame faster will reduce the latency but i feel like this is more of a workaround rather than a solution.
I wanted to ask whether this is expected and collision monitor could provide such default latency. Maybe you have some thoughts on how to make it run faster?
The text was updated successfully, but these errors were encountered: