Coder Social home page Coder Social logo

ros2-driver's Introduction

Advanced Navigation ROS2 Driver

Introduction

This is an example using the Advanced Navigation Spatial SDK to create a ROS2 driver that reads and decodes the Advanced Navigation Packet Protocol (ANPP) (in this case packet #20 and packet #28) and publishes the information as ROS topics / messages.

This example also includes the encoding of ANPP packet #55 and pushes the information to the Spatial INS.

It is designed to work with all Advanced Navigation INS devices using ANPP.

The code has been written to be easy to understand and for ease of extensibility with other ANPP packets.

This example has been developed and tested using Ubuntu Linux v20.04 LTS and ROS2 Foxy Fitzroy. Installation instructions for ROS2 can be found here: https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/

If you require any assistance using this code, please email [email protected]

ROS2 Getting Started Guide

The following guides are useful in getting started with ROS2 if you are not familiar:

Build Instruction

  • Packages should be created in the src directory, not the root of the workspace. Navigate to workspace-folder-name/src, and get the Advanced Navigation ROS2 Driver
    git clone https://github.com/advanced-navigation/ros2-driver.git
    
  • You likely already have the rclpp and std_msgs packages installed as part of your ROS2 system. Either way, it’s good practice to run rosdep in the root of your workspace (workspace-folder-name) to check for missing dependencies before building:
    rosdep install -i --from-path src --rosdistro foxy -y
    
  • In the root of your workspace, workspace-folder-name, source and build the package:
    • Source the ROS2 Environment to the current folder:
      source /opt/ros/foxy/setup.bash
      
    • Build your new package:
      colcon build --packages-select ros2-driver
      

Device Configuration

To use this example code, your Advanced Navigation device should be configured to output ANPP packets #20 and #28.

If you are not sure how to configure your Advanced Navigation Device please refer to the Reference Manual on the relevant product page (https://www.advancednavigation.com/products/all).

Run Instructions

Open a new terminal or new tab, navigate to workspace-folder-name, and source the setup files:

source /opt/ros/foxy/setup.bash
. install/setup.bash
  • Run the Driver in the following manners:
    1. Baud Rate and Comm Port as arguments:
      usage: ros2 run package_name executable_name [baud_rate] [comm_port]
         package_name     Name of the ROS package
         executable_name  Name of the executable
         baud_rate        The Baud rate configured on the device. Default 115200
         comm_port        The COM port of the connected device. Default /dev/ttyUSB0
      
      e.g. ros2 run ros2-driver adnav_driver 115200 /dev/ttyUSB0
    2. Baud Rate, Comm Port and NTRIP as arguments:
      ros2 run package_name executable_name -B [baud_rate] -D [comm_port] -s [server_url] -m [mountpoint]  -u [username] -p [password]
        package_name     Name of the ROS package
        executable_name  Name of the executable
        -B baud_rate     Baud rate configured on the device. Default 115200
        -D comm_port     COM port of the connected device. Default /dev/ttyUSB
        -s server_url    URL of the NTRIP server
        -m mountpoint    Name of the mountpoint
        -u username      Username of your NTRIP account
        -p password      Password of your NTRIP account 
      
      e.g. ros2 run ros2-driver adnav_driver -B 115200 -D /dev/ttyUSB0 -s alldayrtk.com -m MOUNTPOINT_20 -u yourUsername -p yourPassword

Published Topics

Use RQT Monitor to view published topics. Here you will find details on how to use RQT: https://index.ros.org/doc/ros2/Tutorials/RQt-Overview-Usage/

  • Open a new terminal or new tab and source ROS2 Environment to the current folder:
    source /opt/ros/foxy/setup.bash
    
  • Run RQT Monitor by entering the following:
    rqt
    
  • To view the published messages in RQT Monitor, click Plugins and click Topic Monitor

ros2-driver's People

Contributors

ashwinsekarchandrasekaran avatar

Stargazers

Casey Nichols avatar Esteban Andrade avatar

Watchers

James Cloos avatar  avatar

ros2-driver's Issues

Ethernet connection

How can I set up my GNSS device using an ethernet connection? These drivers seem to be meant for a USB device and Serial connection?

heading or two GPS value with dual antennas

Hi advanced navigation team,

we have the certus with dual-antennas. We would like to know under which rostopic we can get the heading angle directly? Or is it possible to get two GPS values from the two antennas at the same time?

Best regards
Chris

Heading

Can you suggest what is the best way to get the heading values? We are currently calculating the heading from the magnetic field topic but is there a topic from which we get the heading directly?

Wrong sign in the /Imu topic angular_velocity

I've been trying to integrate the /Imu topic into the robot_localization package. I've noticed that if I use the orientation from the /Imu topic the output topic from robot_localization reports the expected orientation. But if I use the angular_velocity the output topic orientation seems to be reversed.

Reviewing the code from advanced_navigation_driver.cpp I saw that the orientation topics are corrected to match the REP-103 specification.

If I change

imu_msg.angular_velocity.z=system_state_packet.angular_velocity[2];

to

imu_msg.angular_velocity.z=-system_state_packet.angular_velocity[2];

I get the expected behavior

Build fails on latest LTS ROS2 "Humble"

I realise that this driver was written with ROS2 "Foxy" in mind, but it shouldn't be too hard to get it to play nice with the newest LTS being that we're still in the land of ROS2.

I've attempted a build and am getting the following error:

~/dev_ws/src/ros2-driver/src/advanced_navigation_driver.cpp:40:10: fatal error: tf2/LinearMath/Quaternion.h: No such file or directory
   40 | #include <tf2/LinearMath/Quaternion.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Meaning that somewhere along the way we're not referencing the right library header location.

I'll dig and see what I can find, but right now I thought I'd let you know so that moves can be made to get this library up to speed with the latest LTS

Wrong timestamp in /Imu header frame

I'm currently trying to integrate the /Imu topic from the ros2-driver with the robot_localization package to calculate my robot orientation. At the beggining, robot_localization was not able to handle the /Imu topic orientation information. After some investigation I discovered that the problem was in the timestamp that ros2-driver was publishing in the /Imu topic header. The timestamp was not aligned with the timestamp of the static transform that I use to convert the imu frame to base_link, so robot_localization was ignoring the topic.

This timestamp seems to be passed directly from the data received from the imu. Is there some reason to use the timestamp like this? Why not use the ROS timestamp for this field?

I solved my problem by modifying the ros2_driver advanced_navigation_driver.cpp like this

// IMU
imu_msg.header.stamp=node->now();
imu_msg.header.frame_id=imu_frame_id;
// Using the RPY orientation as done by cosama
orientation.setRPY(
	system_state_packet.orientation[0],
	system_state_packet.orientation[1],
	PI/2.0f - system_state_packet.orientation[2] //REP 103
);

Empty frame_id in /Imu message

The frame_id in the /Imu message is empty. It seems that in the file advanced_navigation_driver.cpp, during the initialization of imu_msg the frame_id is set to "imu" but then is set to the variable imu_frame_id each time a packet is decoded and imu_frame_id is always empty.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.