Add option to start simulator via docker#944
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds functionality to start and stop an ArduPilot SITL (Software In The Loop) simulator via Docker from the GCS application. A button is added to the Advanced menu in the toolbar that allows users to start and stop the simulator container.
- Adds a new Python endpoint module for Docker simulation control via SocketIO events
- Implements Redux state management for tracking simulation status (Idle, Starting, Running)
- Adds UI controls in the Advanced menu to start/stop the simulation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| radio/requirements.txt | Adds docker==7.1.0 dependency for Docker API integration |
| radio/app/endpoints/simulation.py | New endpoint module with handlers for starting/stopping Docker containers |
| radio/app/endpoints/init.py | Imports the new simulation endpoint module |
| gcs/src/redux/slices/droneConnectionSlice.js | Adds simulation status state, actions, selectors, and emitters |
| gcs/src/redux/middleware/socketMiddleware.js | Adds socket event handler for simulation_result messages |
| gcs/src/redux/middleware/emitters.js | Implements emitters for start/stop simulation commands |
| gcs/src/components/toolbar/menus/advanced.jsx | Adds UI button for starting/stopping simulation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
All these copilot comments are non-issues or over-engineering so as per meeting today, requesting a review. |
NexInfinite
left a comment
There was a problem hiding this comment.
Code looks good, copilot is going crazy
1Blademaster
left a comment
There was a problem hiding this comment.
I'll test locally tomorrow, but adding these comments for now.
|
Can we somehow show the loading/connection modal (which shows connection progress) while connecting to the simulation? |
|
Got to add a disconnect from the simulation if stopping the simulation and are still connected |
…//github.com/Avis-Drone-Labs/FGCS into 939-add-option-to-start-simulator-via-docker
No I don't think we do, but what change do you suggest, limit to 3 port mappings? |
Done.
Extracted the progress bar at the bottom of the connect menu to its own component and added it to the bottom of the simulation modal.
Done for if auto-connects after start, so will not work if simulation started and connected separately, but this will act the same as when container stopped from command line.
The added ports now start from 5762 rather than 5761 so first 3 ports if no changes made will be 5760, 5762, 57623. |
1Blademaster
left a comment
There was a problem hiding this comment.
Big PR. Diffs look good to me and initial tests went smoothly. I think in the future we can ship a custom dockerfile so we don't have to pull from the internet.


Adds the option to start the simulator via docker from a modal opened under the "Advanced" navbar item.
Frontend
Modal allows for configuration of port and vehicle type, aswell as checkbox for connecting after start. There is some easy potential for adding the other parameters from DEVELOPMENT_GUIDE.md, but was starting to suffer a bit from scope creep I thought.
Features
Notes