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
103 stars 75 forks source link

Unable to auto-reconnect if sudden disconnection and reconnection happen. #279

Closed amgaber95 closed 8 months ago

amgaber95 commented 1 year ago

Describe the bug Occasionally, the IMU experiences spontaneous disconnections and subsequent reconnections, likely due to undetermined electronic issues. Unfortunately, the package or driver does not possess an automatic reconnection feature, and when the IMU is reconnected after a disconnection event, it fails to re-establish communication, generating an error message as follows:

[DEBUG] [1697703151.536200751]: Fetching device info
[ERROR] [1697703151.536261658]: MIP SDK: Failed to write serial data (5): Input/output error
[ERROR] [1697703151.536284189]: Failed to fetch device info
[ERROR] [1697703151.536302195]:   Error(-6): Error
[DEBUG] [1697703151.572318691]: Fetching device info
[ERROR] [1697703151.572386733]: MIP SDK: Failed to write serial data (5): Input/output error
[ERROR] [1697703151.572417939]: Failed to fetch device info
[ERROR] [1697703151.572442470]:   Error(-6): Error

and it only works, if i killed the terminal and rerun the launch file.

To Reproduce Steps to reproduce the behavior:

  1. Launch Node with command roslaunch microstrain_inertial_driver microstrain.launch
  2. disconnect
  3. reconnect
  4. See Error

Expected behavior to try to reconnect to the port again and start publishing the messages

Environment (please complete the following information):

Launch Parameters

port        : "/dev/imu1"
aux_port    : "/dev/ttyACM1"
baudrate    : 230400
debug       : True
diagnostics : True
set_baud : False
imu_frame_id          : "imu_link"
gnss1_frame_id        : "gnss1_antenna_wgs84"
gnss2_frame_id        : "gnss2_antenna_wgs84"
filter_frame_id       : "sensor_wgs84"
filter_child_frame_id : "sensor"
nmea_frame_id         : "nmea"
poll_port      : False
poll_rate_hz   : 1.0
poll_max_tries : 60
use_enu_frame : True
device_setup : True
save_settings : False
use_device_timestamp : False
use_ros_time : True
raw_file_enable : False
raw_file_include_support_data : False
raw_file_directory : "/home/your_name"
imu_data_rate : 250
imu_raw_data_rate              : -1
imu_mag_data_rate              : -1
imu_gps_corr_data_rate         : -1
imu_overrange_status_data_rate : -1
imu_orientation_cov : [0.01, 0, 0, 0, 0.01, 0, 0, 0, 0.01]
imu_linear_cov      : [0.01, 0, 0, 0, 0.01, 0, 0, 0, 0.01]
imu_angular_cov     : [0.01, 0, 0, 0, 0.01, 0, 0, 0, 0.01]
gnss1_data_rate : 2
gnss1_nav_sat_fix_data_rate        : -1
gnss1_odom_data_rate               : -1
gnss1_time_reference_data_rate     : -1
gnss1_fix_info_data_rate           : -1
gnss1_sbas_info_data_rate          : -1
gnss1_rf_error_detection_data_rate : -1
gnss1_antenna_offset : [0.0, -0.7, -1.0]
gnss2_data_rate : 2
gnss2_nav_sat_fix_data_rate        : -1
gnss2_odom_data_rate               : -1
gnss2_time_reference_data_rate     : -1
gnss2_fix_info_data_rate           : -1
gnss2_sbas_info_data_rate          : -1
gnss2_rf_error_detection_data_rate : -1
gnss2_antenna_offset : [0.0, 0.7, -1.0]
rtk_dongle_enable : False
rtk_data_rate: 1
rtk_status_data_rate : 1
subscribe_rtcm : False
rtcm_topic     : "/rtcm"
publish_nmea   : False
filter_data_rate : 10
filter_status_data_rate                     : -1
filter_heading_data_rate                    : -1
filter_heading_state_data_rate              : -1
filter_odom_data_rate                       : -1
filter_imu_data_rate                        : -1
filter_relative_odom_data_rate              : -1
filter_aiding_status_data_rate              : -1
filter_antenna_offset_correction_data_rate  : -1
filter_gnss_dual_antenna_data_rate          : -1
filter_aiding_measurement_summary_data_rate : -1
filter_sensor2vehicle_frame_selector : 1
filter_sensor2vehicle_frame_transformation_euler      : [0.0, 0.0, 0.0]
filter_sensor2vehicle_frame_transformation_matrix     : [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
filter_sensor2vehicle_frame_transformation_quaternion : [0.0, 0.0, 0.0, 1.0]
filter_reset_after_config : True
filter_auto_init : True
filter_declination_source : 2
filter_declination        : 0.23
filter_heading_source : 1
filter_dynamics_mode : 1
filter_use_compensated_accel : True
filter_velocity_zupt_topic : "/moving_vel"
filter_angular_zupt_topic  : "/moving_ang"
filter_velocity_zupt       : True
filter_angular_zupt        : True
filter_adaptive_level         : 2
filter_adaptive_time_limit_ms : 15000
filter_enable_gnss_pos_vel_aiding     : True
filter_enable_gnss_heading_aiding     : True
filter_enable_altimeter_aiding        : False
filter_enable_odometer_aiding         : False
filter_enable_magnetometer_aiding     : False
filter_enable_external_heading_aiding : False
filter_enable_external_gps_time_update : False
filter_external_gps_time_topic         : "/external_gps_time"
gps_leap_seconds                       : 18.0
filter_external_speed_topic : "/external_speed"
filter_vel_in_vehicle_frame : True
filter_lever_arm_offset: [0.0, 0.0, 0.0]
enable_hardware_odometer : False
odometer_scaling         : 0.0
odometer_uncertainty     : 0.0
gpio_config    : False
gpio1_feature  : 0
gpio1_behavior : 0
gpio1_pin_mode : 0
gpio2_feature  : 0
gpio2_behavior : 0
gpio2_pin_mode : 0
gpio3_feature  : 0
gpio3_behavior : 0
gpio3_pin_mode : 0
gpio4_feature  : 0
gpio4_behavior : 0
gpio4_pin_mode : 0
filter_init_condition_src              : 0
filter_auto_heading_alignment_selector : 1
filter_init_reference_frame            : 2
filter_init_position : [0.0, 0.0, 0.0]
filter_init_velocity : [0.0, 0.0, 0.0]
filter_init_attitude : [0.0, 0.0, 0.0]
filter_relative_position_ned : [0.0, 0.0, 0.0]
gnss1_primary                 : True
gnss1_secondary               : False
gnss2_primary                 : False
gnss2_secondary               : False
gnss1_only_tracking           : False
gnss2_only_tracking           : False
gnss1_use_glns                : False
gnss2_use_glns                : False
gnss1_use_gpgsv               : False
gnss2_use_gpgsv               : False
gnss1_use_gpgsa               : False
gnss2_use_gpgsa               : False
gnss1_use_gpgga               : False
gnss2_use_gpgga               : False
gnss1_use_gprmc               : False
gnss2_use_gprmc               : False
gnss1_use_gnrmc               : False
gnss2_use_gnrmc               : False
gnss1_use_gnvtg               : False
gnss2_use_gnvtg               : False
gnss1_use_insstatus           : False
gnss2_use_insstatus           : False
gnss1_use_sync1               : False
gnss2_use_sync1               : False
gnss1_use_sync2               : False
gnss2_use_sync2               : False
gnss1_use_sync3               : False
gnss2_use_sync3               : False
gnss1_use_syncreport          : False
gnss2_use_syncreport          : False
gnss1_use_gnss_clock          : False
gnss2_use_gnss_clock          : False
gnss1_use_gpstow             : False
gnss2_use_gpstow             : False
gnss1_use_gnssposav          : False
gnss2_use_gnssposav          : False
gnss1_use_elev                : False
gnss2_use_elev                : False
gnss1_use_azi                 : False
gnss2_use_azi                 : False
gnss1_use_utc                 : False
gnss2_use_utc                 : False
rtcm3_topic                    : "/rtcm3"
rtcm3_broadcast_rate           : 1
rtcm3_type                     : 1002
rtcm3_message                 : [1002]
rtcm3_broadcast_enable         : True
base_station_enable            : False
base_station_nmea_gga_topic    : "/base_station/nmea_gga"
base_station_nmea_rmc_topic    : "/base_station/nmea_rmc"
base_station_latitude          : 0.0
base_station_longitude         : 0.0
base_station_altitude          : 0.0
base_station_id                : 0
filter_enable_gnss_vel_aiding  : True
filter_enable_wheeled_vehicle  : False
filter_enable_vel_pos_heading_aiding : False
filter_set_vehicle_body_rotation : False
filter_enable_rtk_gps_heading_aiding : False
gnss1_compass_calibration_time_ms : 10000
gnss1_yaw_offset               : 0.0
gnss2_compass_calibration_time_ms : 10000
gnss2_yaw_offset               : 0.0
gnss_yaw_offset_time_us        : 1000000
filter_output_tracking_status_topic : "/tracking_status"
filter_output_heading_topic         : "/heading"
filter_output_pva_topic             : "/pva"
filter_output_euler_topic           : "/euler"
filter_output_filtered_imu_topic    : "/imu/data"
filter_output_ins_status_topic      : "/ins_status"
filter_output_pos_lla_topic         : "/pos_lla"
filter_output_vel_ned_topic         : "/vel_ned"
filter_output_vel_body_topic        : "/vel_body"
filter_output_pos_ecef_topic        : "/pos_ecef"
filter_output_vel_ecef_topic        : "/vel_ecef"
filter_output_rtk_topic             : "/rtk"
filter_output_mag_topic             : "/mag"
gnss1_extrapolation_time_ms          : 30000
gnss2_extrapolation_time_ms          : 30000
imu_sync_buffer_size                 : 0
imu_measurement_time_tolerance_us    : 1000
gnss1_stationary_timeout             : 300
gnss2_stationary_timeout             : 300
imu_startup_filter_time_ms           : 3000
imu_startup_gnss_time_ms             : 2000
imu_integration_interval_ms           : 10
imu_vibrations_amplitude             : 30.0
imu_gyro_bias_alpha                  : 0.005
imu_gyro_bias_beta                   : 0.00125
imu_acc_bias_alpha                   : 0.005
imu_acc_bias_beta                    : 0.00125
imu_acc_beta                        : 1.0
imu_acc_threshold                    : 0.05
imu_acc_limit                        : 150.0
imu_gyro_alpha                       : 1.0
imu_gyro_threshold                   : 0.01
imu_gyro_limit                       : 150.0
imu_mag_alpha                        : 1.0
imu_mag_threshold                    : 0.01
imu_mag_limit                        : 150.0
imu_gyro_bias_alpha_nominal          : 0.005
imu_gyro_bias_beta_nominal           : 0.0025
imu_acc_bias_alpha_nominal           : 0.005
imu_acc_bias_beta_nominal            : 0.0025
imu_acc_beta_nominal                : 1.0
imu_acc_threshold_nominal            : 0.05
imu_acc_limit_nominal                : 150.0
imu_gyro_alpha_nominal               : 1.0
imu_gyro_threshold_nominal           : 0.01
imu_gyro_limit_nominal               : 150.0
imu_mag_alpha_nominal                : 1.0
imu_mag_threshold_nominal            : 0.01
imu_mag_limit_nominal                : 150.0
gps_enable                               : True
gnss1_enable                             : True
gnss2_enable                             : False
imu_enable                               : True
use_adaptive_gps_mask                    : False
use_adaptive_imu_noise                  : False
vehicle_type                             : 1
vehicle_number                           : 1
receiver_model                           : 5044
receiver_serial_number                    : 123456
file_path                                : "/home/pi/RT3000_1"
solution_status                           : 0
rtk_mode                                  : 0
solution_type                             : 0
gps_time                                 : 0
gps_week                                 : 0
gps_week_seconds                         : 0.0
latitude                                 : 0.0
longitude                                : 0.0
height                                   : 0.0
undulation                               : 0.0
datum_id                                 : 12
station_id                               : 0
age_of_corrections                        : 0.0
reference_station_status                  : 0
number_of_satellites                     : 0
hdop                                     : 0.0
vdop                                     : 0.0
pdop                                     : 0.0
ratio_of_pos_ecef_accuracy_to_horizontal_accuracy : 0.0
ratio_of_pos_ecef_accuracy_to_vertical_accuracy   : 0.0
ratio_of_pos_ned_accuracy_to_horizontal_accuracy : 0.0
ratio_of_pos_ned_accuracy_to_vertical_accuracy   : 0.0
pos_ned_lat                              : 0.0
pos_ned_lon                              : 0.0
pos_ned_hgt                              : 0.0
pos_ned_hac                              : 0.0
pos_ned_vac                              : 0.0
pos_ecef_x                               : 0.0
pos_ecef_y                               : 0.0
pos_ecef_z                               : 0.0
vel_ned_north                            : 0.0
vel_ned_east                             : 0.0
vel_ned_down                             : 0.0
vel_body_forward                         : 0.0
vel_body_right                           : 0.0
vel_body_down                            : 0.0
vel_ecef_x                               : 0.x0
vel_ecef_y                               : 0.0
vel_ecef_z                               : 0.0
filter_utc_time_s                        : 0
filter_utc_time_us                       : 0
filter_week                              : 0
filter_status                            : 0
filter_type                              : 0
filter_euler_yaw                         : 0.0
filter_euler_pitch                       : 0.0
filter_euler_roll                        : 0.0
filter_latitude                          : 0.0
filter_longitude                         : 0.0
filter_height                            : 0.0
filter_velocity_north                    : 0.0
filter_velocity_east                     : 0.0
filter_velocity_down                     : 0.0
filter_heading                           : par_os1_filter_heading
filter_heading_fully_init               : False
filter_hdt                               : 0.0
filter_hdt_reset                         : False
filter_hdt_time_s                        : 0
filter_hdt_time_us                       : 0
filter_velocity_ned_valid                : False
filter_heading_valid                     : False
filter_velocity_body_forward_valid       : False
filter_velocity_body_right_valid         : False
filter_velocity_body_down_valid          : False
filter_yaw_rate_valid                    : False
filter_pos_lla_valid                     : False
filter_vel_ned_valid                     : False
filter_vel_body_valid                    : False
filter_pos_ecef_valid                    : False
filter_vel_ecef_valid                    : False
filter_rtk_heading_valid                 : False
filter_rtk_pos_valid                     : False
filter_rtk_vel_valid                     : False
filter_rtk_yaw_valid                     : False
filter_mag_valid                         : False
filter_sync1_valid                       : False
filter_sync2_valid                       : False
filter_sync3_valid                       : False
filter_sync_report_valid                 : False
filter_odo_lidar_vel_valid               : False
filter_gnss_heading_valid                : False
filter_reference_station_status_valid     : False
reference_station_health                 : 0
filter_time_since_last_reference_station_report_s : 0
filter_ins_pqr                          : [0.0, 0.0, 0.0]
filter_ins_pqr_reset                    : False
filter_ins_pqr_time_s                   : 0
filter_ins_pqr_time_us                  : 0
filter_pos_ecef_reset                   : False
filter_pos_ecef_time_s                  : 0
filter_pos_ecef_time_us                 : 0
filter_pos_lla_reset                    : False
filter_pos_lla_time_s                   : 0
filter_pos_lla_time_us                  : 0
filter_vel_ned_reset                    : False
filter_vel_ned_time_s                   : 0
filter_vel_ned_time_us                  : 0
filter_vel_body_reset                   : False
filter_vel_body_time_s                  : 0
filter_vel_body_time_us                 : 0
filter_sync1_reset                      : False
filter_sync1_time_s                     : 0
filter_sync1_time_us                    : 0
filter_sync2_reset                      : False
filter_sync2_time_s                     : 0
filter_sync2_time_us                    : 0
filter_sync3_reset                      : False
filter_sync3_time_s                     : 0
filter_sync3_time_us                    : 0
filter_sync_report_reset                : False
filter_sync_report_time_s               : 0
filter_sync_report_time_us              : 0
filter_hsi_reset                        : False
filter_hsi_time_s                       : 0
filter_hsi_time_us                      : 0
filter_heading_reset                    : False
filter_heading_time_s                   : 0
filter_heading_time_us                  : 0
filter_odo_lidar_vel_reset              : False
filter_odo_lidar_vel_time_s             : 0
filter_odo_lidar_vel_time_us            : 0
filter_odo_lidar_dis_reset              : False
filter_odo_lidar_dis_time_s             : 0
filter_odo_lidar_dis_time_us            : 0
gnss1_reference_station_health          : 0
gnss2_reference_station_health          : 0
gnss1_time_since_last_report_s          : 0
gnss2_time_since_last_report_s          : 0
filter_nav_mode                         : 0
filter_pwr_state                        : 0
imu_1_error_track                      : False
imu_2_error_track                      : False
ins_filter_error_track                  : False
ins_gps_track                          : False
ins_gnss_heading_track                 : False
user_1_track                            : False
user_2_track                            : False
user_3_track                            : False
user_4_track                            : False
user_5_track                            : False
user_6_track                            : False
user_7_track                            : False
user_8_track                            : False
user_9_track                            : False
user_10_track                           : False
system_can_time_sync_track              : False
system_power_on_reset_track             : False
system_unknown_reset_track              : False
rtk_solution_abort_track                : False
rtk_internal_error_track                : False
rtk_ins_filter_track                    : False
rtk_reference_station_track             : False
rtk_antenna_calibration_track           : False
rtk_heading_alignment_track            : False
rtk_user_1_track                        : False
rtk_user_2_track                        : False
rtk_user_3_track                        : False
rtk_user_4_track                        : False
rtk_user_5_track                        : False
rtk_user_6_track                        : False
rtk_user_7_track                        : False
rtk_user_8_track                        : False
rtk_user_9_track                        : False
rtk_user_10_track                       : False
robbiefish commented 9 months ago

Not sure if this is still an issue, but we have added the ability to auto reconnect in 4.0.0. See this line in the params file for more information.

Please note that for a case like yours where you unplug and replug in the device, if you do not have udev rules which will symlink to a different /dev file (it looks like you have this), the device may come back on a different /dev device which would make this functionality not work

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 2 weeks with no activity. If the issue is still not resolved, please leave a comment describing what is still not working

github-actions[bot] commented 8 months ago

This issue was closed because it has been inactive for 2 weeks since being marked as stale. If the issue is still not resolved, please reopen the issue, and leave a comment describing what is still not working