Skip to content

Pinout and Design reference

Jonathan Hudson edited this page May 3, 2025 · 6 revisions

inav-follow more information

Pinout

This is the pinout used for the prototype.

pinout

How you power the device(s) is up to you. A 4.2v Li-ion would do fine.

High Level design

The following describes the high-level design of the inav-follow application.

In order to simplify the event handling, there are go routines that:

  • Read the GPS
  • Read the MSP device
  • Manage the CLI

These use a go channel to publish events back to the main thread:

  • GPS update (fused GGA / RMC sentence)
  • MSP response
  • CLI commands

Asynchronous event handling is serialised by the main thread, which also adds a ticker (time event at 100ms interval) to the select loop. The timed event is used to detect message timeouts and schedule the polled reading of FC navigation data.

In order for anything useful to happen, a valid local GPS fix is required. When a valid GPS fix is established, the following initially happens:

  • Communication is established to the FC. This uses the following MSP stanzas:
    • MSP_FC_VARIANT : Must return INAV
    • MSP_FC_VERSION : For information only
    • MSP_NAME : For information (currently unused)
    • MSP2_INAV_MIXER : Validate platform type, must not be DONT_FOLLOW_TYPE

If the above sequence completes, then a 100ms repeating sequence is initiated:

  • MSP_NAV_STATUS : Get the navigation state, must be MW_GPS_MODE_HOLD, aka POSHOLD for "follow me" to be enabled.
  • MSP_RAW_GPS : Get the vehicle location and status. This is used to display vehicle range and bearing.

If the navigation state is MW_GPS_MODE_HOLD (aka POSHOLD), then after a valid local GPS location event is received (only), a MSP_SET_WP stanza is transmitted to the FC with the following paramters:

  • WP Type : WAYPOINT
  • WP Number : 255 (the "desired location" WP number, note that if you wanted instead to reset the home position, use WP 0)
  • Latitude, Longitude : The location reported by ground GPS
  • Altitude : 0, meaning maintain vehicle altitude (inter alia, there is no way for this simple device to easily ascertain a "desired altitude").
  • Parameter 1 : The bearing from the vehicle to the "follow me" device. This means the (MR) vehicle will proceed "nose first" to the "follow me" location.

If the vehicle has the flight mode modifier GCS NAV asserted, then it will execute the desired action ("follow me", and if the RESET_HOME is true, then resets the vehicle's home location). If GCS NAV is not asserted, then the MSP_SET_WP message(s) are ignored by the vehicle.

Clone this wiki locally