-
Notifications
You must be signed in to change notification settings - Fork 482
Basic Simulation doc needs clarification #181
Comments
I will try to answer the question above, but I do not know the answer for all questions 1.
2.udp connection ports:a.) PX4any time you start px4 sitl (for instance make posix_sitl_default jmavsim) then in most cases three mavlink streams are started on port 14556 (normal mode) and 14557 (onboard mode) (example here: https://github.com/PX4/Firmware/blob/master/posix-configs/SITL/init/ekf2/iris#L64-L65) and sitl port: b.) Simulatorudp port 14560 (communicates with px4) c.) QGC / any GCSudp port 14550 (communicates over normal mode with px4) An outdated example is here: https://github.com/PX4/Firmware/tree/master/posix-configs/SITL
The simulated vehicle has to be defined in the simulator (which is a submodule of px4 firmware):
do you mean parameters specific for the simulator or for the firmware? firmware specific parameters are specified in the init file for each type of simulation:
certain tests are straight forward, but there is no module that takes care of them (would actually be nice to have that in the future). RC loss for instance can be tested by unplugging the controller, GPS loss can be tested by typing in the terminal from which the simulation was started: gps stop
I guess changes like that would first need to be implemented in the simulator. thats rather a question of how good the simulator is (which is a different project).
You need to write a new init file that starts the px4 modules required to deal with the additional components: if you also want to visualize the component, then you need to add a new vehicle model I will finish the rest later. |
Yes I think so. But I'd call it mavlink instance, mavlink stream means something different. It's also worth stressing that the simulator module is responsible for the mavlink communication with the simulator, for all others (QGC, mavros, ...) it's the |
Thank you @Stifael . That is a really good start.
Well yes, but presumably flying around is "for a purpose" - which is to test something. So perhaps the question would be better as "what can you test and what can't you test"? From above it sounds like jmavsim provides ability to simulate gps, compass, gyro. It sounds like you can turn off modules to fake failure of components. It sounds like you can simulate lidar (?) but you can't actually set up buildings or anything to avoid. Wind etc is not part of the physics engine. Essentially, if the vehicle does fly in this sim then you know that the estimator and most of your other settings are OK. What else have you used it to verify? Sorry to be so long winded. We can chat over this in a call if it suits you better. |
The doc has some questions that it would be good to answer: https://dev.px4.io/en/simulation/sitl.html
This is "Basic Simulation".
Some things I might like to do that I can't see from information provided (please advise if possible or not, and if possible, how):
The simulation is demonstrated with
commander takeoff
.The command
make posix_sitl_default jmavsim
- what are the "bits" ie "posix_sitl_default" and jmavsim. Are there options for these - e.g. to simulate some other vehicleIn simulating a wifi drone you can broadcast the IP on the local network.
In extending and customising:
The "Important Files" sections says the following
I got this started in virtualbox with QGC and the latest PX4. However as soon as it takes off I get "Failsafe enabled: no local position" essages. Lots of drifting of my vehicle. EFK Fusion timeouts reported. GPS seems OK in that QGC shows 10 satellites. Is there something I can do to simulation to get everything to work "out of the box" in terms of flying the vehicle?
The text was updated successfully, but these errors were encountered: