@Jaeyoung-Lim I hate to piggyback on an old thread but can you explain where the idea of
comes from? Xplane allows you to set the udp rate higher and I was able to get 100+ fps and udp rate of ~70Hz on my moderate spec desktop using the Ardupilot SITL implementation. When I rolled back to an older version of QGC and PX4 the HITL simulation seemed to be working on initial glances. So was it deprecated from lack of use or is there something else I’m misunderstanding?
Xplane allows you to set the udp rate higher and I was able to get 100+ fps and udp rate of ~70Hz on my moderate spec desktop using the Ardupilot SITL implementation.
I am not sure if you are implying that the faster UDP rate speeds up the physics, but I was under the impression that Xplane physics is locked in with the rendering rate. (Please let me know if I misunderstood what Xplane is doing). Therefore you will not be able to simulate something significantly faster than 60 FPS. If you managed to get 100+FPS I guess that is close to the limit you will be getting.
To give you context, lockstep based simulators such as Gazebo / jmavsim / jsbsim do not require any rendering, therefore you can simulate with any realtime factor. For example you can run a 250Hz lockstep simulation 30 times realtime in gazebo, so in reality the simulation is being run at 7500Hz. These have separate clients that are used for rendering that are decoupled from the physics.
This is not possible with freerunning or rendering dependent simulators such as flightgear / airsim that PX4 supports.
So was it deprecated from lack of use or is there something else I’m misunderstanding?
If there is a use case with Xplane, certainly we would be interested in bringing back. However, with the limited granularity of the physics I don’t think this would be a framework we would use for software verification / testing.
@Jaeyoung-Lim I appreciate the clarification! I do believe you’re correct about the physics being locked with rendering rate, but it’s hard to say since it’s closed source. I assume speeding up the UDP rate, is only replicating the last known frame when it’s higher then frame rate, but I haven’t seen any documentation. I’'ll post here if I find any more information on the subject. The main benefit for us with Xplane is more advanced physics simulation. The ability to build more granular models with Plane Maker is useful. Comparatively the physics in Gazebo aren’t as advanced for flight dynamics and we don’t need more robotics orientated sensors like Cameras or LIdar for simulation.
The simulator’s performance is measured in frames per second (FPS, or frame rate). This is how many times per second the X‑Plane physics and rendering code (currently more than 700,000 lines of code!) can be run. Each time the computer runs through the program it advances the aircraft and recalculates the images that are seen (cloud formations, scenery, aircraft instruments, other aircraft, etc.)…The faster a computer can run X‑Plane the more realistic and rewarding the simulation will be
@Jaeyoung-Lim I took a closer look at JSBSim this afternoon. Is it HITL or SITL? The readme says it’s an integration of the PX4 mavlink HIL interface. But everything launched and the instructions on the devguide indicated it’s a sitl simulation. Can you switch between the two? If so how? Happy to update documentation if there’s a need for it.