Skip to content

Stereo IMU OVC3

Fernando Cladera edited this page Aug 15, 2022 · 7 revisions

Sensor connection overview

The sensor acts as a network interface in the host computer. Upon connection, the OVC will create a new network interface and provide an IP to the host computer in the network 10.0.1.0/24 (for instance 10.0.1.2). Afterwards, the node will start streaming ROS topics to the main computer.

NTP Setup

The OVC3 expects an NTP server on the host side to synchronize its clock with the host. Thus, NTP should be set up in the Jetson/NUC. We will use chrony as our NTP server.

  1. Install chrony apt install chrony.
  2. Edit the chrony to allow connections from the OVC. Add at the end of /etc/chrony/chrony.conf:
    allow 10.0.1.1
    local stratum 8
    
    The local stratum 8 is needed so the OVC accepts the time synchronization even if the NUC is not connected to the internet.
  3. Start the service systemctl start chrony and enable it to start automatically at boot systemctl enable chrony

PTP Setup

If required, one may configure the OVC to use PTP clock for better synchronization with the host computer. For instance, one may timestamp gpio signals using the OVC. To do this, we should configure the PTP master, and configure the OVC as slave.

Master Configuration

Follow the steps described in Master - Setup Steps. Important note: when configuring phc2sys, beware of the -c 0 flag. You can replace it with the -w flag to consider leap seconds.

Slave configuration

Install the following packages in the OVC

sudo apt install linuxptp ethtool

Modify /etc/linuxptp/ptp4l.conf to force a slave:

slaveOnly               1

and add the OVC ethernet interface at the end:

[eth0]

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.con

Paste the following

[Service]
ExecStart=
ExecStart=/usr/sbin/phc2sys -s eth0 -w

Start ptp4l and check the accuracy. The master offset should be a small number of ns.

systemctl start ptp4l
sleep 5
journalctl -u ptp4l -e | tail -n 1

Start phc2sys and check the accuracy:

systemctl start phc2sys
sleep 5
journalctl -u phc2sys -e | tail -n 1

Time sync check

Use a command like watch -n .1 "date +'%s %N'" in both the master and slave to verify that the clocks are synced. If your offset is ~30 seconds, you may have an issue with your leap seconds. See the phc2sys configuration for this.

Clone this wiki locally