ROS 2 support for integrating a V2X stack into the ROS environment.
The stack consists of three main components:
- UDP Handler (
udp_dispatcher
): Communicates via UDP with the V2X device and converts received packets into ROS topics. - BTP Service (
btp_data_service
): Extracts the BTP header and payload, then publishes the information to the/btp_data
ROS topic. - V2X Services: Each service listens to the
/btp_data
topic, evaluates the port (e.g., CA Service uses port 2001), and converts serialized data into ROS messages and vice versa.
This setup was implemented and tested under the following conditions:
- Operating System: Ubuntu 24.04.2
- ROS 2 Distribution: Jazzy
(To be added, if there are specific ROS 2 or system dependencies)
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update && sudo apt install ros-dev-tools
sudo apt update
sudo apt upgrade
sudo apt install ros-jazzy-desktop
sudo apt install ros-jazzy-ros-base
mkdir -p ~/colcon_ws/src
cd ~/colcon_ws/src
git clone <REPO_URL>
cd ~/colcon_ws
colcon build
source ~/colcon_ws/install/setup.bash
To start the BTP data service, run the following command:
ros2 launch v2x_stack services_launch.py
To launch the V2X services, use:
ros2 launch v2x_stack services_launch.py
To add new services to the launch file, modify the configuration file:
/config/services_params.yml