Release 260111
This commit is contained in:
95
docs/how-to/connect-to-comma.md
Normal file
95
docs/how-to/connect-to-comma.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# connect to a comma 3/3X
|
||||
|
||||
A comma 3/3X is a normal [Linux](https://github.com/commaai/agnos-builder) computer that exposes [SSH](https://wiki.archlinux.org/title/Secure_Shell) and a [serial console](https://wiki.archlinux.org/title/Working_with_the_serial_console).
|
||||
|
||||
## Serial Console
|
||||
|
||||
On both the comma three and 3X, the serial console is accessible from the main OBD-C port.
|
||||
Connect the comma 3/3X to your computer with a normal USB C cable, or use a [comma serial](https://comma.ai/shop/comma-serial) for steady 12V power.
|
||||
|
||||
On the comma three, the serial console is exposed through a UART-to-USB chip, and `tools/scripts/serial.sh` can be used to connect.
|
||||
|
||||
On the comma 3X, the serial console is accessible through the [panda](https://github.com/commaai/panda) using the `panda/tests/som_debug.sh` script.
|
||||
|
||||
* Username: `comma`
|
||||
* Password: `comma`
|
||||
|
||||
## SSH
|
||||
|
||||
In order to SSH into your device, you'll need a GitHub account with SSH keys. See this [GitHub article](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh) for getting your account setup with SSH keys.
|
||||
|
||||
* Enable SSH in your device's settings
|
||||
* Enter your GitHub username in the device's settings
|
||||
* Connect to your device
|
||||
* Username: `comma`
|
||||
* Port: `22`
|
||||
|
||||
Here's an example command for connecting to your device using its tethered connection:<br />
|
||||
`ssh comma@192.168.43.1`
|
||||
|
||||
For doing development work on device, it's recommended to use [SSH agent forwarding](https://docs.github.com/en/developers/overview/using-ssh-agent-forwarding).
|
||||
|
||||
|
||||
## ADB
|
||||
|
||||
In order to use ADB on your device, you'll need to enable it in the device's settings.
|
||||
|
||||
* Enable ADB in your device's settings
|
||||
* Connect to your device
|
||||
* `adb shell` over USB
|
||||
* `adb connect` over WiFi
|
||||
* Here's an example command for connecting to your device using its tethered connection: `adb connect 192.168.43.1:5555`
|
||||
|
||||
> [!NOTE]
|
||||
> The default port for ADB is 5555 on the comma 3/3X.
|
||||
|
||||
For more info on ADB, see the [Android Debug Bridge (ADB) documentation](https://developer.android.com/tools/adb).
|
||||
|
||||
### Notes
|
||||
|
||||
The public keys are only fetched from your GitHub account once. In order to update your device's authorized keys, you'll need to re-enter your GitHub username.
|
||||
|
||||
The `id_rsa` key in this directory only works while your device is in the setup state with no software installed. After installation, that default key will be removed.
|
||||
|
||||
#### ssh.comma.ai proxy
|
||||
|
||||
With a [comma prime subscription](https://comma.ai/connect), you can SSH into your comma device from anywhere.
|
||||
|
||||
With the below SSH configuration, you can type `ssh comma-{dongleid}` to connect to your device through `ssh.comma.ai`.
|
||||
|
||||
```
|
||||
Host comma-*
|
||||
Port 22
|
||||
User comma
|
||||
IdentityFile ~/.ssh/my_github_key
|
||||
ProxyCommand ssh %h@ssh.comma.ai -W %h:%p
|
||||
|
||||
Host ssh.comma.ai
|
||||
Hostname ssh.comma.ai
|
||||
Port 22
|
||||
IdentityFile ~/.ssh/my_github_key
|
||||
```
|
||||
|
||||
### One-off connection
|
||||
|
||||
```
|
||||
ssh -i ~/.ssh/my_github_key -o ProxyCommand="ssh -i ~/.ssh/my_github_key -W %h:%p -p %p %h@ssh.comma.ai" comma@ffffffffffffffff
|
||||
```
|
||||
(Replace `ffffffffffffffff` with your dongle_id)
|
||||
|
||||
### ssh.comma.ai host key fingerprint
|
||||
|
||||
```
|
||||
Host key fingerprint is SHA256:X22GOmfjGb9J04IA2+egtdaJ7vW9Fbtmpz9/x8/W1X4
|
||||
+---[RSA 4096]----+
|
||||
| |
|
||||
| |
|
||||
| . |
|
||||
| + o |
|
||||
| S = + +..|
|
||||
| + @ = .=|
|
||||
| . B @ ++=|
|
||||
| o * B XE|
|
||||
| .o o OB/|
|
||||
+----[SHA256]-----+
|
||||
```
|
||||
14
docs/how-to/replay-a-drive.md
Normal file
14
docs/how-to/replay-a-drive.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Replay
|
||||
|
||||
Replaying is a critical tool for openpilot development and debugging.
|
||||
|
||||
## Replaying a route
|
||||
*Hardware required: none*
|
||||
|
||||
Just run `tools/replay/replay --demo`.
|
||||
|
||||
## Replaying CAN data
|
||||
*Hardware required: jungle and comma 3/3X*
|
||||
|
||||
1. Connect your PC to a jungle.
|
||||
2.
|
||||
98
docs/how-to/turn-the-speed-blue.md
Normal file
98
docs/how-to/turn-the-speed-blue.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# Turn the speed blue
|
||||
*A getting started guide for openpilot development*
|
||||
|
||||
In 30 minutes, we'll get an openpilot development environment setup on your computer and make some changes to openpilot's UI.
|
||||
|
||||
And if you have a comma 3/3X, we'll deploy the change to your device for testing.
|
||||
|
||||
## 1. Setup your development environment
|
||||
|
||||
Run this to clone openpilot and install all the dependencies:
|
||||
```bash
|
||||
bash <(curl -fsSL openpilot.comma.ai)
|
||||
```
|
||||
|
||||
Navigate to openpilot folder & activate a Python virtual environment
|
||||
```bash
|
||||
cd openpilot
|
||||
source .venv/bin/activate
|
||||
```
|
||||
|
||||
Then, compile openpilot:
|
||||
```bash
|
||||
scons -j8
|
||||
```
|
||||
|
||||
## 2. Run replay
|
||||
|
||||
We'll run the `replay` tool with the demo route to get data streaming for testing our UI changes.
|
||||
```bash
|
||||
# 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.
|
||||
|
||||
## 3. Make the speed blue
|
||||
|
||||
Search for “mph” with git grep in the `ui` folder.
|
||||
```bash
|
||||
$ git grep "mph" selfdrive/ui/
|
||||
paint.cc: ui_draw_text(s, s->fb_w/2, 290, s->scene.is_metric ? "km/h" : "mph", 36 * 2.5, COLOR_WHITE_ALPHA(200), "sans-regular");
|
||||
```
|
||||
|
||||
The line right above contains the actual speed. Unfortunately, COLOR_BLUE isn’t defined, but a git grep of COLOR_WHITE shows it’s nvgRGBA(255, 255, 255, 255). Personally, I like a lighter blue, so I went with #8080FF.
|
||||
```bash
|
||||
$ git diff
|
||||
diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc
|
||||
index 821d95115..cc996eaa1 100644
|
||||
--- a/selfdrive/ui/paint.cc
|
||||
+++ b/selfdrive/ui/paint.cc
|
||||
@@ -175,8 +175,8 @@ static void ui_draw_vision_speed(UIState *s) {
|
||||
const float speed = std::max(0.0, (*s->sm)["carState"].getCarState().getVEgo() * (s->scene.is_metric ? 3.6 : 2.2369363));
|
||||
const std::string speed_str = std::to_string((int)std::nearbyint(speed));
|
||||
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
|
||||
- ui_draw_text(s, s->fb_w/2, 210, speed_str.c_str(), 96 * 2.5, COLOR_WHITE, "sans-bold");
|
||||
- ui_draw_text(s, s->fb_w/2, 290, s->scene.is_metric ? "km/h" : "mph", 36 * 2.5, COLOR_WHITE_ALPHA(200), "sans-regular");
|
||||
+ ui_draw_text(s, s->fb_w/2, 210, speed_str.c_str(), 96 * 2.5, nvgRGBA(128, 128, 255, 255), "sans-bold");
|
||||
+ ui_draw_text(s, s->fb_w/2, 290, s->scene.is_metric ? "km/h" : "mph", 36 * 2.5, nvgRGBA(128, 128, 255, 200), "sans-regular");
|
||||
}
|
||||
|
||||
static void ui_draw_vision_event(UIState *s) {
|
||||
```
|
||||
|
||||
|
||||
## 4. Rebuild UI, and admire your work
|
||||
|
||||
```
|
||||
scons -j8 && selfdrive/ui/ui
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 5. Push your fork to GitHub
|
||||
|
||||
Click fork on GitHub. Then, push with:
|
||||
```bash
|
||||
git remote rm origin
|
||||
git remote add origin git@github.com:<your-github-username>/openpilot.git
|
||||
git add .
|
||||
git commit -m "Make the speed blue."
|
||||
git push --set-upstream origin master
|
||||
```
|
||||
|
||||
## 6. Run your fork on device in your car!
|
||||
|
||||
Uninstall openpilot from your device through the settings. Then, enter the URL for your very own installer:
|
||||
```
|
||||
installer.comma.ai/<your-github-username>/master
|
||||
```
|
||||
|
||||
## 7. Admire your work IRL
|
||||
|
||||

|
||||
Reference in New Issue
Block a user