wiki_src.txt 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. == Overview ==
  2. Interface (driver) software, including ROS node, for Microstrain 3DM-GX5-45.
  3. The interface makes use of the MIP SDK Version 1.1 from Microstrain to communicate with the device. Includes the following applications:
  4. === Supported Devices ===
  5. == ROS Nodes ==
  6. {{{
  7. #!clearsilver CS/NodeAPI
  8. node.0 {
  9. name = microstrain_3dm_gx5_45
  10. desc = ROS node that captures IMU/GPS data.
  11. pub {
  12. 0.name= gps/fix
  13. 0.type= sensor_msgs/NavSatFix
  14. 0.desc= See [[#gpsmsg|Navsatfix message description]] below.
  15. 1.name= imu/data
  16. 1.type= sensor_msgs/Imu
  17. 1.desc= See [[#imumsg|Imu message description]] below
  18. 2.name= nav/odom
  19. 2.type= nav_msgs/Odometry
  20. 2.desc= See [[#odommsg|Odometry message description]] below
  21. 3.name= nav/status
  22. 3.type= std_msgs/Int16MultiArray
  23. 3.desc= See below [[#navstatusmsg|Nav Status message description]]
  24. }
  25. srv {
  26. 0.name = reset_kf
  27. 0.type = std_srvs/Empty
  28. 0.desc = Resets the Kalman filter on the device
  29. }
  30. param {
  31. 0.name = port
  32. 0.type = string
  33. 0.desc = Serial port - Linux only
  34. 0.default = /dev/ttyACM0
  35. 1.name = baud_rate
  36. 1.type = int
  37. 1.desc = Baud rate of serial connection
  38. 1.default = 115200
  39. 2.name= device_setup
  40. 2.type= bool
  41. 2.desc= If true, puts device in idle mode and configures the device.If false, skips configuration. Important: the configuration parameters below are not effective unless this flag is true.
  42. 2.default= true
  43. 3.name= readback_settings
  44. 3.type= bool
  45. 3.desc= coming soon
  46. 3.default= true
  47. 4.name= auto-init
  48. 4.type= bool
  49. 4.desc= tbd
  50. 4.default= true
  51. 5.name=dynamics_mode
  52. 5.type=int
  53. 5.desc=Vehicle dynamics mode 0x01=Portable, 0x02=Automotive, 0x03=Airborne
  54. 5.default = 1
  55. 6.name=declination_source
  56. 6.type=int
  57. 6.desc=Possible declination sources: 0x01=Node, device reports magnetic north, 0x02=Internal World Magnetic Model, 0x03=Manual (see declination parameter)
  58. 6.default=2
  59. 8.name=gps_frame_id
  60. 8.type=string
  61. 8.desc= Value for the frame_id field in the header of the NavSatFix message published on the gps/fix topic
  62. 8.default=wgs84
  63. 9.name=imu_frame_id
  64. 9.type=string
  65. 9.desc=Value of the frame_id field in the header of the Imu message publised in the imu/data topic
  66. 9.default=base_link
  67. 10.name=odom_frame_id
  68. 10.type=string
  69. 10.desc=Value of the frame_id field in the header of the Odometry message published on the nav/odom topic
  70. 10.default=wgs84
  71. 11.name=odom_child_frame_id
  72. 11.type=string
  73. 11.desc=Value of the child_frame_id field in the Odometry message published on the nav/odom topic.
  74. 11.default=base_link
  75. 12.name=publish_gps
  76. 12.type=bool
  77. 12.desc=Sets if ~gps/fix should be advertised/published or not. Note - to maximize performance you may want to only publish the Odometry messages
  78. 12.default=true
  79. 13.name=publish_imu
  80. 13.type=bool
  81. 13.desc= Sets if ~imu/data should be advertised/published or not.
  82. 13.default=true
  83. 14.name=publish_gps
  84. 14.type=bool
  85. 14.desc=Sets if ~nav/odom should be advertised/published or not.
  86. 14.default=true
  87. 15.name=gps_rate
  88. 15.type=int
  89. 15.desc=Target update (publishing) rate for gps/fix messages. See [[#rates|Update Rates]] below.
  90. 15.default=1
  91. 16.name=imu_rate
  92. 16.type=int
  93. 16.desc=Target update (publishing) rate for imu/data messages. See [[#rates|Update Rates]] below.
  94. 16.default=10
  95. 17.name=odom_rate
  96. 17.type=int
  97. 17.desc=Target update (publishing) rate for nav/odom messages. See [[#rates|Update Rates]] below.
  98. 17.default=10
  99. }
  100. }
  101. }}}
  102. <<Anchor(rates)>>>
  103. === Update Rates ===
  104. The rates are set as a target value in Hz. The device accepts a decimation value for each output; the packet rate is base_rate/decimation, where decimation is an integer. The program calculates the decimation to get close the the desired rate, based on polling the sensor for its base rate.
  105. For the 3DM-GX4-45 and 3DM-GX5-45 devices tested the base rates were...
  106. * GPS - base rate = 4 Hz
  107. * IMU - base rate = 500 Hz
  108. * Filter - base rate = 500 Hz
  109. <<Anchor(gpsmsg)>>
  110. === Nav Sat Fix message description ==
  111. Position covariance is populated with diagonals based on reported horizontal and vertical accuracy. The status.status field is the LLH position data "valid flag"-1. The valid flag mapping from the 3DM protocol is
  112. * 0x0001 – Latitude and Longitude Valid
  113. * 0x0002 – Ellipsoid Height Valid
  114. * 0x0004 – MSL Height Valid
  115. * 0x0008 – Horizontal Accuracy Valid
  116. * 0x0010 – Vertical Accuracy Valid
  117. * E.g., if all valid, then the status.status field should be 30.
  118. <<Anchor(imumsg)>>
  119. === IMU message description ===
  120. Coming soon
  121. <<Anchor(odommsg)>>
  122. === Odometry message description ===
  123. * Currently the pose.position is the longitude (x), latitude (y) and ellipsoid height (z)
  124. * pose.covariance and twist.covariance include diagonal elements for position and attitude
  125. <<Anchor(navstatusmsg)>>
  126. == Nav Status message description ===
  127. * Includes three values - see communication protocol for full documentation.
  128. * filter_state
  129. * 0x00 – Startup
  130. * 0x01 – Initialization (see status flags)
  131. * 0x02 – Running, Solution Valid
  132. * 0x03 – Running, Solution Error (see status flags)
  133. * dynamics mode
  134. * 0x01 – Portable (device default)
  135. * 0x02 – Automotive
  136. * 0x03 – Airborne
  137. * status_flags
  138. * See device documentation
  139. == Build Instructions ==
  140. Building from source
  141. {{{
  142. DISTRO={hydro|indigo}
  143. cd ~/catkin_ws
  144. rosdep update
  145. rosdep check --from-paths src/microstrain_3dm_gx5_45/ --rosdistro=$DISRO
  146. rosdep install --from-paths src/microstrain_3dm_gx5_45/ --ignore-src --rosdistro=$DISTRO --simulate
  147. rosdep install --from-paths src/microstrain_3dm_gx5_45/ --ignore-src --rosdistro=$DISTRO
  148. catkin_make
  149. source devel/setup.bash
  150. }}}
  151. == Dev Notes ==
  152. The mip_sdk_user_functions are C functions that need to be called by various parts of the SDK. The main purpose of these functions is to implement the platform-specific serial (RS232) port elements. The prototype serial port open function takes the COM number as an integer input - which is clunky for Linux serial ports. Changed this to take a string defining the port (e.g., /dev/ttyS0), but this necessitated also modifying the mip_sdk_interface.[ch] files, since this is what is called by the application - changed the mip_interface_init function to accept a string argument for specifying the port.
  153. == TODO ==
  154. * Verify order of quaternions
  155. == Examples ==
  156. == Launch File Examples ==
  157. Example launch files are provided with the package to illustrate setting the various parameters.