This script read the can messages from the radar sensor and display the objects on a plot.
Features
- 10Hz update rate (ajustable)
- Object filter options
- Sensor field of view
- different views possible
- simple to modify
Limits
- Works with radar ID is set to ID 0
- Display objects, not cluster
Read the docs
Premium Long Range Radar at 77Ghz
- Range from 170 up 250m
- -400 to 200kph relativ speed detection
- CAN Bus interface at 500kb
- can used in
- European Union
- USA
- Canada
- Russia
- South Korea
- Australia
- Japan and further countries
- made for instustrie and automitive applications
- Sensor works from 9-32V DC
And is easy to integrate. Just 4 Wires are needed to bring the sensor to live.
- Power + direct from battery
- GND
- CAN-H
- CAN-L
Install needed python libs
pip install can cantools matplotlib
Setup the CAN connection or replay log data.
I used BUSMASTER to log and replay CAN data and a Vector CAN interface. Other CAN interface will also work. Just change the CAN config.
The 408-21 needs the following CAN MSG IDs:
MsgId = MsgId + SensorId * 10 0x200 with SensorId 0 = 0x200 0x200 with SensorId 1 = 0x210
- 0x008 - Relay control
- 0x20x - Config & status
- 0x30x - Speed & Yaw input
- 0x40x - Collision detection config and status
- 0x60x - Cluster & obj data
- 0x700 - Version ID
-> for details look at datasheet or DBC
-> CAN Ids overlaps with the Engine CAN - separate CAN lines!
Optional inputs -> see docu for more details
- 0x300 Speed in m/s
- 0x301 Yaw rate in deg/s
The script display the radar objects on a plot with 10Hz.
lang distance viewClose range view with hidden (filtered objects)
set radar config
0x200 Radar config
| Siganl | Config |
|---|---|
| MaxDistance [m] | 250 |
| SensorID | 0 |
| OutputType | 1 (send objects) |
| RadarPower | 0 (standard) |
| CtrlRelay | 0 (inactive) 1? |
| SendQuality | 0 (inactive) 1? |
| SendExtInfo | 0 (inactive) 1? |
| SortIndex | 1 (by range) |
| StoreInNVM | 1 (active) |
| RCS_Threshold | 0 (standard) |
The radar needs a speed and yaw input. This will do the "can_relay" script. It reads speed and yaw from the vehicle CAN. Do some calc km/h->m/s and send it to the radar CAN.



