LORD-MicroStrain / microstrain_inertial

ROS driver for all of MicroStrain's current G and C series products. To learn more visit
https://www.microstrain.com/inertial
93 stars 67 forks source link

How to initialize heading angle in AHRS status #309

Open kk4hvd opened 4 months ago

kk4hvd commented 4 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Launch Node with command ...
  2. ...
  3. See Error

Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

Launch Parameters

microstrain_inertial_driver: ros__parameters:

You should change this section of config to match your setup

port : '/dev/ttyACM0'
baudrate : 921600

# (GQ7/CV7 full support, GX5-45 limited support) Adaptive filter settings
#      Adaptive level: 0 - off, 1 - Conservative, 2 = Moderate (default), 3 = agressive
#      Time limit: Max duration of measurement rejection prior to recovery, in milliseconds - default = 15000 
filter_adaptive_level         : 2
filter_adaptive_time_limit_ms : 15000

# This will cause the node to convert any NED measurements to ENU
# This will also cause the node to convert any vehicle frame measurements to the ROS definition of a vehicle frame
use_enu_frame : true

# Configure some frame IDs
frame_id : 'cv7_link'  # Frame ID of all of the filter messages. Represents the location of the CV7-INS in the tf tree

# Disable the transform from the mount to frame id transform as it will be handled in the launch file
#publish_mount_to_frame_id_transform : False

# This will set the initial heading alignment to use the magnetometer
filter_auto_heading_alignment_selector : 4

# During operation, we will assume that we are in a wheeled vehicle for more accurate heading
# If using a drone, disable this option, and enable "filter_enable_magnetometer_aiding"
filter_enable_wheeled_vehicle_constraint : false

filter_enable_external_heading_aiding: True
filter_enable_magnetometer_aiding: True

# Disable some heading options that do not work for this device
filter_enable_gnss_pos_vel_aiding : False
filter_enable_gnss_heading_aiding : False

# This example shows a very basic setup with no PPS sync, so this will disable PPS on the device.
# Note that if you have any way to provide PPS, you should setup PPS
filter_pps_source : 4

# Disable the filter declination source. This is required to get the node to start, and isn't doing anything special
filter_declination_source : 1
filter_declination: 0.0

use_device_timestamp: False
filter_data_rate: 100
imu_data_rate: 100
imu_frame_id: 'cv7_link'
filter_frame_id: 'cv7_link'
filter_dynamics_mode : 1 # 1: portable, 2: automotive
imu_orientation_cov : [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01]
imu_linear_cov      : [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01]
imu_angular_cov     : [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01]
filter_heading_source: 0

filter_external_gps_time_topic: ''
filter_external_speed_topic: ''
Dynamics_mode: True

Hello Mr or Mrs. I would like to initialize heading angle set to 0 or something else. (Relative heading angle in AHRS mode)

filter_state: 3 dynamics_mode: 0 status_flags: 1

However, I cannot set the heading angle manually. I tried to call a service "/init_filter_heading" with certain value but it is not working at all. Is it impossible to set the heading angle manually? It think a service which can set heading angle manually is necessary.

Please help!