Skip to content
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

PX4Flow message stamps according to ROS clock #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

angelsantamaria
Copy link

Hi,

With your current PX4flow driver version the ROS messages come with the sensor clock as stamp (more stable and regular than ROS clock).
This means that they cannot be used directly in other nodes that require a stamp check.
Basically the sensor clock starts when the hardware is powered, thus provoking a big time stamp jump between actual ROS clock and the stamp appended to the messages.

A usual solution here could be to add a ROS::Time::now() in the message stamps before publishing them (considering the high frame rate), however in this particular case the publisher objects are inside a for loop that depends on the serial reading.
Through the serial can come several packages of the same type, flow for instance, thus all published message would have the same time stamp using ROS::Time::now().

Instead, the patch gets the sensor clock when is stable (after first serial reading) and synchronizes the message stamps considering the ROS clock when this is stable (after a second or so).

By the way, I added also the time stamp to the image messages in case they are published.

I believe this is useful for a general purpose.

If you feel the pull request cannot be accepted, I will keep the fork.

Thank you for your time.

All the best,

Angel.

…conds the ROS message stamps are adapted to sensor clock (more regular at node initialization). Here ros::Time::now() cannot be used because several serial packages are retrieved at the same time (inside a for loop) but are required to have different sensor times. Now the ROS messages come with a correct ROS clock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant