Project

General

Profile

gps component

Ports

state (out)

Data structure
  • struct ::or_pose_estimator::state state

    • struct ::or::time::ts ts

      • long sec

      • long nsec

    • boolean intrinsic

    • optional< struct ::or::t3d::pos > pos

      • double x

      • double y

      • double z

    • optional< struct ::or::t3d::att > att

      • double qw

      • double qx

      • double qy

      • double qz

    • optional< struct ::or::t3d::vel > vel

      • double vx

      • double vy

      • double vz

    • optional< struct ::or::t3d::avel > avel

      • double wx

      • double wy

      • double wz

    • optional< struct ::or::t3d::acc > acc

      • double ax

      • double ay

      • double az

    • optional< struct ::or::t3d::aacc > aacc

      • double awx

      • double awy

      • double awz

    • optional< struct ::or::t3d::pos_cov > pos_cov

      • double cov[6]

    • optional< struct ::or::t3d::att_cov > att_cov

      • double cov[10]

    • optional< struct ::or::t3d::att_pos_cov > att_pos_cov

      • double cov[12]

    • optional< struct ::or::t3d::vel_cov > vel_cov

      • double cov[6]

    • optional< struct ::or::t3d::avel_cov > avel_cov

      • double cov[6]

    • optional< struct ::or::t3d::acc_cov > acc_cov

      • double cov[6]

    • optional< struct ::or::t3d::aacc_cov > aacc_cov

      • double cov[6]


info (out)

Data structure
  • struct ::gps::solution_s info

    • struct ::or::time::ts ts

      • long sec

      • long nsec

    • struct ::or::time::ts utc

      • long sec

      • long nsec

    • enum ::gps::fix_s fix ∈ { fix_none, fix_interp, fix_single, fix_diff, fix_rtk_float, fix_rtk, fix_fixed }

    • struct ::gps::llh_s llh

      • double latitude

      • double longitude

      • double height

    • struct ::gps::enu_s pos

      • double east

      • double north

      • double up

    • struct ::gps::enu_s pos_sigma

      • double east

      • double north

      • double up

    • struct ::gps::enu_s vel

      • double east

      • double north

      • double up

    • struct ::gps::enu_s vel_sigma

      • double east

      • double north

      • double up

    • unsigned short sats

    • unsigned short totalsats

    • sequence< struct ::gps::satlist_s, 8 > satlist

      • string<8> system

      • sequence< unsigned short, 64 > used

      • sequence< unsigned short, 64 > unused


Services

get_param (attribute)

Outputs
  • struct ::gps::param_s param

    • string<32> model

    • double rate

    • double ecutoff

    • struct ::gps::noise_s noise

      • double posxy_sigma

      • double posz_sigma

      • double velxy_sigma

      • double velz_sigma

    • enum ::gps::clocksrc tsmode ∈ { clock_local_coarse, clock_local_ntp, clock_utc_offset, clock_utc }

    • enum ::gps::frame_s frame ∈ { frame_enu, frame_nwu, frame_ned }


get_last_fix (attribute)

Outputs
  • struct ::gps::ids::fix_s fix

    • double remain

    • unsigned long samples

    • struct ::gps::llh_s llh

      • double latitude

      • double longitude

      • double height

    • struct ::gps::enu_s pos

      • double east

      • double north

      • double up

    • struct ::gps::enu_s sigma

      • double east

      • double north

      • double up


rtk_stats (attribute)

Outputs
  • struct ::gps::rtcm_stats_s rtk_stats

    • sequence< struct ::gps::rtcm_sentid > sent

      • unsigned short rtcmid

      • double period

      • double offset

      • unsigned long out

    • sequence< struct ::gps::rtcm_recvid > recv

      • unsigned short rtcmid

      • unsigned long in

    • sequence< struct ::gps::rtcm_recvid > ignored

      • unsigned short rtcmid

      • unsigned long in

    • unsigned long inbytes

    • unsigned long inpkts

    • unsigned long outbytes

    • unsigned long outpkts

    • unsigned long dropbytes

    • unsigned long droppkts

Log RTK configuration and statistics.

The statistics can be reset with reset_rtk_stats (function).


set_noise (attribute)

Inputs
  • struct ::gps::noise_s noise

    • double posxy_sigma (default "0") X,Y position minimum standard deviation (m)

    • double posz_sigma (default "0") Z position minimum standard deviation (m)

    • double velxy_sigma (default "0") X,Y velocity minimum standard deviation (m/s)

    • double velz_sigma (default "0") Z velocity minimum standard deviation (m/s)

Set minimum noise on position and velocity


set_timestamp_mode (attribute)

Inputs
  • enum ::gps::clocksrc tsmode (default "::gps::clock_utc") Timestamp mode ∈ { clock_local_coarse, clock_local_ntp, clock_utc_offset, clock_utc }

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Configure how solution is timestamped.

The following modes are available:

clock_utc

This is the most accurate mode. The solution is published with the GPS UTC timestamp as computed by the device. Note that this requires that the local clock is perfectly synchronized with UTC time in order to compare this timestamp with timestamps from other components that use the local clock.

