dawonn / vectornav

ROS Interface for the VectorNav IMU/GPS
147 stars 179 forks source link

Issue getting GNSS topics with VN-200 #142

Open BenoitAud opened 3 months ago

BenoitAud commented 3 months ago

Hi,

I am running a VN-200 with this driver on ROS2 and I can't seem to make the GNSS work. I tried with the VectorNav Control Center and everything is fine. When doing ros2 topic echo /vectornav/gnss, I get this:

---
header:
  stamp:
    sec: 1725133832
    nanosec: 635402920
  frame_id: imu
status:
  status: -1
  service: 0
latitude: 0.0
longitude: 0.0
altitude: 0.0
position_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
position_covariance_type: 2

Am I missing something when it comes to configuring the GNSS with the ROS2 driver? Here is my config file :

vectornav:
  ros__parameters:
    port: "/dev/ttyUSB0"
    baud: 115200
    reconnect_ms: 500
    adjust_ros_timestamp: true
    # Reference vnproglib-1.2.0.0 headers for enum definitions
    # Async Output Type (ASCII)
    AsyncDataOutputType: 0           # VNOFF
    # Async output Frequency (Hz)
    AsyncDataOutputFrequency: 1 #was 20
    # Sync control
    syncInMode: 3                    # SYNCINMODE_COUNT
    syncInEdge: 0                    # SYNCINEDGE_RISING
    syncInSkipFactor: 0
    syncOutMode: 0                   # SYNCOUTMODE_NONE
    syncOutPolarity: 0               # SYNCOUTPOLARITY_NEGATIVE
    syncOutSkipFactor: 0
    syncOutPulseWidth_ns: 100000000
    # Communication protocol control
    serialCount: 0                   # COUNTMODE_NONE
    serialStatus: 0                  # STATUSMODE_OFF
    spiCount: 0                      # COUNTMODE_NONE
    spiStatus: 0                     # STATUSMODE_OFF
    serialChecksum: 1                # CHECKSUMMODE_CHECKSUM
    spiChecksum: 0                   # CHECKSUMMODE_OFF
    errorMode: 1                     # ERRORMODE_SEND
    # Binary output register 1
    BO1:
      asyncMode: 1                   # ASYNCMODE_BOTH --> was 3
      rateDivisor: 8                # 20 Hz --> was 40
      commonField: 0x201 #was 0x7FFF
      timeField: 0x0000              # TIMEGROUP_NONE
      imuField: 0x0000               # IMUGROUP_NONE
      # set gpsField directly in source to enforce or condition
      attitudeField: 0x0000          # ATTITUDEGROUP_NONE
      # set insField directly in source to enforce or condition
      gps2Field: 0x0000              # GPSGROUP_NONE
    # Binary output register 2
    BO2:
      asyncMode: 0                   # ASYNCMODE_NONE
      rateDivisor: 0
      commonField: 0x0000            # COMMONGROUP_NONE
      timeField: 0x0000              # TIMEGROUP_NONE
      imuField: 0x0000               # IMUGROUP_NONE
      gpsField: 0x0000               # GPSGROUP_NONE
      attitudeField: 0x0000          # ATTITUDEGROUP_NONE
      insField: 0x0000               # INSGROUP_NONE
      gps2Field: 0x0000              # GPSGROUP_NONE
    # Binary output register 3
    BO3:
      asyncMode: 0                   # ASYNCMODE_NONE
      rateDivisor: 0
      commonField: 0x0000            # COMMONGROUP_NONE
      timeField: 0x0000              # TIMEGROUP_NONE
      imuField: 0x0000               # IMUGROUP_NONE
      gpsField: 0x0000               # GPSGROUP_NONE
      attitudeField: 0x0000          # ATTITUDEGROUP_NONE
      insField: 0x0000               # INSGROUP_NONE
      gps2Field: 0x0000              # GPSGROUP_NONE
    frame_id: "imu"

vn_sensor_msgs:
  ros__parameters:
    use_enu: true
    orientation_covariance: [0.01,  0.0,   0.0,
                            0.0,   0.01,  0.0,
                            0.0,   0.0,   0.01]
    angular_velocity_covariance: [0.01,  0.0,   0.0,
                         0.0,   0.01,  0.0,
                         0.0,   0.0,   0.01]
    linear_acceleration_covariance: [0.01,  0.0,   0.0,
                         0.0,   0.01,  0.0,
                         0.0,   0.0,   0.01]
    magnetic_covariance: [0.01,  0.0,   0.0,
                         0.0,   0.01,  0.0,
                         0.0,   0.0,   0.01]