-
Notifications
You must be signed in to change notification settings - Fork 65
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
Use ROS 2 clock for sensor triggering #807
base: development
Are you sure you want to change the base?
Use ROS 2 clock for sensor triggering #807
Conversation
…o FPS calculation Signed-off-by: Michał Pełka <[email protected]>
Signed-off-by: Michał Pełka <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code works correctly for me, only minor comments/nitpicks, mostly about the naming. I would strongly suggest keeping it more consistent. I found the following in your codebase:
SimulationTime
SimTimestamp
SimTime
SimulationLoopTime
|
||
AZStd::deque<float> m_simulationLoopTimes; | ||
builtin_interfaces::msg::Time m_lastSimulationTime; | ||
float m_currentMedian = 1.f/60.0f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float m_currentMedian = 1.f/60.0f; | |
float m_currentMedian = 1.0f / 60.0f; |
Btw. I would also rename the variable (ROS2SystemComponent->currentMedian?), maybe m_simTimeMedian
?
|
||
#include <ROS2/ROS2Bus.h> | ||
#include <ROS2/Utilities/ROS2Conversions.h> | ||
#include <AzCore/std/numeric.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this header needed?
Co-authored-by: Jan Hanca <[email protected]> Signed-off-by: Michał Pełka <[email protected]>
What does this PR do?
This PR fixes two minor things in sensors triggering:
How was this PR tested?
It was cherry picked against stable and tested in response to #804.
I've used test branch that logs sensor triggers (https://github.com/RobotecAI/o3de-extras/tree/mp/trigger_noted)
And script to visualize : https://gist.github.com/michalpelka/3f2c66f16d20ba714c6389d5cd173032
Without filter:
With filtering
You can see that triggers fro camera (green dots) are spaced evenly for code using median filter.
Note this is minor issue, since it can cause:
\clock
topic so inconsistency in wall time is not that big deal.