Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

added ptp sync #1

Merged
merged 1 commit into from
Sep 12, 2018
Merged

added ptp sync #1

merged 1 commit into from
Sep 12, 2018

Conversation

ZacharyTaylor
Copy link

@ZacharyTaylor ZacharyTaylor commented Sep 12, 2018

Adds in setting to use ptp timesync on startup and rejects measurements until the sync happens.

To use ptp install with
sudo apt install linuxptp

edit the parameters for starting the service
sudo vim /lib/systemd/system/ptp4l.service

all you need to set is
ExecStart=/usr/sbin/ptp4l -i <your ethernet interface>
in my case ExecStart=/usr/sbin/ptp4l -i enp0s25

then start the service
service ptp4l start

and make it run on boot
sudo systemctl enable ptp4l

Copy link
Collaborator

@helenol helenol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM great! Thanks. Just have to remember to enable this on the helis. :)

@HannesSommer
Copy link

HannesSommer commented Sep 12, 2018

Awesome! There is a LIDAR using PTP? Sounds like Christmas to me :).

A note on @ZacharyTaylor suggestion of how to edit systemd's service config:
It is inadvisable to edit /lib/systemd/system/ptp4l.service directly, simply because this is the distributor's realm and might get overwritten with the next package update. Systemd has quite a sophisticated solution to that. It uses a layered configuration system. You can inject your modified version into a layer above by placing it at /etc/systemd/system/ptp4l.service. Even better is to use the drop-in feature by placing only the changed lines plus their section header into some file in /etc/systemd/system/ptp4l.service.d/.
The systemctl tool supports you in both cases with
systemctl edit --full ptp4l (creates a complete copy and lets you edit)
systemctl edit ptp4l (creates a drop-in file and lets you edit)

In any case (including editing /lib/systemd/system/ptp4l.service) you must run
systemctl daemon-reload or reboot for the change to take effect before you start the service.

@ZacharyTaylor ZacharyTaylor merged commit 1435435 into master Sep 12, 2018
@ZacharyTaylor ZacharyTaylor deleted the feature/ptp branch September 12, 2018 12:46
@ZacharyTaylor
Copy link
Author

Thanks for the tip about how to set up the service.
And yeah the lidar supports PTP out of the box, has made doing the timesync so much easier then usual

@dsb6063
Copy link

dsb6063 commented Nov 10, 2018

Hi appreciate the ptp info. We are trying to implement the cartographer 3D SLAM with ouster....and having problems. From reviewing the boards and manuals, it appears we need to be using a master clock either implementing a software or hardware version to produce time compatible epoch ros bags. Is this approach to implement a software ptp solution the hidden solution. I thought it was an option to implement ptp, but it sounds like more of a best practice.

@ZacharyTaylor
Copy link
Author

If you are not fusing it with a second sensor I am surprised this is needed, however you can always start ptp4l using software timestamps with the -S option, which should work on pretty much any linux system.

@dsb6063
Copy link

dsb6063 commented Nov 10, 2018 via email

@eric-schleicher
Copy link

@dsb6063 Using ptp is an essential step and best practice if you have multi device or multi-host system.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants