Comma 3x Brand Porting | BYD ATTO3 | Comma3x Openpilot | Part 2: Setup Dev Environment

 With regard to the software, @ixcess has maintained support through a fork KommuAi/bukapilot. The BYD related code is at https://github.com/kommuai/bukapilot/tree/f549c012878f1af067f4a4e351cfa5668a492bd3/selfdrive/car/byd

This fork is based on the v0.8.13 release. The master branch of Openpilot as of today is 0.9.8
There are significant changes in the code structure and a large part of documentation is different. The Openpilot codebase follows a Continuous Integration model. It’s great for supported cars. The detailed documentation for each change was harder to find. The referenced Car Ports from 2018 for Toyota were only good to get an overview of the process and not exactly

Major changes between 0.8.13 and 0.9.7 Codes

  1. The code controlling cars has moved from openpilot/selfdrive/car to a new repository called opendbc. The repo is symlinked so that things don’t break. OpenDBC has been forked out as a separate project. The exact usage and API calls are still work in progress as of 27 September 2024.
  2. The Official Development environment for OpenPilot is Ubuntu 24.04 . In fact, your Comma device is running this Ubuntu Linux.

I prefer creating a virtual machine to have all Development Environment in one place. So have used UTM to create a Virtual Machine on my ARM based machine. Install Ubuntu 24.04 ARM on UTM

Once Ubuntu is up and running, the official documentation will help install all the dependencies for running Openpilot on the Ubuntu. Reproducing the steps here for reference. Type these in the terminal of your new Ubuntu installation. Note that the 3rd step in the Tutorial of official documentation won’t work as the UI has changed and you can’t do a grep to find white or blue.

1. Setup your development environment

Run this to clone openpilot and install all the dependencies:

1
bash <(curl -fsSL openpilot.comma.ai)

Navigate to openpilot folder & activate a Python virtual environment

1
2
cd openpilot
source .venv/bin/activate

Then, compile openpilot:

1
scons -j8

2. Run replay

We’ll run the replay tool with the demo route to get data streaming for testing our UI changes.

1
2
3
4
5
# in terminal 1
tools/replay/replay --demo
 
# in terminal 2
selfdrive/ui/ui

The openpilot UI should launch and show a replay of the demo route.

If you have your own comma device, you can replace --demo with one of your own routes from comma connect.

Prior to connecting to your own comma device. You will have to authenticate. By default it will authenticate with Google. To change to github or apple use

1
2
3
4
5
#For Apple
tools/lib/auth.py apple
 
#For Github
tools/lib/auth.py github

To login to the device; you need to use SSH. The process to setup SSH is well documented.

To use Cabana, the command is

1
tools/car_porting/cabana

With the SSH completed, everything you need to setup the development Environment is completed.

Now all connections are set. Now to begin Porting. After reading code and watching videos; there are 3 areas to look into

  1. opendbc_repo/opendbc/car
  2. openpilot/selfdrive/car/car_specific.py
  3. Panda Update

This post has helped you setup the development environment. And get to the stage where you can beign the process of software porting. Will deal with the code updates to get openpilot to recognize the BYD Atto 3.

Category: 0 comments

No comments:

Contributors