Skip to content

Enhance openpilot longitudinal control with an external radar add-on.

License

Notifications You must be signed in to change notification settings

eFiniLan/openpilot-ext-radar-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openpilot External Radar Addon

Overview

This project allows an external radar to integrate with OpenPilot, improving its perception capabilities.

Why This Project?

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 access external radar interface.
  • Adjust the distance from the vehicle front to the radar if mounting in front of the vehicle.

Prerequisites

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 running openpilot version 0.9.8 or above.

Bill of Materials (BOM)

  1. Radar, ~$236 USD
  2. GoPro Accessories:
  3. 4 Pins Phoenix Type Connector, ~$2.00 USD

Installation

Hardware Build

Toyota Harness Build: USE CAN1 H/L, IGN for VCC, GND for Ground

image

  • for other harness, please refer to: Harness Schema
  • You might need to connect VCC and GND to the OBD2 port if there is excessive power draw.

Radar Mount Build

91f0ffd1e2a280c6983ec02e0e43d259

Mounting Example

cf6ec2886d137ccc931ce7a3d0f34eae

Wiring Diagram

Connect the radar and openpilot to the OBD2 cable as follows:

Harness (Car Side) Radar Cable
CAN1L CAN L (green)
CAN1H CAN H (yellow)
GND Ground (black)
IGN 12V (red)

Software Setup (tested on 0.9.8)

opendbc/dbc/u_radar.dbc

Upload to /data/openpilot/opendbc/dbc/u_radar.dbc

opendbc/dbc/u_radar_config.py

  1. Upload to /data/openpilot/opendbc/dbc/u_radar_config.py
  2. 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 

opendbc/car/radar_interface.py

Upload to /data/openpilot/opendbc/car/radar_interface.py

Apply card.py change

  1. upload panda.diff to /data
  2. Apply changes:
cd /data/openpilot/ && git apply ../card.diff

Notes

  • Mounting Bracket: The provided mounting bracket is designed as a temporary solution to allow easy adjustment and removal of the radar unit.
  • CAN Message Conflict: This proof of concept may trigger errors due to conflicts. A CAN filter or gateway can resolve them.
  • Power Overdrawn: The radar requires more than 0.2A; connect to OBD2 if the current source can't supply enough power.

Contributing

Contributions are welcome! Please submit issues or pull requests to improve functionality.

License

This project is licensed under MIT Non-Commercial License.

See the LICENSE file for complete details.

Acknowledgments

Thanks to the openpilot community for ongoing support and development.