-
Notifications
You must be signed in to change notification settings - Fork 128
New Robot: Ouster OS 1 Setup PTP
The Ouster OS-1 timestamp does not follow Unix time, and as a result the matching messages with other sensors in ROS is difficult. We use PTP synchronization to synchronize the OS-1 Clock using the Robot NUC computer.
This page details:
- Set up a static IP for the OS-1 (preferable over the default DHCP).
- Set up the network connection between the NUC and the OS-1.
- Set up PTP to synchronize OS-1 clock with NUC clock.
- Change the lidar mode (2048x10).
Follow the instructions described in Issue: Setting static IP address #114:
Connect to the OS-1 using DHCP and get the [DHCP_IP_ADDRESS].
Choose the OS-1 Static IPv4 Address to set [STATIC_IP_ADDRESS], typically something like 192.168.100.12.
Set the Static IP:
echo '"[STATIC_IP_ADDRESS]/24"' | http -v PUT http://[DHCP_IP_ADDRESS]/api/v1/system/network/ipv4/override
This step is analogous to the Setup connections 1 and 3 in the New Robot: PicoStation page.
The Ouster IPv4 address is the static IP specified in the above section Set up Static IP. Notice the OS-1 is usually on a different subnet than the Picostation.
The high level steps are:
- Tell ethernet card to be a PTP grandmaster by giving it a high priority (clockClass, lower numbers are higher priority)
- Tell OS-1 to use the PTP time for it's timestamping and save this config to EEPROM
- Start a daemon (phc2sys) to synchronize linux system time with the clock on the ethernet interface with an offset of 0.
- Configure the daemons to start on boot
Install the following on the Robot NUC:
sudo apt install linuxptp ethtool
(Optional) If the OS-1 is on a network interface other than eth0. Note that the l in ptp4l.conf is an "el", not a "one":
-
sudo vim /etc/linuxptp/ptp4l.conf -
Append to the end (brackets included), replacing interface with eth0, eth1, etc.
[interface]In this example, interface was eno1:

Create an /etc/systemd/system/ptp4l.service.d/override.conf:
sudo mkdir -p /etc/systemd/system/ptp4l.service.d
sudo vim /etc/systemd/system/ptp4l.service.d/override.conf
Paste the following:
[Service]
ExecStart=
ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf
Create an /etc/systemd/system/phc2sys.service.d/override.conf
sudo mkdir -p /etc/systemd/system/phc2sys.service.d
sudo vim /etc/systemd/system/phc2sys.service.d/override.conf
Paste the following, replace eth0 with the relevant interface name:
[Service]
ExecStart=
ExecStart=/usr/sbin/phc2sys -s CLOCK_REALTIME -c eth0 -O 0
Change the clockClass to 128:
sudo vim /etc/linuxptp/ptp4l.conf

Open Netcat, which opens a sort of terminal window, changing 192.168.100.12 to the static IPv4 you set for the OS-1:
netcat 192.168.100.12 7501
Inside Netcat, run:
set_config_param timestamp_mode TIME_FROM_PTP_1588
reinitialize
write_config_txt
On NUC (DON'T DO THIS ON XAVIER!)
sudo systemctl enable phc2sys
Then reboot and power cycle the Ouster.
Check the linux time on the NUC
date +%s
Check the OS-1 time using netcat:
netcat 192.168.100.12 7501
get_time_info
The two times should match. If the PTP synchronization does not work, then get_time_info would return the number of seconds since the OS-1 was turned on.
netcat 192.168.100.12 7501
get_config_param active lidar_mode
set_config_param lidar_mode 2048x10
write_config_txt
reinitialize

The new lidar mode should be reflected in the Ouster webpage:

- Build and Install:
- Simulation Experiments:
- Real-world Experiments:
- Hardware requirements
- Install real robot code stack
- Safety protocol & preflight check
- Launch experiment and gain tuning
- Supported features:
- Integrate (semantic) SLAM for drift correction
- LIDAR-only autonomous flight
- Full coverage experiments
- Customize configurations: