Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulation Environment #798

Merged
merged 1 commit into from Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -56,3 +56,13 @@ If you're running a BlueOS instance, just put the IP address of it in "Global ve
If you're serving `mavlink2rest` in the same machine as Cockpit, activate the checkmark for "Mavlink2Rest connection" and use `ws://127.0.0.1:6040/v1/ws/mavlink` there (if you're running a mavlink2rest version before 0.11.15, omit the `/v1` in the URL).

If you're serving `mavlink-camera-manager` in the same machine as Cockpit, activate the checkmark for "WebRTC connection" and use `ws://127.0.0.1:6020` there.

## Simulating a vehicle

Cockpit provides a simulation environments in a docker compose file. There is an environment provided for ArduSub, ArduCopter, ArduRover and ArduPlane. The compose file uses docker compose profiles to allow you to choose which vehicle you want to simulate. The available profiles are `ardusub`, `arducopter`, `ardurover` and `arduplane`. You can run a simulation environment by running the following command:

```
docker-compose -f sim.yml --profile ardusub up
```

Assuming you have run the `bun run dev --host` command, you can access the simulation environment by opening the browser and accessing `localhost:5173`.
68 changes: 68 additions & 0 deletions sim.yml
@@ -0,0 +1,68 @@
version: "3.3"
services:

mavlink2rest:
image: "ericjohnson97/iq_sim_mavlink2rest:t0.11.19"
network_mode: "host"
environment:
- "MAVLINK_SRC=udpin:127.0.0.1:14551"
- "SERVER_PORT=0.0.0.0:6040"

mavp2p:
image: "ericjohnson97/iq_sim_server_mavp2p:latest"
network_mode: "host"
environment:
CMD: "./mavp2p tcpc:127.0.0.1:5760 udpc:127.0.0.1:14550 udpc:127.0.0.1:14551"
restart: "on-failure"

arducopter:
image: "ericjohnson97/iq_sim_server_ardupilot:Copter-4.4.0"
network_mode: "host"
restart: "on-failure"
environment:
VEHICLE: "Copter"
MODEL: "+"
LAT: "-27.63256"
LON: "-48.58706"
SYSID: "1"
profiles:
- "arducopter"

arduplane:
image: "ericjohnson97/iq_sim_server_ardupilot:Plane-4.4.0"
network_mode: "host"
restart: "on-failure"
environment:
VEHICLE: "ArduPlane"
MODEL: "plane"
LAT: "-27.63256"
LON: "-48.58706"
SYSID: "1"
profiles:
- "arduplane"

ardurover:
image: "ericjohnson97/iq_sim_server_ardupilot:Rover-4.2.2"
network_mode: "host"
restart: "on-failure"
environment:
VEHICLE: "APMrover2"
MODEL: "rover"
LAT: "-27.63256"
LON: "-48.58706"
SYSID: "1"
profiles:
- "ardurover"

ardusub:
image: "ericjohnson97/iq_sim_server_ardupilot:ArduSub-4.1.1"
network_mode: "host"
restart: "on-failure"
environment:
VEHICLE: "ArduSub"
MODEL: "vectored"
LAT: "-27.63256"
LON: "-48.58706"
SYSID: "1"
profiles:
- "ardusub"