This project enables sensor fusion in openpilot by integrating an external radar. The radar is mounted on the windshield and connected to the vehicle's OBD2 port for both power and signal transmission. With openpilot also connected to the OBD2 port, it can read radar data, enhancing its perception capabilities.
Some vehicles with openpilot installed can only use Vision-Only Adaptive Cruise Control (VOACC). By adding an external radar to the car, sensor fusion enables more accurate lead car speed detection and distance measurement, significantly improving safety and performance.
The guide and code are designed for Toyota vehicles. If using a different vehicle, you will need:
- Modify the code to use the correct CAN channel.
- Adjust the distance from the vehicle front to the radar if mounting in front of the vehicle.
- Ensure CAN message compatibility to avoid conflicts with the vehicle's existing communication.
Before installing this addon, ensure you have the following:
- A car that already has openpilot installed.
- The car must support openpilot longitudinal control.
- The car does not have radar support. (e.g. Nissan, Volkswagen, Mazda, Subaru...)
- A comma 3 or 3X device with the OLD comma power (which supports sending and receiving CAN messages via the OBD2 port).
- A comma 3 or 3X running openpilot version 0.9.8 or above.
- Radar, ~$236 USD
- GoPro Accessories:
- Cell Phone Holder, ~$4.0 USD
- 1/4 inch Mount, ~$1.0 USD
- Short Screw, ~$1.2 USD
- Quick Release Buckle Mount, ~$1.0 USD
- Short Screw, ~$1.2 USD
- Flat Adhesive Mount, ~$0.99 USD
- Male OBD2 Cable w/ Open Pins, ~$3.00 USD
- 4 Pins Phoenix Type Connector, ~$2.00 USD
- Mount the Radar: Secure the radar unit onto the windshield.
- Connect to OBD2 Port: Use the provided adapter to link the radar’s signal and power to the OBD2 port.
Connect the radar and openpilot to the OBD2 cable as follows:
OBD2 Cable Pin | Radar Cable | openpilot Cable |
---|---|---|
Pin 14 | CAN L (green) | CAN L (green) |
Pin 6 | CAN H (yellow) | CAN H (yellow) |
Pin 5 | Ground (black) | Ground (black) |
Pin 16 | 12V (red) | 12V (red) |
Upload to /data/openpilot/opendbc/dbc/u_radar.dbc
- Upload to /data/openpilot/opendbc/dbc/u_radar_config.py
- Change radar settings:
# manually terminate openpilot
tmux a
press "<ctrl> + c" several times
# apply settings
cd /data/openpilot/opendbc/dbc/ && python u_radar_config.py
Upload to /data/openpilot/opendbc/car/radar_interface.py
- upload panda.diff to /data
- Apply changes:
cd /data/openpilot/panda && git apply ../../panda.diff
- upload panda.diff to /data
- Apply changes:
cd /data/openpilot/ && git apply ../card.diff
- Mounting Bracket: The provided mounting bracket is designed as a temporary solution to allow easy adjustment and removal of the radar unit.
- Power Management: Due to the nature of the OBD2 port, it will constantly provide power to the radar. To prevent battery drain, it is recommended to add a power switch to disconnect the radar when not in use.
Contributions are welcome! Please submit issues or pull requests to improve functionality.
This project is licensed under MIT Non-Commercial License.
See the LICENSE file for complete details.
Thanks to the openpilot community for ongoing support and development.