Skip to content

Commit

Permalink
Detail uploading process in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron committed Jun 26, 2023
1 parent 80389d8 commit bffeed1
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,34 +63,36 @@ with gym.make("UpkieWheelsEnv-v2", frequency=200.0) as env:
action[0] = 10.0 * pitch
```

To run this example, start a simulation [spine](#spines) by:

```console
$ ./start_simulation.sh
```

Then run the code above. It will connect to the simulation, reset it and execute the policy continuously.
This code will connect to the simulation, reset it and execute the policy continuously. If instead of a simulation spine you are [running a pi3hat spine](#upload-to-the-raspberry-pi) on the robot, this code will control the robot directly.

## Bazel agents

Alternatively to the Python API above, we can use [Bazel](https://bazel.build/) to develop new agents directly in the repository (no installation required). One benefit of this choice is that there is no dependency to install (Bazel builds everything locally in a local cache), and it allows us to [upload to the Raspberry Pi](#upload-to-the-raspberry-pi).

## Upload to the Raspberry Pi

To run an agent on the Raspberry Pi, we first build it locally, then upload it to the Raspberry Pi, and finally run it there:
To run an agent on the Raspberry Pi, we first build it locally and upload it to the Raspberry Pi:

```console
$ make build
$ make upload ROBOT=your_robot_name
```

Next, connect to the robot and run a pi3hat spine:

```
$ ssh user@robot
user@robot:~$ cd upkie
user@robot:~$ make run_pi3hat_spine
user@robot:~$ make run_wheel_balancer
user@robot:upkie$ make run_pi3hat_spine
```

## Code overview
Finally, in a separate shell on the robot,

This repository uses [Bazel](https://bazel.build/) for building and testing. Compilation will only take a while the first time.
```
user@robot:upkie$ make run_wheel_balancer
```

## Code overview

Locomotion code is organized into *spines*, which communicate with the simulator or actuators using [Vulp](https://github.com/tasts-robots/vulp), and *agents*, the main programs that implement behaviors in Python. In the example above we ran the test balancer. We could also start the Bullet spine independently, and let it run waiting for agents to connect:

Expand Down

0 comments on commit bffeed1

Please sign in to comment.