blog posts. very new. i normally wouldn’t do this but hey, there’s a first time for everything. i still refuse to use the shift key.
the car: 2017 – 2019 toyota corolla
by now i’m sure the hype surrounding semi-autonomous cars has waned, and everyone is aware of the options on the market today (especially tesla.) as of this post, the cheapest “self-driving” car you can purchase readily is the tesla model 3 with the $5,000 autopilot add-on package, which ends up somewhere in the ballpark of $47 – $50k out of pocket.
as is the case with most things, we can get a better deal with a little effort and the right tools.
enter the toyota corolla sedan. it’s quite affordable new, with the base model sedan starting at around $18k. even better if purchased used, i’ve seen prices below the $10k mark with high mileage. but this humble commuter car harbors capabilities far beyond its low price tag and decent fuel economy.
for model year 2017, toyota made the decision to outfit almost all of its lineup with toyota safety sense, which comes in two varieties. the “c” package is the entry-level which includes lane departure alert and pre-collision detection, while the “p” variety offers optional lane keeping assist with steering assist, adaptive cruise control, automatic braking, and many other features. (to check which toyotas offer tss-p with steering assist, checkout the chart below.)
for our purposes, this means the car’s steering and acceleration are controllable over the can bus. so how can we exploit these features to gain control of the car?
the holy comma trinity of car hacking: the Eon, the Panda, and the Giraffe
fun names right?
now we get into the actual build. we need a computer capable of reading lane lines and making decisions about how the car should move. for this we can use the comma.ai Eon, a “dashcam” that happens to run open source software that can control the toyota corolla. the next item required is the Panda, which provides an interface by which the Eon can communicate with the car. to connect the Eon and Panda to the car, you’ll need a Giraffe, which has all the necessary connectors in one convenient package. all of these can be purchased from here:
now just install openpilot on the Eon, here’s a video to help you out:
after that, you’ll want to flash your Panda by plugging it into the car’s obd2 (diagnostics) port below the steering wheel, then plugging the Eon into it. after a few seconds the Panda’s led should start flashing green. once it goes back to a slowly fading red led, it’s done! go ahead and plug it into the giraffe. now is also a good time to go into setting son the Eon and enable driver monitoring, as well as “use map to control vehicle speed.”
setup inside the car
now it’s time to install all this into the car and go for our maiden voyage, so hop back into the car and remove the plastic camera cover located above the rear view mirror. this should come out by first removing the smaller plastic trim, then pushing the cover forward towards the front of the car to unclip and remove it. go ahead and unplug the wiring harness leading into the metal front camera ecu by depressing the tab on the connector and pulling away from the camera. now plug in the giraffe panda combo into the harness as well as into the camera. you should hear a click once the connectors are seated correctly.
finally, mount the Eon to the windshield using the included go-pro mount. the sticky mount should be mounted directly underneath the stock camera in the middle of the windshield. make sure the Eon is facing perfectly forward when mounted and that there is no rotation. plug in the usb cable to the Eon and Giraffe and you’re ready to go!
now is also a good time to unplug the dsu (driving support ecu) or install a pedal if you have one. here are some videos explaining both.
now just start the car and you should be greeter with a calibration screen, meaning that you’re ready to go! if you get a cruise fault on the first start, simply turn the car off, wait for the lights and eon screen to turn off, then start the car again and it should clear the error. drive above 16 mph to calibrate and when that’s done you may engage openpilot by engaging your cruise control!
using openpilot / limitations
- openpilot (and autopilot) are not great at stopping for already stopped cars when traveling at high speeds, so always pay attention while using openpilot
- it’s best to disconnect the Eon and bring it inside to charge and upload drives nightly
- openpilot can detect the speed limit of the road you are on and limit your speed to the limit + an offset. the offset is configurable in settings
- gas and brake will both disengage openpilot
- openpilot is free, mit licensed software. by using it you accept liability for anything that might happen while using the software. so again, always pay attention and be ready to take control!