Skip to content

Commit

Permalink
add param to enable engagement with the white panda (commaai#127)
Browse files Browse the repository at this point in the history
* add param to enable engagement with the white panda

* add to readme and fix false to true

* make opEdit executable on linux

* add to releases

* move features to separate file
  • Loading branch information
sshane authored Jul 23, 2020
1 parent fffa257 commit adb64b5
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 13 deletions.
22 changes: 22 additions & 0 deletions OPEDIT_FEATURES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# opEdit Features:
- You can misspell parameter names and opEdit should be able to figure out which parameter you want. Ex. `cmra off` would be parsed as: `camera_offset`
- You can also still enter the corresponding parameter index while choosing parameters to edit
- Type `a` to add a parameter, `d` to delete a parameter, or `l` to toggle live tuning only mode
- Shows a detailed description for each parameter once you choose it
- Parameter value type restriction. Ensures a user cannot save an unsupported value type for any parameters, breaking the fork
- Remembers which mode you were last in and initializes opEdit with that mode (live tuning or not)
- Case insensitive boolean and NoneType entrance. Type `faLsE` to save `False (bool)`, etc
- **Parameters marked with `(live!)` will have updates take affect within 3 seconds while driving! All other params will require a reboot of your EON/C2 to take effect.**

## To run the opEdit parameter manager:
```python
cd /data/openpilot
python op_edit.py
```

**OR**

```python
cd /data/openpilot
./op_edit.py
```
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ I've trained a custom model with Keras that takes in the past 35 seconds of your

It's only been trained on about an hour of data, so it's not perfect yet, but it's great for users who just want to set it and forget it. **To enable the `auto` profile, simply tap the profile changing button for dynamic follow until it reaches the `auto` profile!**

If you're annoyed by the silent alerts that show when the model has changed the profile automatically, just use [opEdit](#Customize-this-fork-opEdit) and set `hide_auto_df_alerts` to `False`. Auto profile and model will remain functional but will not show alerts.
If you're annoyed by the silent alerts that show when the model has changed the profile automatically, just use [opEdit](#Customize-this-fork-opEdit) and set `hide_auto_df_alerts` to `True`. Auto profile and model will remain functional but will not show alerts.

Resources:
- [The auto-df repo.](https://github.com/ShaneSmiskol/auto-df)
Expand Down Expand Up @@ -102,15 +102,7 @@ cd /data/openpilot
python op_edit.py # or ./op_edit.py
```

Features:
- You can misspell parameter names and opEdit should be able to figure out which parameter you want. Ex. `cmra off` would be parsed as: `camera_offset`
- You can also still enter the corresponding parameter index while choosing parameters to edit
- Type `a` to add a parameter, `d` to delete a parameter, or `l` to toggle live tuning only mode
- Shows a detailed description for each parameter once you choose it
- Parameter value type restriction. Ensures a user cannot save an unsupported value type for any parameters, breaking the fork
- Remembers which mode you were last in and initializes opEdit with that mode (live tuning or not)
- Case insensitive boolean and NoneType entrance. Type `faLsE` to save `False (bool)`, etc
- **Parameters marked with `(live!)` will have updates take affect within 3 seconds while driving! All other params will require a reboot of your EON/C2 to take effect.**
[To see what features opEdit has, click me!](/OPEDIT_FEATURES.md)

Here are the main parameters you can change with this fork:
- **Tuning params**:
Expand All @@ -130,6 +122,8 @@ Here are the main parameters you can change with this fork:
- `hide_auto_df_alerts`: Hides the alert that shows what profile the model has chosen
- [`dynamic_camera_offset`](#Dynamic-camera-offset-based-on-oncoming-traffic): Whether to automatically keep away from oncoming traffic. Works from 35 to ~60 mph
- `dynamic_follow`: *Deprecated, use the on-screen button to change profiles*
- **Experimental params**:
- `support_white_panda`: This allows users with the original white panda to use openpilot above 0.7.7. The high precision localizer's performance may be reduced due to a lack of GPS

A full list of parameters that you can modify are [located here](common/op_params.py#L40).

Expand Down
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Stock Additions 0.7.7
========================
* LaneSpeed process is much more efficient, CPU usage down from 6% (causing lag alerts) to ~1%
* Use numpy_fast.interp instead of np.interp for slight boost in performance
* Support white panda with experimental parameter. localizer performance may be reduced

Version 0.7.7 (2020-07-20)
========================
Expand Down
5 changes: 4 additions & 1 deletion common/op_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ def __init__(self):
'dynamic_gas': {'default': True, 'allowed_types': [bool], 'description': 'Whether to use dynamic gas if your car is supported'},
'hide_auto_df_alerts': {'default': False, 'allowed_types': [bool], 'description': 'Hides the alert that shows what profile the model has chosen'},
'log_auto_df': {'default': False, 'allowed_types': [bool], 'description': 'Logs dynamic follow data for auto-df'},
'dynamic_camera_offset': {'default': True, 'allowed_types': [bool], 'description': 'Whether to automatically keep away from oncoming traffic. Works from 35 to ~60 mph'},
'dynamic_camera_offset': {'default': True, 'allowed_types': [bool], 'description': 'Whether to automatically keep away from oncoming traffic.\n'
'Works from 35 to ~60 mph (requires radar)'},
'support_white_panda': {'default': False, 'allowed_types': [bool], 'description': 'Enable this to allow engagement with the deprecated white panda.\n'
'localizer might not work correctly'},


'op_edit_live_mode': {'default': False, 'allowed_types': [bool], 'description': 'This parameter controls which mode opEdit starts in. It should be hidden from the user with the hide key', 'hide': True}}
Expand Down
Empty file modified op_edit.py
100644 → 100755
Empty file.
5 changes: 3 additions & 2 deletions selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ def __init__(self, sm=None, pm=None, can_sock=None):
self.events.add(EventName.communityFeatureDisallowed, static=True)
if self.read_only and not passive:
self.events.add(EventName.carUnrecognized, static=True)
if hw_type == HwType.whitePanda:
self.events.add(EventName.whitePandaUnsupported, static=True)
if not self.op_params.get('support_white_panda', False):
if hw_type == HwType.whitePanda:
self.events.add(EventName.whitePandaUnsupported, static=True)

# controlsd is driven by can recv, expected at 100Hz
self.rk = Ratekeeper(100, print_delay_threshold=None)
Expand Down

0 comments on commit adb64b5

Please sign in to comment.