Dear Community:
The Openpilot Community needs your help to continue to keep opc.ai's lights on and support the path to Workbench v0.2. With only a one person crew and without commercial funding it's not always financially feasible to fund these services out of pocket. Please consider becoming a Patreon supporter of the Openpilot Community project and receive exclusive perks and benefits!
Become a patreon Learn more Maybe Later

Openpilot Toyota Community
Sep 09, 2018·3 min read

2018 Camry Hybrid Longitudinal Control with openpilot

Image
For the purposes of this document, CAN busses will be labeled 0, 1, and 2 universally.

The 2018 Camry Hybrid incorporates some functions of the DSU in the radar unit. CAN0 of these radars is also directly connected to the PCM since pre-collision and ACC are directly handled by the Continental unit. This makes long control with openpilot difficult, since message 343 (the command to accelerate / decelerate ACC) is on CAN0.

To remedy this, I built a cable that would detach CAN0 of the radar from the car, and attach it to CAN2 of the Panda. With modified Panda firmware, we can forward all messages from CAN2 to CAN0 while preventing some (343, 2e4, and 412) from making it to CAN0. This will allow OP to send its own accel, lkas, and hud messages to the car, while allowing the car to “think” the radar and FRC are still plugged in.

https://lh5.googleusercontent.com/Z21DNU97r_cEg3zvzhGTERkC30ZYqU_aNGyKfk3J_t362VwmFgayz5KyendI0Dt_zjbYWotWfR8CTv2_VrHe8CfK5Dho4TzUOFl_a-7i5HHRiAcy4f7uhd5tabc8ZgMNafybNiIl

For now, I am using the mock radar in radard.py just to prove that control can be achieved. With a proper ADAS DBC outlining the tracks from the radar, better control of the car will be possible.

The Giraffe

My giraffe has a few modifications that are needed to make this work.

https://lh6.googleusercontent.com/Mqq3AlQsX3Fu3uBIUZc-gbNHSduzSjDdc56GpIr7qKjlIpTp6p3i6eTeQztivERCk3Sg9MxXxjFy3LV3OBfpIhFkhJD1qoPvRd1ob5qASJSanYnnBdQUQgyDftiKBAA1ILYh6ud0

To start, a 120 ohm resistor is placed between pins 12 and 13 of the OBD2 connector. These go to CAN2 on the panda and need to be terminated in order to resolve errors on the car’s dash.

Additionally, another RJ45 is wired to the giraffe to connect to CAN2 externally. For this, I use the blue twisted pair (blue on pin 12 and bluewhite on 13). The green pair is used for CAN1 (green on pin 3 and greenwhite on pin 11). The orange pair is used for 12V power to the radar (orange for +12V and orangewhite for ground).

Please excuse my crusty soldering..

The wiring at the RJ45 connector is as follows:

PIN1 OrangeWhite GND
PIN2 Orange +12V
PIN3 GreenWhite CAN1L
PIN4 Blue CAN2H
PIN5 BlueWhite CAN2L
PIN6 Green CAN1H

https://lh6.googleusercontent.com/rX0EeB9kW4oc-bRSDWk1_7yb7evR2d8dJqfv3Q8PwL1OybUabb8tg3nDOWTJymiDqH4KjD-wMXb4zmAELwODBE-pMcjjiYT6jIM2SVG5rhxWAnLZfdcvfK9pMFQmbOqkoLXUQObk

The Radar Cable

The cable I made connects the radar to the giraffe via Cat6e cabling, using the B standard at the RJ45 side (Ow-O-Gw-B-Bw-G-BRw-B). The other connector is a Sumitomo 8-way TS 025 Connector (Toyota PN 90980-12520) and is available to purchase here:

https://www.bmotorsports.com/shop/product_info.php/products_id/3332

The pinout for the Cat6e to Radar connector is as follows:

PIN1 OrangeWhite GND
PIN2 BlueWhite CAN0L
PIN3 Blue CAN0H
PIN5 Green CAN1H
PIN6 GreenWhite CAN1L
PIN8 Orange +12V