Motivation: to understand and visualize radar information using available ROS driver.
- ROS (full desktop version or with Rviz ready)
- Delphi ESR 2.5 ROS driver by AutonomousStuff
- ROS socketcan_bridge package
- CAN device + Radar or CAN logs.
Log CAN data (skip this if you are already familiar with CAN logging using can-utils)
On Linux system, I use can-utils a lot as CAN tools that are easily run through terminal.
- Install can-ultils (socketcan):
sudo apt-get install can-utils
- Connect Linux supported CAN device to PC. You can use something like a Kvaser USB. If you have an Nvidia Jetson TX2 or Xavier, you can enable CAN bus and run ROS directly with these modules.
- Setup CAN device to 500K bitrate to connect to Delphi ESR 2.5
sudo modprobe can
sudo modprobe can_raw
sudo ip link set can0 type can bitrate 5000000
sudo ip link set up can0
To check CAN is properly set up, check:
- When all devices are connected and running, raw CAN frames can be seen from terminal with:
- To log data:
candump -l can0
- Playback data with a can0 interface available on the network
canplayer -I your_saved_data.log
- Playback data which previously logged with can0 with a virtual can:
First, bring up a virtual can interface: https://elinux.org/Bringing_CAN_interface_up
canplayer vcan0=can0 -v -I your_saved_data.log
Install AutonomousStuff Delphi ESR Driver
Assume ROS is already installed on working machine. The ROS driver can be installed using the steps here
Here are the steps I took on my Ubuntu 18.04 running ROS Melodic
sudo apt update && sudo apt install apt-transport-https sudo sh -c 'echo "deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/autonomoustuff-public.list' sudo apt update sudo apt install ros-$ROS_DISTRO-delphi-esr
After installation, you can the launch sample file provided in this driver and checkout their list of topics
roslaunch delphi_esr delphi_esr.launch
rostopic list on another terminal. Info of the topics are also documented here.
To see more detail of the sample launch files, they are located here:
Install ROS socketcan_bridge
For the convenience of reading raw logged CAN frames, I find the socketcan_bridge is a good option because user can assign the CAN interface at launch file.
sudo apt get ros-$ROS_DISTRO-socketcan-bridge
Visualize data with Rviz
With all the pre-requisites complete, we are ready to read and visualize the parsed output of the Delphi ESR by AS ROS driver. I modified the sample launch file and created a rviz config for this in this repo.
Try out the visualization with the sample CAN frames.
git clone https://github.com/ancabilloni/ros-delphi-esr-visualization.git cd ros-delphi-esr-visualization # Bring up virtual can interface sudo ./setup_vcan.sh # Launch driver and rviz roslaunch master.launch use_socketcan:="true" socketcan_device:="vcan0"
Playback sample CAN data on a different terminal
cd ros-delphi-esr-visualization canplayer vcan0=can0 -v -I sample/sample1.log