clock_utc_offset

This is the same as clock_utc except that a fixed offset is substracted from the UTC timestamp. The offset can be set with set_local_utc (attribute).

clock_local_ntp

This is slightly less accurate than clock_utc. The solution is published with a timestamp relative to the local clock by estimating the current clock offset from UTC via NTP. This requires configuring a NTP server with ntp_peer (activity). Provided a good NTP server is set, offset will typically be less than a few milliseconds (this can be checked with ntp_info (activity)). This mode is useful when timestamps from other components must be compared with GPS timestamps.

clock_local_coarse

This is not accurate and should be used only if the other modes cannot be used. The published timestamp is the reception time of the solution, according to the local clock. This will typically be offset by several tens of milliseconds as neither the solution computation time nor the transmission time are accounted for.


set_local_utc (attribute)

Inputs
  • double offset (default "0") UTC offset

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Configure local clock offset with respect to UTC time.

This is used only in timestamp mode clock_utc_offset (see set_timestamp_mode (attribute)). offset is such that local clock + offset = UTC time.


set_frame (attribute)

Inputs
  • enum ::gps::frame_s frame (default "::gps::frame_nwu") Cartesian frame selection ∈ { frame_enu, frame_nwu, frame_ned }

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Configure the cartesian frame for the published solution.

This setting influences the mapping of the X, Y and Z of the local cartesian frame. The default is frame_nwu.

frame_enu

East, North, Up mapped to X, Y, Z.

frame_nwu

North, West, Up mapped to X, Y, Z.

frame_ned

North, East, Down mapped to X, Y, Z.


connect (activity)

Inputs
  • string<128> serial (default "/dev/ttyUSB0") Serial device

  • unsigned long baud (default "115200") Baud rate

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

  • exception ::gps::e_baddev

    • string<256> dev

Context
  • In task io

Connect to the hardware.

Note Check set_timestamp_mode (attribute) for configuring the solution timestamping mode.

disconnect (activity)

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Context
  • In task io

Disconnect from the hardware


set_rtk_port (activity)

Inputs
  • unsigned short port (default "8083") RTK server UDP port

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Context
  • In task io

Configure the UDP port for RTK correction streaming.

RTK data (see send_rtcm (activity)) is streamed from this source UDP port. Requests for RTK data from remote components (see connect_rtk (activity)) should thus be made to this port number.


connect_rtk (activity)

Inputs
  • string<64> host (default "gps-base") RTK server hostname

  • unsigned short port (default "8083") RTK server UDP port

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

Context
  • In task io

Receive RTK data from a remote gps-genom3 component.

In mobile station mode, the component can be configured to accept RTK data from a remote gps-genom3 component configured in base station mode.

This service asks the remote host identified by its name or IP number (in number-and-dots notation) and the port number (see set_rtk_port (activity)) to start streaming any available RTK data to this component.

Note If RTK data is received from an unknown host that was not explicitly connected with this service, the component will print a diagnostic message on stderr and ignore the data.

set_reference (function)

Inputs
  • struct ::gps::llh_s reference

    • double latitude (default "43.5622") geodetic latitude (deg)

    • double longitude (default "1.4773") longitude (deg)

    • double height (default "206.233") height above WGS84 ellipsoid (m)

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Set the ENU reference position.

The position published in the state (out) port is computed as ENU (east, north, up) coordinates relative to the given global reference in LLH coordinates (latitude, longitude, height above ellipsoid).


get_reference (attribute)

Outputs
  • struct ::gps::llh_s ref

    • double latitude

    • double longitude

    • double height

Get the ENU reference position.


set_rate (activity)

Inputs
  • double hz

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

Context
  • In task io

Set solution computation rate.

Configure the hardware to compute solutions at the hz frequency (in Hz). get_param (attribute) returns the actual frequency.


set_ecutoff (activity)

Inputs
  • double ecutoff (default "10") Minimum elevation (deg)

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

Context
  • In task io

Set satellites minimum elelevation.

Configure the hardware to use only satellites above this horizon (in deg). get_param (attribute) returns the current setting.


unfix (activity)

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

Context

Unset FIX mode.

This service makes the component stop acting as a fixed base station and puts it back in mobile receiver mode. See fix (activity) and fix_here (activity).


fix (activity)

Inputs
  • struct ::gps::llh_s llh

    • double latitude geodetic latitude (deg)

    • double longitude longitude (deg)

    • double height height above WGS84 ellipsoid (m)

  • struct ::gps::enu_s sigma

    • double east Local standard deviation on the longitude (m)

    • double north Local standard deviation on the latitude (m)

    • double up Standard deviation on the height (m)

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

  • exception ::gps::e_nofix

Context

Set FIX mode at given position.

After invoking this service, the component is configured in fixed base station mode. In particular, it will start providing RTCM corrections to clients requesting it (see send_rtcm (activity)).

Depending on the underlying hardware, the given llh position must be accurate enough so that the receiver can actually switch to base station mode. The required accurarcy must typically be better than 10 meters. The precision given in sigma should reflect the estimated precision of the llh position, although this precision is not used by the hardware.

