Skip to content

Commit

Permalink
Additional betaflight instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
JacopoPan committed Aug 9, 2023
1 parent d5ff71a commit 6948d17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pip3 install --upgrade pip
pip3 install -e .
```

If needed, `sudo apt install build-essentials` to install `gcc` and build `pybullet`.

## Use

### PID position control example
Expand All @@ -40,9 +42,10 @@ python3 learn.py
In one terminal, run the Betaflight SITL binary

```sh
git clone https://github.com/betaflight/betaflight
cd betaflight/
make TARGET=SITL # comment out this line: https://github.com/betaflight/betaflight/blob/c41b458e5891205da50465caeec0c1aa83beeb0c/src/main/main.c#L52
git clone https://github.com/betaflight/betaflight
cd betaflight/
make arm_sdk_install # if needed, `apt install curl``
make TARGET=SITL # comment out this line: https://github.com/betaflight/betaflight/blob/master/src/main/main.c#L52
betaflight/obj/main/betaflight_SITL.elf
```

Expand Down
10 changes: 7 additions & 3 deletions gym_pybullet_drones/examples/beta.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
"""Control + Betaflight.
Setup
---
-----
Step 1: Clone betaflight https://github.com/betaflight/betaflight
Comment out line `delayMicroseconds_real(50); // max rate 20kHz` from Betaflight's SIMULATOR_BUILD
https://github.com/betaflight/betaflight/blob/c41b458e5891205da50465caeec0c1aa83beeb0c/src/main/main.c#L52
https://github.com/betaflight/betaflight/blob/master/src/main/main.c#L52
Step 2: Install betaflight configurator https://github.com/betaflight/betaflight-configurator/releases
wget https://github.com/betaflight/betaflight-configurator/releases/download/10.9.0/betaflight-configurator_10.9.0_amd64.deb
sudo dpkg -i betaflight-configurator_10.9.0_amd64.deb
Load the `../assets/beta.txt` configuration file onto the target using the BF configurator
Load the configuration file onto the target using the BF configurator
Type address `tcp://localhost:5761` (top right) and click `Connect`
Find the `CLI` tab (on the left) -> `Load from file` -> select file `../assets/beta.txt`
Example
-------
Expand Down

0 comments on commit 6948d17

Please sign in to comment.