NEPI Engine – Accessing NEPI NavPose Data
Introduction
This tutorial will walk you through how to access and use the NEPI-Engine’s NavPose data solution in your automation applications.
NEPI NavPose Conventions
NEPI uses a north-east-down (NED) global reference frame and a forward-right-down (FRD) local body reference frame as defined below.
NED Global Frame: X is North, Y is East, Z is Down (Towards Earth Center), and Yaw 0 degrees faces North and rotates positive using right hand rule around Z axis down.
Local Body Frame (Fixed to Robotic Platform Body): X axis points in Forward (defined by geometry and not by movement) direction (RHR roll axis), Y axis points to the Right (geometrically) (RHR pitch axis), Z axis points Down (geometrically) (RHR yaw axis), Yaw 0 degrees faces X and rotates positive using right hand rule around Z axis down.
What you will need:
1) 1x NEPI-enabled device. This tutorial uses an edge-compute processor box that includes an NVIDIA Jetson Xavier NX embedded GPU module with NEPI Engine software installed.
NOTE: See available off-the-shelf NEPI enabled edge-compute options at: https://numurus.com/products-nepi-enabled-hardware/
2) 1x PC with configured to access the NEPI device’s NEPI File System. This tutorial uses a Windows 11 PC and a USB GigE Ethernet adapter and Ethernet cable.
NOTE: Instructions for c accessing your NEPI device’s File System is provided in the NEPI Engine – Getting Started tutorials at: https://nepi.com/nepi-tutorials/nepi-engine-accessing-the-nepi-file-system/
3) (Optional) Either NEPI configured to a fixed NavPose solution or 1x NEPI supported NavPose data source connected.
NOTE: Instructions for configuring a NEPI fixed NavPose solution and connecting NEPI supported NavPose hardware is provided in the NEPI Engine – Hardware Interfacing tutorials at: https://nepi.com/nepi-tutorials/
NEPI ROS NavPose Data Service Topic
NEPI’s NavPose system connects with configured external GPS, INS, and Autopilot systems and creates a common NavPose data solution available to the rest of the NEPI system including custom ROS nodes and NEPI automation scripts. NEPI’s NavPose data is available on the following ROS service:
<Your Base Namespace>/nav_pose_query
You can find the exact topic names including your systems Base Namespace by opening an SSH terminal to your NEPI Device and typing:
rosservice list | grep nav_pose_query
Example:
The nav_pose_query ROS service takes the following two arguments as inputs:
query_time | Use timestamp 0 to request the latest solution, or timestamp within the last 5 seconds for past data. Data is interpolated if it does not correspond to an exact timestamp at which nav pose was computed. |
transform | Use transform 0 to get data with no transformation applied. |
The NEPI NavPose solution data is accessible from the NEPI ROS environment through the “/nav_pose/query” ros service call. We can see the data type returned by the service call using the rosservice type command line introspection tool using the following command:
rosservice type <Your Base Namespace>/nav_pose_query
Example:
rosservice type /nepi/s2x/nav_pose_query
Which returns
- nepi_ros_interfaces/NavPoseQuery
This message shows that the service call returns a custom nepi message type “nepi_ros_interfaces/NavPoseQuery”, which can be viewed at:
https://github.com/numurus-nepi/nepi_ros_interfaces/blob/master/srv/NavPoseQuery.srv
which includes a NEPI NavPose message type, which can be viewed at:
nepi_ros_interfaces/msg/NavPose.msg at master · numurus-nepi/nepi_ros_interfaces (github.com)
You can view the NEPI NavPose service data from your NEPI SSH terminal by typing:
rosservice call <Your Base Namespace>/nav_pose_query 0 0
Example:
rosservice call /nepi/s2x/nav_pose_querry 0 0
Using NEPI NavPose Automation Scripts
NEPI NavPose data is made accessible programmatically for use in automation solutions through a NEPI ROS service call. For an example automation script that accesses the NEPI NavPose ROS service call, then processes and publishes the data in different coordinate frames, see the “navpose_get_and_publish_process_script” available in the NEPI sample automation scripts GitHub repo at: https://github.com/numurus-nepi/nepi_sample_auto_scripts
The script calls the NEPI NavPose ROS service call at a set rate, then processes and publishes NavPose data in a variety of formats that include:
navpose = NEPI custom NavPose message that includes complete navpose solution data
heading_deg = Float64 (heading in degrees)
orientation_ned_degs = [Float64, Float64, Float64] (roll, pitch, yaw in degrees NED frame)
orientation_enu_degs = [Float64, Float64, Float64] (roll, pitch, yaw in degrees ENU frame)
position_ned_m = [Float64, Float64, Float64] (x, y, z in meters NED frame)
position_enu_m = [Float64, Float64, Float64] (x, y, z in meters ENU frame)
location_amsl_geo = [Float64, Float64, Float64] (lat, long, altitude in deg above mean sea level)
location_wgs84_geo = [Float64, Float64, Float64] (lat, long, altitude in deg above ellipsoid level)
geoid_height_m = Float64 (add this value to AMSL height to convert to Ellipsoid height)
You can download this and other NEPI automation script examples from the NEPI sample automation scripts repo at: https://github.com/numurus-nepi/nepi_sample_auto_scripts