A cross platform simulator that provides physically and visually realistic simulations. This simulator is resource intensive, and requires a significantly more powerful computer than the other simulators described here.
Supported Vehicles: Iris (MultiRotor model and a configuration for PX4 QuadRotor in the X configuration).
| | [FlightGear](../sim_flightgear/index.md) |A simulator that provides physically and visually realistic simulations. In particular it can simulate many weather conditions, including thunderstorms, snow, rain and hail, and can also simulate thermals and different types of atmospheric flows. [Multi-vehicle simulation](../sim_flightgear/multi_vehicle.md) is also supported.
Supported Vehicles: Plane, Autogyro, Rover
| -| [JMAVSim](../sim_jmavsim/index.md) |A simple multirotor/quad simulator. This was previously part of the PX4 development toolchain but was removed in favour of [Gazebo](../sim_gazebo_gz/index.md).
Supported Vehicles: Quad
| | [JSBSim](../sim_jsbsim/index.md) |A simulator that provides advanced flight dynamics models. This can be used to model realistic flight dynamics based on wind tunnel data.
Supported Vehicles: Plane, Quad, Hex
| | [PteroSim](../sim_pterosim/index.md) |Proprietary high-fidelity UAV simulation built on Unreal Engine 5 and JSBSim. Connects to PX4 SITL over the Simulator MAVLink API with lockstep synchronization.
Supported Vehicles: Free tier: Multicopter. Paid tiers: Fixed-wing, VTOL, Helicopter.
| | [RotorPy](../sim_rotorpy/index.md) |A Python-based multirotor simulation environment with aerodynamic forces and moments, actuator limits, sensor noise, wind, obstacles, and a Gymnasium interface for research workflows.
Supported Vehicles: Quad
| diff --git a/docs/en/simulation/hardware.md b/docs/en/simulation/hardware.md index 59efad7a678..45bf8a9a716 100644 --- a/docs/en/simulation/hardware.md +++ b/docs/en/simulation/hardware.md @@ -9,19 +9,19 @@ It can surface issues with running PX4 that might hidden when running on a deskt Two simulation approaches are available, controlled by the [SYS_HITL](../advanced_config/parameter_reference.md#SYS_HITL) parameter: -- **[HITL Simulation](../simulation/hitl.md) (`SYS_HITL=1`):** An external simulator (Gazebo Classic or jMAVSim) runs physics on a companion computer and sends sensor data to the flight controller via MAVLink HIL messages. Requires a USB/UART connection and simulator setup. +- **[HITL Simulation](../simulation/hitl.md) (`SYS_HITL=1`):** An external simulator (Gazebo Classic) runs physics on a companion computer and sends sensor data to the flight controller via MAVLink HIL messages. Requires a USB/UART connection and simulator setup. - **[SIH on Hardware](../sim_sih/hardware.md) (`SYS_HITL=2`):** A C++ physics model runs directly on the flight controller itself. No external simulator, no companion computer, no MAVLink sensor data. Just set the parameter and reboot. ## HITL vs SIH {#comparision} -| | HITL (`SYS_HITL=1`) | SIH (`SYS_HITL=2`) | -| ----------------- | -------------------------------------------- | ---------------------------------------------------- | -| Physics model | External simulator (Gazebo Classic, jMAVSim) | Internal C++ module | -| Communication | MAVLink HIL messages | uORB (internal) | -| External process | Required | Not required | -| Setup complexity | Higher | Lower | -| Sensor simulation | Camera, lidar, etc. (via simulator) | IMU, GPS, baro, mag, airspeed only | -| Vehicle types | Quadcopter, Standard VTOL | Quad, Hex, FW, VTOL Tailsitter, Standard VTOL, Rover | +| | HITL (`SYS_HITL=1`) | SIH (`SYS_HITL=2`) | +| ----------------- | ----------------------------------- | ---------------------------------------------------- | +| Physics model | External simulator (Gazebo Classic) | Internal C++ module | +| Communication | MAVLink HIL messages | uORB (internal) | +| External process | Required | Not required | +| Setup complexity | Higher | Lower | +| Sensor simulation | Camera, lidar, etc. (via simulator) | IMU, GPS, baro, mag, airspeed only | +| Vehicle types | Quadcopter, Standard VTOL | Quad, Hex, FW, VTOL Tailsitter, Standard VTOL, Rover | ## When to Use Which diff --git a/docs/en/simulation/hitl.md b/docs/en/simulation/hitl.md index ac1474d8d8c..41c4bb81036 100644 --- a/docs/en/simulation/hitl.md +++ b/docs/en/simulation/hitl.md @@ -10,7 +10,8 @@ See [Toolchain Installation](../dev_setup/dev_env.md) for information about the Hardware-in-the-Loop (HITL or HIL) is a simulation mode in which normal PX4 firmware is run on real flight controller hardware. This approach has the benefit of testing most of the actual flight code on the real hardware. -PX4 supports HITL for multicopters (using [jMAVSim](../sim_jmavsim/index.md) or [Gazebo Classic](../sim_gazebo_classic/index.md)) and VTOL (using Gazebo Classic). +PX4 supports HITL for multicopters and VTOL using [Gazebo Classic](../sim_gazebo_classic/index.md). +To simulate on flight controller hardware without an external simulator, use [SIH on hardware](../sim_sih/hardware.md). For a comparison of HITL and SIH on hardware, see [Hardware Simulation](../simulation/hardware.md). @@ -18,31 +19,31 @@ For a comparison of HITL and SIH on hardware, see [Hardware Simulation](../simul The set of compatible airframes vs simulators is: -| Airframe | `SYS_AUTOSTART` | Gazebo Classic | jMAVSim | -| ---------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | ------- | -| [HIL Quadcopter X](../airframes/airframe_reference.md#copter_simulation_hil_quadcopter_x) | 1001 | Y | Y | -| [HIL Standard VTOL QuadPlane](../airframes/airframe_reference.md#vtol_standard_vtol_hil_standard_vtol_quadplane) | 1002 | Y | | +| Airframe | `SYS_AUTOSTART` | Gazebo Classic | +| ---------------------------------------------------------------------------------------------------------------- | --------------- | -------------- | +| [HIL Quadcopter X](../airframes/airframe_reference.md#copter_simulation_hil_quadcopter_x) | 1001 | Y | +| [HIL Standard VTOL QuadPlane](../airframes/airframe_reference.md#vtol_standard_vtol_hil_standard_vtol_quadplane) | 1002 | Y | ## HITL Simulation Environment {#simulation_environment} With Hardware-in-the-Loop (HITL) simulation the normal PX4 firmware is run on real hardware. -JMAVSim or Gazebo Classic (running on a development computer) are connected to the flight controller hardware via USB/UART. +Gazebo Classic (running on a development computer) is connected to the flight controller hardware via USB/UART. The simulator acts as gateway to share MAVLink data between PX4 and _QGroundControl_. ::: info The simulator can also be connected via UDP if the flight controller has networking support and uses a stable, low-latency connection (e.g. a wired Ethernet connection - WiFi is usually not sufficiently reliable). -For example, this configuration has been tested with PX4 running on a Raspberry Pi connected via Ethernet to the computer (a startup configuration that includes the command for running jMAVSim can be found in [px4_hil.config](https://github.com/PX4/PX4-Autopilot/blob/main/posix-configs/rpi/px4_hil.config)). +For example, this configuration has been tested with PX4 running on a Raspberry Pi connected via Ethernet to the computer (the startup configuration can be found in [px4_hil.config](https://github.com/PX4/PX4-Autopilot/blob/main/posix-configs/rpi/px4_hil.config)). ::: The diagram below shows the simulation environment: - A HITL configuration is selected (via _QGroundControl_) that doesn't start any real sensors. -- _jMAVSim_ or _Gazebo Classic_ are connected to the flight controller via USB. +- _Gazebo Classic_ is connected to the flight controller via USB. - The simulator is connected to _QGroundControl_ via UDP and bridges its MAVLink messages to PX4. -- _Gazebo Classic_ and _jMAVSim_ can also connect to an offboard API and bridge MAVLink messages to PX4. +- _Gazebo Classic_ can also connect to an offboard API and bridge MAVLink messages to PX4. - (Optional) A serial connection can be used to connect Joystick/Gamepad hardware via _QGroundControl_. - + ## HITL vs SITL @@ -157,28 +158,6 @@ Make sure _QGroundControl_ is not running! 5. Start _QGroundControl_. It should autoconnect to PX4 and Gazebo Classic. -#### jMAVSim (Quadrotor only) - -::: info -Make sure _QGroundControl_ is not running! -::: - -1. Connect the flight controller to the computer and wait for it to boot. -2. Run jMAVSim in HITL mode: - - ```sh - ./Tools/simulation/jmavsim/jmavsim_run.sh -q -s -d /dev/ttyACM0 -b 921600 -r 250 - ``` - - ::: info - Replace the serial port name `/dev/ttyACM0` as appropriate. - On macOS this port would be `/dev/tty.usbmodem1`. - On Windows (including Cygwin) it would be the COM1 or another port - check the connection in the Windows Device Manager. - ::: - -3. Start _QGroundControl_. - It should autoconnect to PX4 and jMAVSim. - ## Fly an Autonomous Mission in HITL You should be able to use _QGroundControl_ to [run missions](https://docs.qgroundcontrol.com/master/en/qgc-user-guide/fly_view/fly_view.html#missions) and otherwise control the vehicle. diff --git a/docs/en/simulation/index.md b/docs/en/simulation/index.md index 0d409947a54..7cfd8a6ef7e 100644 --- a/docs/en/simulation/index.md +++ b/docs/en/simulation/index.md @@ -41,7 +41,7 @@ To run PX4 SITL without setting up a build environment, [pre-built packages and | Feature | Gazebo | SIH | | ------------------------- | ----------------------------------------- | ------------------------------------------------------------------- | | **Default Mode** | GUI with 3D rendering | Headless (fastest iteration) | -| **3D Visualization** | Built-in (photorealistic) | Optional: QGC map or jMAVSim display-only | +| **3D Visualization** | Built-in (photorealistic) | Optional: QGC map or [Hawkeye](../sim_hawkeye/index.md) | | **Physics Engine** | External (gz-physics) | Internal (C++ module, uORB) | | **External Dependencies** | Gazebo packages, rendering libs | None | | **Vehicle Types** | Quad, VTOL, Plane, Rovers | Quad, Hex, Plane, Tailsitter, Std VTOL, Rover | @@ -67,7 +67,7 @@ For a detailed analysis of PX4 simulation user needs, priorities, and pain point - **Hardware integration testing without propellers:** Use [SIH on flight controller hardware](../sim_sih/index.md#sih-on-flight-controller-hardware) (`SYS_HITL=2`). :::info -SIH is headless by default. For optional 3D visualization, you can use [jMAVSim in display-only mode](../sim_sih/index.md#visualization-optional) or monitor the vehicle in QGroundControl's map view. +SIH is headless by default. For optional 3D visualization, you can use the [Hawkeye](../sim_hawkeye/index.md) visualizer or monitor the vehicle in QGroundControl's map view. ::: ## Simulator MAVLink API @@ -175,7 +175,7 @@ The syntax (simplified) looks like this: make px4_sitl simulator[_vehicle-model] ``` -where `simulator` is `gz` (for Gazebo), `gazebo-classic`, `jmavsim` or some other simulator, and vehicle-model is a particular vehicle type supported by that simulator ([Gazebo](../sim_gazebo_gz/index.md) and [jMAVSim](../sim_jmavsim/index.md) only support multicopters at time of writing, while [Gazebo Classic](../sim_gazebo_classic/index.md) supports many different types). +where `simulator` is `gz` (for Gazebo), `gazebo-classic` or some other simulator, and vehicle-model is a particular vehicle type supported by that simulator ([Gazebo](../sim_gazebo_gz/index.md) only supports multicopters at time of writing, while [Gazebo Classic](../sim_gazebo_classic/index.md) supports many different types). A number of examples are shown below, and there are many more in the individual pages for each of the simulators: @@ -189,9 +189,6 @@ make px4_sitl gazebo-classic_plane # Start Gazebo Classic with iris and optical flow make px4_sitl gazebo-classic_iris_opt_flow -# Start JMavSim with iris (default vehicle model) -make px4_sitl jmavsim - # Start PX4 with no simulator (i.e. to use your own "custom" simulator) make px4_sitl none_iris @@ -214,7 +211,7 @@ For more information see: [Building the Code > PX4 Make Build Targets](../dev_se ### Run Simulation Faster than Realtime {#simulation_speed} -SITL can be run faster or slower than real-time when using Gazebo, Gazebo Classic, jMAVSim, or SIH. +SITL can be run faster or slower than real-time when using Gazebo, Gazebo Classic, or SIH. The speed factor is set using the environment variable `PX4_SIM_SPEED_FACTOR`. @@ -227,7 +224,6 @@ For more information see: - Gazebo: [Change Simulation Speed](../sim_gazebo_gz/index.md#change-simulation-speed) - Gazebo Classic: [Change Simulation Speed](../sim_gazebo_classic/index.md#change-simulation-speed) and [Lockstep](../sim_gazebo_classic/index.md#lockstep) -- jMAVSim: [Change Simulation Speed](../sim_jmavsim/index.md#change-simulation-speed) and [Lockstep](../sim_jmavsim/index.md#lockstep) - SIH: Supports `PX4_SIM_SPEED_FACTOR` for faster-than-realtime simulation. ### Startup Scripts diff --git a/docs/en/simulation/multi-vehicle-simulation.md b/docs/en/simulation/multi-vehicle-simulation.md index 34c7d8cd686..6874ee4541a 100644 --- a/docs/en/simulation/multi-vehicle-simulation.md +++ b/docs/en/simulation/multi-vehicle-simulation.md @@ -5,7 +5,6 @@ PX4 supports multi-vehicle simulation using the following simulators: - [Multi-Vehicle Sim with Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md) (both with and without ROS) - [Multi-Vehicle Sim with Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md) (both with and without ROS) - [Multi-Vehicle Sim with FlightGear](../sim_flightgear/multi_vehicle.md) -- [Multi-Vehicle Sim with JMAVSim](../sim_jmavsim/multi_vehicle.md) - [Multi-Vehicle Sim with SIH](../sim_sih/index.md#multi-vehicle-simulation) The choice of the simulator depends on the vehicle to be simulated, how "good" the simulation needs to be (and for what features), and how many vehicles need to be simulated at a time: @@ -19,8 +18,6 @@ The choice of the simulator depends on the vehicle to be simulated, how "good" t Note, this is the successor of [Gazebo Classic](../sim_gazebo_classic/index.md) (below). - [Gazebo Classic](../sim_gazebo_classic/index.md) is less accurate and less heavy-weight and supports many features and vehicles that aren't available for FlightGear. It can simulate many more vehicles at a time than FlightGear and it allows for different types of vehicles to be simulated at the same time. -- [JMAVSim](../sim_jmavsim/index.md) is a very light-weight simulator that supports only quadcopters. - It is recommended if you need to support a lot of quadcopters, and the simulation only needs to be approximate. - [SIH](../sim_sih/index.md) is the lightest-weight option with zero external dependencies. Since SIH is headless and runs physics internally, it can launch many instances with minimal resource usage. It supports all 6 vehicle types (quad, hex, plane, tailsitter, standard VTOL, rover).