Modified version of the ROS2 Python Basic Subscriber Example combined with the geonav_conversions.py file from geonav_transform. Converts GPS coordinates from a NavSatFix message topic into the local XYZ coordinate system used by Rviz2 to obtain the initial position of the sensor on the local grid. Writes the XYZ coordinates to the initial_state parameter of a user-specified robot_localization params yaml file.
Ubuntu & ROS2
GPS Data published as a NavSatFix ROS2 topic
Ubuntu 22.04 ARM64
ROS2 Humble
Nvidia Jetson AGX Orin
Inertial Sense uINS
ISRoverNetworkNMEA
is_gps_publisher_ros2
Create a ROS2 Workspace
mkdir -p gpsWS/src
cd gpsWS/srcClone the respository in the src folder
git clone https://github.com/ChesterMK7/py_get_init_posMake sure to configure the files you want to use
nano py_get_init_pos/py_get_init_pos/subscriber_member_function.pySpecifically modify these lines in subscriber_member_function.py
# Filenames for param input and output
input_file = "/home/orin/Desktop/launch_files/nav2_gps/scout/params/scout_dual_ekf_navsat_params.backup.yaml"
# Note that the output file WILL BE OVERWRITTEN when the node runs
output_file = "/home/orin/Desktop/launch_files/nav2_gps/scout/params/scout_dual_ekf_navsat_params.yaml"Return to the workspace directory and build using colcon
cd ..
source /opt/ros/<ros2-version>/setup.bash
colcon buildSource the workspace
source install/setup.bashRun the parser/publisher node
ros2 run py_get_init_pos gps_convert