The fix member of the info (out) port will switch to fix_fixed mode when the connected hardware will actually have successfully switched to the base station mode.


fix_here (activity)

Inputs
  • double avg_time (default "600") Position average duration (s)

  • double precision (default "1") Desired 3.sigma precision (m)

Outputs
  • struct ::gps::llh_s llh

    • double latitude

    • double longitude

    • double height

  • struct ::gps::enu_s pos

    • double east

    • double north

    • double up

  • struct ::gps::enu_s sigma

    • double east

    • double north

    • double up

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

  • exception ::gps::e_nofix

Context

Average current position and set FIX mode.

This service is similar to fix (activity), but uses the current receiver position as the desired fixed position. The current position is first averaged for at most avg_time number of seconds or until the averaged position precision becomes better than the requested precision. Then, the fix (activity) service is invoked with the averaged result. The receiver should not be moved during the averaging period.

When successful, the service returns the averaged position in llh and enu and the obtained precision in sigma. This can be later reused as a parameter of the fix (activity) service to save the averaging time and quickly switch to the base sation mode when the receiver position is already known.

The averaging time should be long enough so that a sufficient precision is obtained on the position. If the desired precision cannot be achieved after the requested avg_time, the service will stop and raise an error. Depending on the setup quality, the required time can be as much as several dozens of minutes.


send_rtcm (activity)

Inputs
  • unsigned short rtcmid (default "1") RTCM message id

  • double period (default "1") Period (s)

  • double offset (default "0") Offset (s)

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

Context
  • In task io

Send new RTCM corrections.

The RTCM message identified by rtcmid is streamed on the UDP port set in set_rtk_port (activity) (by default 8083) at the frequency corresponding to period.

The messages are sent at UTC timestamps multiple of period, plus an offset. For instance, to stream data at 1 second afer every minute, set the period to 60 and offset to 1.

Not all periods and messages are supported by all devices. In case of an unsupported setting, the e_sys/EINVAL exception will be raised.

Note RTCM messages will only be streamed when the device is configured in base station mode. This requires fixed position to be set with fix (activity) or fix_here (activity).

cancel_rtcm (activity)

Inputs
  • unsigned short rtcmid (default "1") RTCM message id

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

  • exception ::gps::e_nodev

Context
  • In task io

Stop sending and ignore certain RTCM messages.

In base station mode, the RTCM message identified by rtcmid are not streamed anymore. See send_rtcm (activity).

In mobile station mode, any incoming RTCM message with this rtcmid will be silently ignored. This is useful to precisely configure what the hardware device will see, especially to filter out messages supported by the hardware but that are not wanted in a specific configuration. It is also useful to suppress diagnostic messages about incoming messages that are not supported by the hardware.


enable_rtcm (function)

Inputs
  • unsigned short rtcmid (default "1") RTCM message id

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Accept certain RTCM messages.

In mobile station mode, accept incoming RTCM message with this rtcmid. This is ony useful if a message has been previously cancelled. See cancel_rtcm (activity).


ntp_stop (activity)

Context

Stop NTP service.

This resets all NTP communication and disables automatic UTC offset computation. If in clock_local_ntp timestamp mode (see set_timestamp_mode (attribute)), published positions will have a 0 timestamp.


ntp_peer (activity)

Inputs
  • string<128> host

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Context

Start NTP service.

This adds one NTP peer and starts automatic UTC offset computation. This is required for clock_local_ntp timestamp mode (see set_timestamp_mode (attribute)) to work.

Additional NTP peers can be added by invoking this service multiple time.


ntp_info (activity)

Outputs
  • struct ::gps::ntp_offset_s offset

    • double offset

    • double jitter

  • string stats

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Context

Retrieve NTP synchornization information.

The returned offset is the current estimation of the local clock offset with respect to UTC time. It is such that local clock + offset = UTC time

jitter is an estimate of the precision and stats is a messge showing the status of all NTP peers.


monitor_fix (activity)

Inputs
  • enum ::gps::monitor_op_s trigger (default "::gps::monitor_above") Type of event expected ∈ { monitor_above, monitor_below }

  • enum ::gps::fix_s target (default "::gps::fix_rtk_float") Fix quality threshold ∈ { fix_none, fix_interp, fix_single, fix_diff, fix_rtk_float, fix_rtk, fix_fixed }

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Context
  • In task io

Monitor fix quality changes.

This service waits until the fix quality is at least target (for trigger equal to monitor_above) or worse than target (for trigger equal to monitor_below).


reset_rtk_stats (function)

Zero out rtk_stats (attribute) counters.


log (function)

Inputs
  • string<64> path (default "/tmp/gps.log") Log file name

  • unsigned long decimation (default "1") Reduced logging frequency

Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what

Log solution


log_stop (function)

Stop logging


log_info (function)

Outputs
  • unsigned long miss Missed log entries

  • unsigned long total Total log entries

Show missed log entries


Tasks

io

Context
Throws
  • exception ::gps::e_sys

    • short code

    • string<128> what


ntp

Context
  • Free running