MIP_SDK
v3.0.0-736-g212583cf
MicroStrain Communications Library for embedded systems
|
Example setup program for the 3DM-CV7-INS, and 3DM-GV7-INS using C. More...
Functions | |
static void | log_callback (void *_user, const microstrain_log_level _level, const char *_format, va_list _args) |
Custom logging callback for MIP SDK message formatting and output. More... | |
static void | capture_gyro_bias (mip_interface *_device) |
Captures and configures device gyro bias. More... | |
static void | configure_filter_message_format (mip_interface *_device) |
Configures message format for filter data streaming. More... | |
static void | configure_external_aiding_heading (mip_interface *_device) |
Configures a heading reference frame for external aiding measurements. More... | |
static void | configure_external_aiding_gnss_antenna (mip_interface *_device) |
Configures a GNSS antenna reference frame for external aiding measurements. More... | |
static void | configure_external_aiding_ned_velocity (mip_interface *_device) |
Configures a body frame velocity reference frame for external aiding measurements. More... | |
static void | initialize_filter (mip_interface *_device) |
Initializes and resets the navigation filter. More... | |
static void | display_filter_state (const mip_filter_mode _filter_state) |
Displays the current filter state when changes occur. More... | |
static mip_timestamp | get_current_timestamp () |
Gets the current system timestamp in milliseconds. More... | |
static bool | mip_interface_user_send_to_device (mip_interface *_device, const uint8_t *_data, size_t _length) |
Handles sending packets to the device. More... | |
static bool | mip_interface_user_recv_from_device (mip_interface *_device, uint8_t *_buffer, size_t _max_length, mip_timeout _wait_time, bool _from_cmd, size_t *_length_out, mip_timestamp *_timestamp_out) |
Handles receiving packets from the device. More... | |
static void | initialize_device (mip_interface *_device, serial_port *_device_port, const uint32_t _baudrate) |
Initializes and configures a MIP device interface. More... | |
static void | send_simulated_heading_data (mip_interface *_device, const mip_time *_aiding_time) |
Sends simulated external heading measurements to the device. More... | |
static void | send_simulated_position_data (mip_interface *_device, const mip_time *_aiding_time) |
Sends simulated external position measurements to the device. More... | |
static void | send_simulated_ned_velocity_data (mip_interface *_device, const mip_time *_aiding_time) |
Sends simulated external NED velocity measurements to the device. More... | |
static void | send_simulated_vehicle_frame_velocity_data (mip_interface *_device, const mip_time *_aiding_time) |
Sends simulated external vehicle frame velocity measurements to the device. More... | |
static void | terminate (serial_port *_device_port, const char *_message, const bool _successful) |
Handles graceful program termination and cleanup. More... | |
static void | exit_from_command (const mip_interface *_device, const mip_cmd_result _cmd_result, const char *_format,...) |
Handles graceful program termination and command failure cleanup. More... | |
Variables | |
static const char * | PORT_NAME = "/dev/ttyACM0" |
Set the port name for the connection (Serial/USB) More... | |
static const uint32_t | BAUDRATE = 115200 |
Set the baudrate for the connection (Serial/USB) More... | |
static const uint16_t | SAMPLE_RATE_HZ = 1 |
Streaming rate in Hz. More... | |
static const uint32_t | RUN_TIME_SECONDS = 30 |
Example run time. More... | |
static const uint64_t | TIME_OF_ARRIVAL_LATENCY_NS = 100 * 1000000 |
Time of arrival latency in nanoseconds. More... | |
static const uint8_t | HEADING_FRAME_CONFIG_ID = 1 |
Frame config ID for external heading. More... | |
static const uint8_t | GNSS_FRAME_CONFIG_ID = 2 |
Frame config ID for external GNSS antenna. More... | |
static const uint8_t | BODY_VELOCITY_FRAME_CONFIG_ID = 3 |
Frame config ID for body frame velocity. More... | |
This example shows a basic setup to configure the navigation filter with external heading, and GNSS position and velocity as the heading sources to stream filter data using simulated external aiding measurements for the 3DM-CV7-INS, and 3DM-GV7-INS using C. This is not an exhaustive example of all settings for those devices. If this example does not meet your specific setup needs, please consult the MIP SDK API documentation for the proper commands.
|
static |
Processes and formats log messages from the MIP SDK based on severity level. Routes messages to appropriate output streams - errors and fatal messages go to stderr while other levels go to stdout. Each message is prefixed with its severity level name.
_user | Pointer to user data (unused in this implementation) |
_level | Log message severity level from microstrain_log_level enum |
_format | Printf-style format string for the message |
_args | Variable argument list containing message parameters |
|
static |
_device | Pointer to the initialized MIP device interface |
|
static |
Sets up filter data output by:
_device | Pointer to the initialized MIP device interface |
|
static |
Sets up a heading reference frame for external sensor data:
The frame is configured with tracking enabled and uses an Euler angle rotation format.
_device | Pointer to the initialized MIP device interface |
|
static |
Sets up a GNSS antenna reference frame for external sensor data:
The frame is configured with tracking enabled and uses an Euler angle rotation format.
_device | Pointer to the initialized MIP device interface |
|
static |
Sets up a body frame velocity reference frame for external sensor data:
The frame is configured with tracking enabled and uses an Euler angle rotation format.
_device | Reference to the initialized MIP device interface |
|
static |
Configures the navigation filter by:
_device | Pointer to the initialized MIP device interface |
|
static |
Outputs readable messages for filter state transitions:
_filter_state | Current filter mode from the MIP device interface |
|
static |
Provides basic timestamping using system time:
|
static |
Implements the MIP device interface send callback:
_device | MIP device interface containing the connection |
_data | Buffer containing packet data to send |
_length | Number of bytes to send |
|
static |
Implements the MIP device interface receive callback:
_device | MIP device interface containing the connection |
_buffer | Buffer to store received data |
_max_length | Maximum number of bytes to read |
_wait_time | How long to wait for data in milliseconds |
_from_cmd | Whether this read is from a command response (unused) |
_length_out | Number of bytes actually read |
_timestamp_out | Timestamp when data was received |
|
static |
Performs a complete device initialization sequence:
_device | Pointer to a MIP device interface to initialize |
_device_port | Pointer to an initialized serial port for device communication |
_baudrate | Serial communication baudrate for the device |
|
static |
Provides simulated true heading data to the device for filter aiding. Uses fixed values:
_device | Pointer to the initialized MIP device interface |
_aiding_time | Pointer to the timestamp for the external measurement |
|
static |
Provides simulated LLH position data to the device for filter aiding. Uses fixed coordinates for MicroStrain headquarters:
_device | Pointer to the initialized MIP device interface |
_aiding_time | Pointer to the timestamp for the external measurement |
|
static |
Provides simulated North-East-Down velocity data to the device for filter aiding. Uses stationary target values:
_device | Pointer to the initialized MIP device interface |
_aiding_time | Pointer to the timestamp for the external measurement |
|
static |
Provides simulated body-frame velocity data to the device for filter aiding. Uses stationary target values:
_device | Pointer to the initialized MIP device interface |
_aiding_time | Pointer to the timestamp for the external measurement |
|
static |
Handles graceful shutdown when errors occur:
_device_port | Serial port connection to close |
_message | Error message to display |
_successful | Whether termination is due to success or failure |
|
static |
Handles command failure scenarios:
_device | MIP device interface for the command that failed |
_cmd_result | Result code from a failed command |
_format | Printf-style format string for error message |
... | Variable arguments for format string |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |