From 9913037edaf5dac7a881cde173b98d41037f8783 Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Sun, 19 Jan 2025 14:09:43 -0800 Subject: [PATCH 1/8] [PointOneNav + ROS2] Integrated PointOneNav into ROS2 system Still need launch file to integrate to F1Tenth stack --- Makefile | 9 +++++ repos/common.repos | 5 +++ repos/pon.repos | 5 +++ repos/sim.repos | 2 +- scripts/pon.sh | 95 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 repos/pon.repos create mode 100755 scripts/pon.sh diff --git a/Makefile b/Makefile index 910515ea..c248ad8d 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,15 @@ livox-driver: vcs import < repos/livox.repos ./scripts/livox_driver.sh +.PHONY: pointonenav +pointonenav: + ./scripts/pon.sh + vcs import < repos/pon.repos + cd src/external/sensors/gps/pointonenav/fusion-engine-driver + rosdep install -i --from-path ./ --rosdistro foxy -y + colcon build --packages-select fusion-engine-driver + source install/local_setup.bash + .PHONY: racer racer: vcs import < repos/common.repos diff --git a/repos/common.repos b/repos/common.repos index b56be44b..11693df2 100644 --- a/repos/common.repos +++ b/repos/common.repos @@ -17,3 +17,8 @@ repositories: type: git url: https://github.com/Triton-AI/multi_cam_oak_lite.git version: master + #GPS + src/external/sensors/gps: + type: git + url: + version: master diff --git a/repos/pon.repos b/repos/pon.repos new file mode 100644 index 00000000..1e113534 --- /dev/null +++ b/repos/pon.repos @@ -0,0 +1,5 @@ +repositories: + src/external/sensors/gps/pointonenav: + type: git + url: https://github.com/Triton-AI/ros2-fusion-engine-driver.git + version: main diff --git a/repos/sim.repos b/repos/sim.repos index c79bd249..0063cb29 100644 --- a/repos/sim.repos +++ b/repos/sim.repos @@ -6,4 +6,4 @@ repositories: src/external/f1tenth_sim/f1tenth_gym_ros: type: git url: https://github.com/Triton-AI/f1tenth_gym_ros.git - version: main \ No newline at end of file + version: main diff --git a/scripts/pon.sh b/scripts/pon.sh new file mode 100755 index 00000000..faaac7c6 --- /dev/null +++ b/scripts/pon.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +# All documentations related are as follows +# https://github.com/PointOneNav/p1-host-tools +# https://github.com/PointOneNav/ros2-fusion-engine-driver/tree/main?tab=readme-ov-file#requirements +# Property of Triton AI @ UCSD, Kevin Shin + +# Check for C++11 or later +if g++ -std=c++11 -E -x c++ - /dev/null; then + echo "C++11 or later: Installed" +else + echo "C++11 or later: Not installed" +fi + +# Check for CMake 3.x +if command -v cmake >/dev/null 2>&1; then + cmake_version=$(cmake --version | head -n1 | awk '{print $3}') + if [[ $cmake_version == 3.* ]]; then + echo "CMake 3.x: Installed (version $cmake_version)" + else + echo "CMake 3.x: Not installed (found version $cmake_version)" + fi +else + echo "CMake 3.x: Not installed" +fi + +# Check for GCC or Clang +if command -v gcc >/dev/null 2>&1; then + echo "GCC: Installed ($(gcc --version | head -n1))" +elif command -v clang >/dev/null 2>&1; then + echo "Clang: Installed ($(clang --version | head -n1))" +else + echo "Neither GCC nor Clang is installed" +fi + +# Check for ROS 2 Foxy +if [ -f /opt/ros/foxy/setup.bash ]; then + echo "ROS 2 Foxy: Installed" +else + echo "ROS 2 Foxy: Not installed" +fi + + +# Install missing packages +install_package() { + echo "Installing $1..." + sudo apt-get update + sudo apt-get install -y $1 +} + +check_package() { + if dpkg -s $1 >/dev/null 2>&1; then + return 0 + else + return 1 + fi +} + +packages=("ros-foxy-gps-msgs" "ros-foxy-nmea-msgs" "ros-foxy-mavros-msgs") +all_installed=true + +for package in "${packages[@]}"; do + if ! dpkg -s $package >/dev/null 2>&1; then + install_package $package + else + echo "$package is already installed." + fi + + if ! check_package $package; then + all_installed=false + fi +done + +# Configurations +if $all_installed; then + echo "All required ROS Foxy packages are installed. Proceeding with FusionEngine configuration." + cd tools/ + if [ ! -d "p1-host-tools" ]; then + git clone https://github.com/PointOneNav/p1-host-tools.git + fi + cd p1-host-tools + python3 -m venv p1_tools + source p1_tools/bin/activate + pip3 install -r requirements.txt + python3 bin/config_tool.py apply uart2_message_rate fe ROSPoseMessage 100ms + python3 bin/config_tool.py apply uart2_message_rate fe ROSGPSFixMessage 100ms + python3 bin/config_tool.py apply uart2_message_rate fe ROSIMUMessage 100ms + python3 bin/config_tool.py save + deactivate + cd ../.. + + echo "FusionEngine device configured and tools installed successfully." +else + echo "Some required ROS Foxy packages are missing. Please install them before configuring the FusionEngine device." +fi From 0f04d36a5bf9da6c456e1e3160dd41a9b7169ed5 Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Sun, 19 Jan 2025 14:12:24 -0800 Subject: [PATCH 2/8] Your commit message --- tools/p1-host-tools | 1 + 1 file changed, 1 insertion(+) create mode 160000 tools/p1-host-tools diff --git a/tools/p1-host-tools b/tools/p1-host-tools new file mode 160000 index 00000000..63bb6bce --- /dev/null +++ b/tools/p1-host-tools @@ -0,0 +1 @@ +Subproject commit 63bb6bcec28c61d2e7d734e39d406eae3d21d50f From dd1267aa4f7ca477fda071904539a9482c0cfd65 Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Sun, 19 Jan 2025 15:13:30 -0800 Subject: [PATCH 3/8] [ntrip_client] Added ntrip_client package for connecting with serialization Title --- Makefile | 6 +++++- repos/pon.repos | 5 +++++ scripts/pon.sh | 2 +- tools/p1-host-tools | 1 - 4 files changed, 11 insertions(+), 3 deletions(-) delete mode 160000 tools/p1-host-tools diff --git a/Makefile b/Makefile index c248ad8d..ab462249 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ .ONESHELL: SHELL := /bin/bash .DEFAULT_GOAL := build - .PHONY: build build: colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release @@ -45,6 +44,11 @@ pointonenav: rosdep install -i --from-path ./ --rosdistro foxy -y colcon build --packages-select fusion-engine-driver source install/local_setup.bash + + cd .. + cd ntrip_client + colcon build --packages-select ntrip_client + source install/local_setup.bash .PHONY: racer racer: diff --git a/repos/pon.repos b/repos/pon.repos index 1e113534..dfdd6f33 100644 --- a/repos/pon.repos +++ b/repos/pon.repos @@ -3,3 +3,8 @@ repositories: type: git url: https://github.com/Triton-AI/ros2-fusion-engine-driver.git version: main + src/external/sensors/gps/pointonenav/ntrip_client: + type: git + url: https://github.com/LORD-MicroStrain/ntrip_client.git + version: ros2 + diff --git a/scripts/pon.sh b/scripts/pon.sh index faaac7c6..b2f23e6a 100755 --- a/scripts/pon.sh +++ b/scripts/pon.sh @@ -56,7 +56,7 @@ check_package() { fi } -packages=("ros-foxy-gps-msgs" "ros-foxy-nmea-msgs" "ros-foxy-mavros-msgs") +packages=("ros-foxy-gps-msgs" "ros-foxy-nmea-msgs" "ros-foxy-mavros-msgs", "ros-foxy-rtcm-msgs") all_installed=true for package in "${packages[@]}"; do diff --git a/tools/p1-host-tools b/tools/p1-host-tools deleted file mode 160000 index 63bb6bce..00000000 --- a/tools/p1-host-tools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 63bb6bcec28c61d2e7d734e39d406eae3d21d50f From 646a9e1aace85bc566492f339f7a6a1d1500290c Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Mon, 20 Jan 2025 22:43:21 +0000 Subject: [PATCH 4/8] [Configurations] Modified pon.repos Title --- Makefile | 11 +---------- repos/pon.repos | 4 ---- scripts/pon.sh | 25 +++++++++++++++---------- tools/p1-host-tools | 1 + 4 files changed, 17 insertions(+), 24 deletions(-) create mode 160000 tools/p1-host-tools diff --git a/Makefile b/Makefile index ab462249..eaf0c236 100644 --- a/Makefile +++ b/Makefile @@ -38,17 +38,8 @@ livox-driver: .PHONY: pointonenav pointonenav: - ./scripts/pon.sh vcs import < repos/pon.repos - cd src/external/sensors/gps/pointonenav/fusion-engine-driver - rosdep install -i --from-path ./ --rosdistro foxy -y - colcon build --packages-select fusion-engine-driver - source install/local_setup.bash - - cd .. - cd ntrip_client - colcon build --packages-select ntrip_client - source install/local_setup.bash + ./scripts/pon.sh .PHONY: racer racer: diff --git a/repos/pon.repos b/repos/pon.repos index dfdd6f33..f66f8abf 100644 --- a/repos/pon.repos +++ b/repos/pon.repos @@ -3,8 +3,4 @@ repositories: type: git url: https://github.com/Triton-AI/ros2-fusion-engine-driver.git version: main - src/external/sensors/gps/pointonenav/ntrip_client: - type: git - url: https://github.com/LORD-MicroStrain/ntrip_client.git - version: ros2 diff --git a/scripts/pon.sh b/scripts/pon.sh index b2f23e6a..65dc10c9 100755 --- a/scripts/pon.sh +++ b/scripts/pon.sh @@ -56,7 +56,7 @@ check_package() { fi } -packages=("ros-foxy-gps-msgs" "ros-foxy-nmea-msgs" "ros-foxy-mavros-msgs", "ros-foxy-rtcm-msgs") +packages=("ros-foxy-gps-msgs" "ros-foxy-nmea-msgs" "ros-foxy-mavros-msgs" "ros-foxy-rtcm-msgs") all_installed=true for package in "${packages[@]}"; do @@ -73,13 +73,10 @@ done # Configurations if $all_installed; then - echo "All required ROS Foxy packages are installed. Proceeding with FusionEngine configuration." - cd tools/ - if [ ! -d "p1-host-tools" ]; then - git clone https://github.com/PointOneNav/p1-host-tools.git - fi + echo "All required ROS2 Foxy packages are installed. Proceeding with FusionEngine and NTRIPClient installation." + cd src/external/sensors/gps/pointonenav/ cd p1-host-tools - python3 -m venv p1_tools + python3 -m venv p1_tools_venv source p1_tools/bin/activate pip3 install -r requirements.txt python3 bin/config_tool.py apply uart2_message_rate fe ROSPoseMessage 100ms @@ -87,9 +84,17 @@ if $all_installed; then python3 bin/config_tool.py apply uart2_message_rate fe ROSIMUMessage 100ms python3 bin/config_tool.py save deactivate - cd ../.. + + cd ../fusion-engine-driver + rosdep install -i --from-path ./ --rosdistro foxy -y + colcon build --packages-select fusion-engine-driver + source install/local_setup.bash + + cd ../ntrip_client + colcon build --packages-select ntrip_client + source install/local_setup.bash - echo "FusionEngine device configured and tools installed successfully." + echo "FusionEngine and NTRIPClient configured and available as ROS2 packages." else - echo "Some required ROS Foxy packages are missing. Please install them before configuring the FusionEngine device." + echo "Some required ROS2 Foxy packages are missing. Please install them before proceeding" fi diff --git a/tools/p1-host-tools b/tools/p1-host-tools new file mode 160000 index 00000000..63bb6bce --- /dev/null +++ b/tools/p1-host-tools @@ -0,0 +1 @@ +Subproject commit 63bb6bcec28c61d2e7d734e39d406eae3d21d50f From 53107d33369dea433ec364463dc4fe774a45ad2c Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Wed, 22 Jan 2025 13:31:26 -0800 Subject: [PATCH 5/8] [PointOneNav] Restructured makefile to be more readable. Title. --- repos/pon.repos | 8 ++++++++ scripts/pon.sh | 18 +++++++++--------- tools/p1-host-tools | 1 - 3 files changed, 17 insertions(+), 10 deletions(-) delete mode 160000 tools/p1-host-tools diff --git a/repos/pon.repos b/repos/pon.repos index f66f8abf..589bd205 100644 --- a/repos/pon.repos +++ b/repos/pon.repos @@ -3,4 +3,12 @@ repositories: type: git url: https://github.com/Triton-AI/ros2-fusion-engine-driver.git version: main + src/external/sensors/gps/pointonenav/ntrip_client: + type: git + url: https://github.com/LORD-MicroStrain/ntrip_client + version: ros2 + src/external/sensors/gps/pointonenav/p1-host-tools: + type: git + url: https://github.com/PointOneNav/p1-host-tools.git + version: main diff --git a/scripts/pon.sh b/scripts/pon.sh index 65dc10c9..73455154 100755 --- a/scripts/pon.sh +++ b/scripts/pon.sh @@ -71,26 +71,26 @@ for package in "${packages[@]}"; do fi done +POINTONENAV=/home/jetson/projects/robocar/src/external/sensors/gps/pointonenav # Configurations if $all_installed; then echo "All required ROS2 Foxy packages are installed. Proceeding with FusionEngine and NTRIPClient installation." - cd src/external/sensors/gps/pointonenav/ - cd p1-host-tools + cd $POINTONENAV/p1-host-tools/ python3 -m venv p1_tools_venv - source p1_tools/bin/activate + source p1_tools_venv/bin/activate pip3 install -r requirements.txt - python3 bin/config_tool.py apply uart2_message_rate fe ROSPoseMessage 100ms - python3 bin/config_tool.py apply uart2_message_rate fe ROSGPSFixMessage 100ms - python3 bin/config_tool.py apply uart2_message_rate fe ROSIMUMessage 100ms - python3 bin/config_tool.py save + bin/config_tool.py apply uart2_message_rate fe ROSPoseMessage 100ms + bin/config_tool.py apply uart2_message_rate fe ROSGPSFixMessage 100ms + bin/config_tool.py apply uart2_message_rate fe ROSIMUMessage 100ms + bin/config_tool.py save deactivate - cd ../fusion-engine-driver + cd $POINTONENAV/fusion-engine-driver/ rosdep install -i --from-path ./ --rosdistro foxy -y colcon build --packages-select fusion-engine-driver source install/local_setup.bash - cd ../ntrip_client + cd $POINTONENAV/ntrip_client/ colcon build --packages-select ntrip_client source install/local_setup.bash diff --git a/tools/p1-host-tools b/tools/p1-host-tools deleted file mode 160000 index 63bb6bce..00000000 --- a/tools/p1-host-tools +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 63bb6bcec28c61d2e7d734e39d406eae3d21d50f From 697a997ae8167406185c139e96065265b7b11b44 Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Sun, 9 Feb 2025 14:50:41 -0800 Subject: [PATCH 6/8] [PointOneNav] Integration of PointOneNav Switched to p1_tool that Alexander created --- repos/pon.repos | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/pon.repos b/repos/pon.repos index 589bd205..1d54770d 100644 --- a/repos/pon.repos +++ b/repos/pon.repos @@ -7,8 +7,8 @@ repositories: type: git url: https://github.com/LORD-MicroStrain/ntrip_client version: ros2 - src/external/sensors/gps/pointonenav/p1-host-tools: + src/external/sensors/gps/pointonenav/quectel: type: git - url: https://github.com/PointOneNav/p1-host-tools.git + url: https://github.com/UCSD-ECEMAE-148/quectel.git version: main From 653ea0aef568f243cd9f61b494f0f6c4b7844066 Mon Sep 17 00:00:00 2001 From: kevshin2002 Date: Sun, 9 Feb 2025 14:58:23 -0800 Subject: [PATCH 7/8] [Dockerfile] PointOneNav Support in Dockerfile Arm Title --- .docker_utils/Dockerfile.f1tenth_arm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.docker_utils/Dockerfile.f1tenth_arm b/.docker_utils/Dockerfile.f1tenth_arm index bbcaf844..9081867a 100644 --- a/.docker_utils/Dockerfile.f1tenth_arm +++ b/.docker_utils/Dockerfile.f1tenth_arm @@ -424,6 +424,10 @@ RUN source source_ros2.sh && \ RUN source source_ros2.sh && \ make livox-driver +########## Build fusion-engine-driver, ntrip_client, and p1_tools for PointOneNav GPS ######### +RUN source source_ros2.sh && \ + make pointonenav + ########### ADD CUSTOM FUNCTIONS ########### WORKDIR /home/scripts/ COPY scripts/bashrc.sh ./bashrc.sh @@ -432,4 +436,4 @@ RUN ["/bin/bash", "-c", "echo '. /home/scripts/bashrc.sh' >> /root/.bashrc"] WORKDIR $WORKSPACE RUN echo export WORKSPACE=$WORKSPACE >> /root/.bashrc # RUN echo 'export LD_PRELOAD=/usr/local/lib/python3.8/dist-packages/sklearn/__check_build/../../scikit_learn.libs/libgomp-d22c30c5.so.1.0.0' >> ~/.bashrc -ENTRYPOINT ["/bin/bash"] \ No newline at end of file +ENTRYPOINT ["/bin/bash"] From d2d8f346666301b2f76aa461e6cf9a2e0ed4793e Mon Sep 17 00:00:00 2001 From: WinstonHChou Date: Sun, 9 Feb 2025 16:42:52 -0800 Subject: [PATCH 8/8] [README] Dockerfile for PointOneNav Documentation For winston to integrate dependencies for PointOneNav Dockerfile --- .docker_utils/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .docker_utils/README.md diff --git a/.docker_utils/README.md b/.docker_utils/README.md new file mode 100644 index 00000000..87c7d18b --- /dev/null +++ b/.docker_utils/README.md @@ -0,0 +1,4 @@ +I added at the very bottom right after the LIVOX scripts, the scripts necessary for PointOneNav + +On one terminal, ros2 launch ntrip_client ntrip_client_launch.py host:=polaris.pointonenav.com port:=2101 mountpoint:=POLARIS ntrip_version:=v2 authenticate:=true username:=gbUv1nO2 password:=zZLxzLpJ +On another terminal, ros2 run fusion-engine-driver fusion_engine_ros_driver --ros-args -p connection_type:=tty -p tty_port:=/dev/ttyUSB1