Sylphase SDGPS
The software-defined GPS(/GNSS) toolkit
Tutorial: making a simple trajectory generator

SDGPS's motion control support (new in v0.35.0) allows the user to provide their own trajectory generator to simulate RF signals for a trajectory provided in realtime; this feature enables hardware-in-the-loop simulations that e.g. validate a GNSS receiver and closed-loop actuator feedback .

The latest release contains a demo script named run_sdgps_motion_control_trajectory_generator_example.sh that is intended to demonstrate the interface for running a simulation with an external trajectory generator.

Note: When running the trajectory generator program used for a motion control simulation on a machine other than the simulator host, the other machine's system time (CLOCK_REALTIME) must be synchronized to the simulator host's system time to within ±1 ms, as the TX_STREAM_TIME-CLOCK_REALTIME offset is specified relative to it.

The run_sdgps_motion_control_trajectory_generator_example.sh demo script starts up two processes:

sdgps \
connect-solution-tcp localhost 8030 \
! extrapolate-realtime-trajectory \
! simulate-raw --start-stream-time 0 \
sylphase-simulator:--antennas=ANT0 \
! sylphase-simulator --antenna-id-channel-map ANT0:A \
--publish-tx-time-on-port 8031

The above pipeline will consume solution packets from the trajectory generator over TCP and output the TX_STREAM_TIME-CLOCK_REALTIME offsets via TCP. In addition, the GNSS RF signal is emitted from the RF_out.A port.

The above pipeline uses the extrapolate-realtime-trajectory node to compensate for the latency of downstream nodes, allowing for continuous real-time operation of the simulator despite the trajectory input potentially directly corresponding to the emitted signal (or lagging it by some small period, up to 1 second). If the input trajectory is late by more than 1 second (the default value of extrapolate-realtime-trajectory --maximum-extrapolation), then the extrapolate-realtime-trajectory node will emit continuous warning messages that would look like this:

extrapolate-realtime-trajectory: Warning: [t=2.000s] [gnss_time=1298764811.870] Maximum extrapolation was exceeded (dt_extrap=1.010 > maximum_extrapolation=1.000).
extrapolate-realtime-trajectory: Warning: [t=2.010s] [gnss_time=1298764811.880] Maximum extrapolation was exceeded (dt_extrap=1.010 > maximum_extrapolation=1.000).
extrapolate-realtime-trajectory: Warning: [t=2.020s] [gnss_time=1298764811.890] Maximum extrapolation was exceeded (dt_extrap=1.020 > maximum_extrapolation=1.000).