Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readGpsCompassBaseline results in InvalidRegister error #57

Open
jfinken opened this issue Apr 9, 2021 · 0 comments
Open

readGpsCompassBaseline results in InvalidRegister error #57

jfinken opened this issue Apr 9, 2021 · 0 comments

Comments

@jfinken
Copy link

jfinken commented Apr 9, 2021

Sensor details:

  • Model: VN-200T-CR
  • Firmware Version: 2.0.0.1
  • Hardware Version : 3

ROS2 version:

  • ros2-foxy built from source

Symptom:

  • connect() method of the vectornav ROS2 node calls readGpsCompassBaseline(). This results in an InvalidRegister error and crashes the node.

Example:

$ ros2 run vectornav vectornav
[INFO] [1617998363.122277432] [vectornav]: Connected to /dev/ttyUSB0 @ 115200 baud
[INFO] [1617998363.122711121] [vectornav]: Model: VN-200T-CR
[INFO] [1617998363.122783394] [vectornav]: Firmware Version: 2.0.0.1
[INFO] [1617998363.122834275] [vectornav]: Hardware Version : 3
[INFO] [1617998363.122878090] [vectornav]: Serial Number : 100060054
[INFO] [1617998363.122923450] [vectornav]: User Tag : ""
[INFO] [1617998363.323962161] [vectornav]: GPS Mode       : 0
[INFO] [1617998363.324118519] [vectornav]: GPS PPS Source : 0
[INFO] [1617998363.358180097] [vectornav]: GPS Offset     : (-0.060000, -0.010000, 0.150000)
[ERROR] [1617998363.373906003] [vectornav]: SensorError: 8
terminate called after throwing an instance of 'vn::sensors::sensor_error'
  what():  received sensor error 'InvalidRegister'

Thoughts?

This can be caught via something like:

    // GPS Compass Baseline
    // 8.2.3
    try {
      auto gps_baseline = vs_.readGpsCompassBaseline();
      RCLCPP_INFO(get_logger(), "GPS Baseline     : (%f, %f, %f), (%f, %f, %f)",
        gps_baseline.position[0], gps_baseline.position[1], gps_baseline.position[2],
        gps_baseline.uncertainty[0], gps_baseline.uncertainty[1], gps_baseline.uncertainty[2]);

    } catch (vn::sensors::sensor_error e) {
      RCLCPP_ERROR(get_logger(), "readGpsCompassBaseline: %s", e.what());
    }
    ...

I'd be happy to submit a PR against the ROS2 branch if interested. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant