Skip to content

Commit

Permalink
sim: adding simulation env
Browse files Browse the repository at this point in the history
  • Loading branch information
ericjohnson97 committed Mar 3, 2024
1 parent 33e02ef commit 011c947
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
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

0 comments on commit 011c947

Please sign in to comment.