This is a ROS 2 driver for the Continental ARS_548 Radar4d created by the Service Robotics Lab from the Pablo de Olavide University (Spain). For the ROS driver, please refer to the "noetic" branch of this repository.
This driver is used to connect with the ARS_548_RDI radar and get all of the data it sends.
First of all, this driver connects with the radar via Ethernet.
Then it receives all the data the radar sends, translates it, and after that, it sends it in the structure of custom messages for the user to receive and interact with them.
This driver also creates two Point Clouds and a pose array with some of the information gathered and shows it using RViz 2.
This project consists of two ROS2 packages: ars548_driver and ars548_messages. Below you can find a brief description of each package.
-
This package contains all of the code used to obtain the data from the radar, decode it and send it for the user to interact with it.
-
This file contains the class that we will use to connect with the radar, obtain all of the data it sends to us and publish it for later use.
Firstly it creates the connection with the radar.
Then, it creates the different publishers that will send the data.
After that, it enters an infinite loop in wich it filters the data the sensor is sending between three types of message (Status, Object and Detection), translates the data of each of the fields and stores them in an specific Structure for each message and finally it publishes the entire Structure.
-
This file launches the driver class to execute the project so we can see how it works.
-
This file contains the class that will filter the lists of objects following the condition given by the user and then fills and sends a new Pointcloud with the data.
-
This file contains the class that will be used to test the filtering interface.
-
This file launches the filter example class to execute it and see how it works.
-
This file allows the user to modify its default parameters so it can be adapted to their project.
-
In this file we save the different structures we will use to store and send the translated data for later use.
-
This file contains all the configuration for rviz 2 to show the point clouds sent from this driver.
-
This two files configure an define all dependencies it needs to execute the project, including libraries, packages, etc.
They also define the files and executables this project creates when compiled.
-
This file creates a VLan connection to the default radar direction when executed.
-
This file allows the user to change the default radar maximum detection distance when executed. (It is better to execute this file when the radar is starting)
-
This is the file we will be executing using the following command:
ros2 launch ars548_driver ars548_launch.xml
Inside this file we create three nodes that will be executed.
-
The first node is the one that executes the code created in this project.
This node has three parameters that we can change in case one of them does not correspond to the actual radar value.
This parameters are:- The radar IP.
- The connection Port.
- The Frame ID that we will use to send the messages.
-
The second node opens an RViz 2 window to visualize the data received from the radar.
This node uses the RadarVisualization.rviz file to configure the window. -
The third and last node creates an static-transform-publisher to transform the data obtained from the radar to the data shown in RViz 2 (You can also change the arguments so it adapts to your project).
-
-
This is the file we will be executing using the following command:
ros2 launch ars548_driver filter_launch.xml
Inside this file we create four nodes that will be executed.
- The first node is the one that executes the driver created in this project. (The parameters are the same as the ones used in the ars548_launch.xml file)
- The second node is the one that executes the filter created in this project.
This node has two parameters that we can change.
This parameters are:- The minimum velocity we want to use to filter the data.
- The Frame ID that we will use to send the filter messages.
- The third node opens an RViz 2 window to visualize the data received from the radar.
This node uses the filter.rviz file to configure the window. - The third and last node creates an static-transform-publisher to transform the data obtained from the radar to the data shown in RViz 2 (You can also change the arguments so it adapts to your project).
-
-
This package contains all of the structures for the custom messages sent to the user.
- This file has the data structure for the object message.
- This file has the data structure for the detection message.
- This file has the data structure for the status message.
- This file has the data structure for the list of object messages. It has an array of messages from the Object.msg file
- This file has the data structure for the list of detection messages. It has an array of messages from the Detection.msg file.
For the code to Work properly you must first do these steps.
- Have ROS2, RViz 2, Tf2 and colcon installed.
- Configure the Network connection with the radar.
In this file, we are working with the ROS 2 Humble distribution on Ubuntu 22.04, so all of the ROS2 commands that we will be using are from this particular distribution. In case you use another ROS 2 distribution, this commands may change a bit.
-
To install ROS 2 you can follow this tutorial: https://docs.ros.org/en/humble/Installation.html
-
This tool will be used to show the pointClouds that this driver will create to test it.
To install RVIZ 2, run this command on your terminal:sudo apt-get install ros-humble-rviz2
-
To install TF 2 and all of its tools, run the next command on your terminal:
sudo apt-get install ros-humble-tf2-ros
-
To install tclap, run the next command on your terminal:
sudo apt-get install libtclap-dev
-
This tool is used to build ROS packages.
To install Colcon, execute the following command on your computer:sudo apt install python3-colcon-common-extensions
-
This radar sends data using Ethernet Connection.
For being able to communicate with the radar and receive the data, you must first configure your network.
You can configure your network in two ways:-
To do this you must follow the next steps:
-
Open your terminal.
-
Execute
nm-connection-editor
. -
Click on the option
Add a new connection
it is represented by a+
. -
On the new Window titled Choose a connection Type select
VLAN
and click onCreate
. ( CAUTION: Do not create a Vlan connection inside another Vlan connection) -
After selecting
Create
, a new window titled for editting this connection will appear.
In this window, you can change the default name into any other name. -
In the field Parent interface, inside the
VLAN
tab you must select your phisical interface. -
In the field VLAN id, select a valid ID for tour connection.
-
On the
IPv4 Settings
tab, in the Method field, select: Manual -
On the
Addresses
field, click on Add and fill the new address with the next data:Address
field: 10.13.1.166Netmask
field: 24Gateway
field: 10.13.1.1
-
Click on the button labeled
Save
.
With all this, you have configured your connection with the radar.
-
-
This file automatically creates the connection with the radar using it's default values.
To execute this file you must go to the folder containing it and execute the following command:./configurer.sh
Once you execute the command, the program will ask you if you want to create the vlan connection and after that it will ask you to introduce the parent interface you want to use to create the connection.(It must be your physical interface, otherwise it won't work).
After all that it will create the connection with the radar using the default values for the network.
If you configure it manually, you will have to make this process just once. If you do it executing the Configurer.sh file, you will have to do it everytime you turn on your computer.
-
Once you have installed ROS2, RViz 2, Tf 2, colcon, configured your network and downloaded the project, you can execute this driver.
For executing the driver you should go to the directory in wich you have downloaded this project and execute the next commands:
> colcon build --packages-select ars548_driver ars548_messages
> source install/setup.bash
> ros2 launch ars548_driver ars548_launch.xml
The first command is used to build the project.
The second command is used to source the project.
The last command is used to launch the project and see the results in Rviz 2.
In case you want to execute this driver but you dont have ROS2 humble installed, you can use this method.
First you need to build the Dockerfile that is inside the docker folder. To do this, after downloading the project, you should go to the docker directory and execute the next command:
> docker build -t ars548_rdi .
After that, you can run this command to run the docker:
> docker run --rm -it --network host --ipc=host --pid=host ars548rdi
To check the results you can use rviz and open the provided configuration file at the rviz folder.
If you want to see the initial parameters of the radar you can execute the next command:
> ros2 run ars548_driver radar_setup.cpp
which lets you see the default parameters of the radar. In case you want to change any of those parameters, you can execute the same command adding the arguments that are shown inside the file. For example:
>ros2 run ars548_driver radar_setup.cpp -D 99
Changes the maximum detection distance of the radar to the value 99.
To change this same parameter, the user can also execute the setup_max_dist.sh file. (For it to work properly, the user may need to restart the radar)
>./setup_max_dist.sh
The parameter list can be obtained by executing the next command:
>ros2 run ars548_driver radar_setup.cpp -h