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 877f87d
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -56,3 +56,12 @@ 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 as docker a docker compose file. The is an environment provided for ArduSub, ArduCopter, ArduRover and ArduPlane. To configure the simulation environment, open the sim.yml file and uncomment the desired vehicle. Then, run the following command:

```
docker-compose -f sim.yml 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`.
62 changes: 62 additions & 0 deletions sim.yml
@@ -0,0 +1,62 @@
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


# vehicle simulators: uncomment the one you want to use
# 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

# 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

# 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

# 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

0 comments on commit 877f87d

Please sign in to comment.