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

plugin: add synchronisation to most plugins #186

Closed
wants to merge 2 commits into from
Closed

plugin: add synchronisation to most plugins #186

wants to merge 2 commits into from

Conversation

mhkabir
Copy link
Member

@mhkabir mhkabir commented Jan 11, 2015

This allows timesync between a PX4 FCU and mavros to be used in most plugins : #185
This is untested, so don't merge yet.

I don't have time for this ATM, so testers welcome. @thedinuka, interested?

@thedinuka
Copy link

I'll definitely run some tests. Will get back to you after.

@mhkabir
Copy link
Member Author

mhkabir commented Jan 11, 2015

You can simply merge the branch, and add two printf/Throttled print to one
of the plugins. Print the synchronised timestamp and ros::Time::now(). As
long as they are similar, it's fine.
On Jan 11, 2015 1:16 PM, "Dinuka" notifications@github.com wrote:

I'll definitely run some tests. Will get back to you after.


Reply to this email directly or view it on GitHub
#186 (comment).

@vooon
Copy link
Member

vooon commented Jan 11, 2015

Looks good, but testing required.

@thedinuka
Copy link

Hi,
I'm trying to understand this a bit more clearly before I run tests with it. Hope you'd be able to answer a few questions.
From what I understood, time offset is the instantaneous time difference between ROS wall time and the pixhawk time. Then what the synchronise_stamp function does is to add that offset to the time stamp attached by the pixhawk to each sensor data packet. So effectively, what

header.stamp = uas->synchronise_stamp(imu_hr.time_usec);

does is to set the timestamp on the message published by ros to the ros time at which the IMU (or other sensor) was captured as opposed to ros::Time::now(). Given that there is a finite delay in transmitting the data from PixHawk to host computer, I'd assume the header.stamp to always lag ros::Time::now().

This is what confused me a bit, because you said:

Print the synchronised timestamp and ros::Time::now(). As long as they are similar, it's fine

Hope you could shed some light on this. Thanks

@mhkabir
Copy link
Member Author

mhkabir commented Jan 12, 2015

The lag would be low in any case. The current wall time would be very close to the synchronised stamp anyway. (lagging by estimator time + link latency)

As I said, they should be close to each other, not the same.

@mhkabir
Copy link
Member Author

mhkabir commented Jan 12, 2015

It's fine with me if you can find a better way to test it :)

@mhkabir
Copy link
Member Author

mhkabir commented Jan 13, 2015

@dinuka You can plot the IMU in rqt_plot and move the system around.
Visualisation should be normal if synchronisation works properly :)
On Jan 12, 2015 6:40 AM, "Dinuka" notifications@github.com wrote:

Hi,
I'm trying to understand this a bit more clearly before I run tests with
it. Hope you'd be able to answer a few questions.
From what I understood, time offset is the instantaneous time difference
between ROS wall time and the pixhawk time. Then what the
synchronise_stamp function does is to add that offset to the time stamp
attached by the pixhawk to each sensor data packet. So effectively, what

header.stamp = uas->synchronise_stamp(imu_hr.time_usec);

does is to set the timestamp on the message published by ros to the ros
time at which the IMU (or other sensor) was captured as opposed to
ros::Time::now(). Given that there is a finite delay in transmitting the
data from PixHawk to host computer, I'd assume the header.stamp to always
lag ros::Time::now().

This is what confused me a bit, because you said:

Print the synchronised timestamp and ros::Time::now(). As long as they are
similar, it's fine

Hope you could shed some light on this. Thanks


Reply to this email directly or view it on GitHub
#186 (comment).

@thedinuka
Copy link

@mhkabir I will do those testing as soon as I get some time. Bit stuck with a few other things this week

@mhkabir
Copy link
Member Author

mhkabir commented Jan 15, 2015

@tonybaltovski

@tonybaltovski
Copy link
Contributor

@mhkabir will do ASAP.

@mhkabir mhkabir closed this in 21f2324 Jan 16, 2015
vooon added a commit that referenced this pull request Jan 16, 2015
nmichael pushed a commit to rislab/mavros that referenced this pull request Mar 19, 2016
Allow compiling on Visual Studio 2012 and earlier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants