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

Comma 3x - Brand Porting | BYD ATTO3 | Comma3x Openpilot | Part 1 - Harness

 Comma 3x is an excellent hardware to get an ADAS that’s close to FSD for everyone. The hardware and software are developed separately. This is a detailed documentation of every step in porting the BYD Atto3 to work with Comma 3x. The official documentation was a little scattered and outdated. Hence the need for this documentation

Date: 1/September/2024 | Comma Release 0.9.8 | Hardware: Comma 3x

I purchased a Comma 3x with a Developer Harness for this project. This section of the tutorial deals with the technique to make the harness suitable for BYD Atto 3 (RHD) as sold in India.

As per the Comma official documentation. I reviewed the Comma Con 2023 video by Jason

How to Port a Car | Community Speaker: Jason | COMMA_CON 2023

First step was to get the Repair Manuals. Found the manuals in an issue post in Comma Openpilot Github Repo. Keeping a record of the links for anyone.

cuter-doc0 commented on May 28

Atto 3 RHD and LHD service, engineering, workshop, maintenance, metal bodyshop, paint shop, electrical, diagnostics manuals and documentation.This is a web based manual – to use, extract zip and open index.html765 ATTO3-LHD-FULLPACK.zip (1.13 GB)
https://workupload.com/file/43LMbSrbKfJ715 ATT03-RHD-FULLPACK.zip (1.12 GB)
https://workupload.com/file/rJ8HpQFL6MGPDF files can be grabbed from here too: https://t.me/atto_3/1/17553

Many of the images used in the following section are from this official repair manual

First step in installing Comma is to find the OBU port. On BYD Atto 3, this is located as shown.

Remove the LDW (Lane Departure Warning) Cover holding the ADAS Camera. It can be pried open using a soft plastic pry tool.

The ADAS camera in BYD is from Veoneer and the model is MVS4. Mono Vision System 4.

The wiring diagram of the MVS4 – Multifunction Camera is as below

The connector used in BYD is TE 1-1355211-2

Mating Part is TE 1-1670459-2

The developer Harness that shipped for me was a V1 harness. There is a new V3 harness in the works. We will have to use the V1 harness. Column 2 below is the correct wiring needed

BYD Connector PinoutComma V1 Connector Pinout (In BYD)Comma 3x Connector Pinout (18pin ) V3Ixcess Connector (26pin) V1 Connector
1 – GND1,261,171,26
2 – IGN12,162,1412,14
3 – Private CAN_H18,84,1618,8
4 – Chassis Network CAN_H22(Camera),4(Car),8,922,4
7 – Private CAN_L20,106,1820,10
8 – Chassis Network CAN_L24(camera), 6(Car)7,1124,6

Active Developer and Discord user iXcess from Malaysia made a connector using the above parts and shipped it to me. As received connector pinout is as shown in Column 4in the table above. I had to change the wires for IGN in order to get the cable working properly.

With these changes; the connection was successful and Comma3x finally began to be recognized and recorded routes albeit in dashboard mode.

That’s it. Now the hardware is connected and will now set the stage for the next part which is the software include the porting process.

Category: 0 comments

Contributors