From de9c69316e82e58968bf7dd5a6fe4a1ef1f5db09 Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Sat, 26 Sep 2026 12:59:07 -0700 Subject: [PATCH] docs(simulation): replace jMAVSim with SIH and Hawkeye The jMAVSim pages become redirects to SIH, examples and HITL options move to SIH, Gazebo or Gazebo Classic, and SIH on hardware gets Hawkeye as its 3D display-only view through a MAVLink bridge to its UDP port. The release notes flag the removal in the upgrade guide. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ramon Roche --- docs/en/SUMMARY.md | 2 - docs/en/_sidebar.md | 2 - docs/en/debug/failure_injection.md | 30 +- docs/en/debug/simulation_debugging.md | 6 +- docs/en/debug/system_wide_replay.md | 2 +- docs/en/dev_setup/building_px4.md | 6 +- docs/en/dev_setup/dev_env_linux_arch.md | 4 +- docs/en/dev_setup/dev_env_windows_cygwin.md | 7 +- docs/en/dev_setup/dev_env_windows_vm.md | 4 +- docs/en/releases/main.md | 2 + docs/en/ros/mavros_custom_messages.md | 4 +- docs/en/ros2/multi_vehicle.md | 2 +- docs/en/sim_jmavsim/index.md | 400 +----------------- docs/en/sim_jmavsim/multi_vehicle.md | 54 +-- docs/en/sim_sih/hardware.md | 15 +- .../community_supported_simulators.md | 1 - docs/en/simulation/hardware.md | 18 +- docs/en/simulation/hitl.md | 43 +- docs/en/simulation/index.md | 12 +- .../en/simulation/multi-vehicle-simulation.md | 3 - 20 files changed, 74 insertions(+), 543 deletions(-) diff --git a/docs/en/SUMMARY.md b/docs/en/SUMMARY.md index 95bcf7c08d3..090b3b81d77 100644 --- a/docs/en/SUMMARY.md +++ b/docs/en/SUMMARY.md @@ -918,8 +918,6 @@ - [FlightGear Simulation](sim_flightgear/index.md) - [FlightGear Vehicles](sim_flightgear/vehicles.md) - [Multi-Vehicle Sim with FlightGear](sim_flightgear/multi_vehicle.md) - - [jMAVSim Simulation](sim_jmavsim/index.md) - - [Multi-Vehicle Sim with JMAVSim](sim_jmavsim/multi_vehicle.md) - [JSBSim Simulation](sim_jsbsim/index.md) - [PteroSim Simulation](sim_pterosim/index.md) - [RotorPy Simulation](sim_rotorpy/index.md) diff --git a/docs/en/_sidebar.md b/docs/en/_sidebar.md index 82e59756ca0..57f9aee6af3 100644 --- a/docs/en/_sidebar.md +++ b/docs/en/_sidebar.md @@ -908,8 +908,6 @@ - [FlightGear Simulation](/sim_flightgear/index.md) - [FlightGear Vehicles](/sim_flightgear/vehicles.md) - [Multi-Vehicle Sim with FlightGear](/sim_flightgear/multi_vehicle.md) - - [jMAVSim Simulation](/sim_jmavsim/index.md) - - [Multi-Vehicle Sim with JMAVSim](/sim_jmavsim/multi_vehicle.md) - [JSBSim Simulation](/sim_jsbsim/index.md) - [PteroSim Simulation](/sim_pterosim/index.md) - [RotorPy Simulation](/sim_rotorpy/index.md) diff --git a/docs/en/debug/failure_injection.md b/docs/en/debug/failure_injection.md index 2c836c2047f..26879f134db 100644 --- a/docs/en/debug/failure_injection.md +++ b/docs/en/debug/failure_injection.md @@ -14,21 +14,21 @@ What differs is whether a _consumer_ applies the failure, and that depends on th The table lists the failure types that actually take effect per environment: `off`, `stuck`, `wrong` (`ok` is not listed, but clears an active injection on all environments). A `—` means the module still accepts the command, but no consumer applies it in that environment. -| Component | [Gazebo] (gz) | [SIH] | `simulator_mavlink` (Gazebo Classic/JMAVSim) | Hardware | -| ----------------- | ----------------------- | ----------------------- | -------------------------------------------- | ----------------------- | -| `gyro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `accel` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `mag` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `baro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `distance_sensor` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | -| `gps` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | -| `airspeed` | `off`, `stuck`, `wrong` | — | `off`, `wrong` | — | -| `vio` | — | — | `off` | — | -| `battery` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | -| `traffic` | `off` | `off` | `off` | `off` | -| `motor` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | -| `esc` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | -| `can` | — | — | — | `off` | +| Component | [Gazebo] (gz) | [SIH] | `simulator_mavlink` (Gazebo Classic) | Hardware | +| ----------------- | ----------------------- | ----------------------- | ------------------------------------ | ----------------------- | +| `gyro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `accel` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `mag` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `baro` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `distance_sensor` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | `off`, `stuck` | +| `gps` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | `off`, `stuck`, `wrong` | +| `airspeed` | `off`, `stuck`, `wrong` | — | `off`, `wrong` | — | +| `vio` | — | — | `off` | — | +| `battery` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | +| `traffic` | `off` | `off` | `off` | `off` | +| `motor` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | +| `esc` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | `off`, `wrong` | +| `can` | — | — | — | `off` | [SIH]: ../sim_sih/index.md [Gazebo]: ../sim_gazebo_gz/index.md diff --git a/docs/en/debug/simulation_debugging.md b/docs/en/debug/simulation_debugging.md index 6cd7871bbb1..8ef9885dcae 100644 --- a/docs/en/debug/simulation_debugging.md +++ b/docs/en/debug/simulation_debugging.md @@ -8,7 +8,7 @@ The Clang address sanitizer can help to find alignment (bus) errors and other me ```sh make clean # only required on first address sanitizer run after a normal build -PX4_ASAN=1 make px4_sitl jmavsim +PX4_ASAN=1 make px4_sitl_sih sihsim_quadx ``` ## Valgrind @@ -26,7 +26,7 @@ sudo apt-get install valgrind To use valgrind during the SITL simulation: ```sh -make px4_sitl_default jmavsim___valgrind +make px4_sitl_default gazebo-classic___valgrind ``` ## Launch Gazebo Classic SITL Without Debugger @@ -36,7 +36,7 @@ By default SITL is launched without a debugger attached when using any simulator ```sh make px4_sitl_default gz make px4_sitl_default gazebo-classic -make px4_sitl_default jmavsim +make px4_sitl_sih sihsim_quadx ``` For Gazebo Classic (only) you can also start the simulator with a debugger attached. diff --git a/docs/en/debug/system_wide_replay.md b/docs/en/debug/system_wide_replay.md index d2eea97af19..d2c897d0001 100644 --- a/docs/en/debug/system_wide_replay.md +++ b/docs/en/debug/system_wide_replay.md @@ -61,7 +61,7 @@ Reasons for this are given below. - Start the replay: ```sh - make px4_sitl_default jmavsim + make px4_sitl_default none_iris ``` This will automatically open the log file, apply the parameters and start the replay. diff --git a/docs/en/dev_setup/building_px4.md b/docs/en/dev_setup/building_px4.md index 009c597153f..826d94fd5f9 100644 --- a/docs/en/dev_setup/building_px4.md +++ b/docs/en/dev_setup/building_px4.md @@ -284,10 +284,10 @@ make list_config_targets **VIEWER_MODEL_DEBUGGER_WORLD:** -- **VIEWER:** This is the simulator ("viewer") to launch and connect: `gz`, `gazebo`, `jmavsim`, `none` +- **VIEWER:** This is the simulator ("viewer") to launch and connect: `gz`, `gazebo`, `none` :::tip - `none` can be used if you want to launch PX4 and wait for a simulator (jmavsim, Gazebo, Gazebo Classic, or some other simulator). + `none` can be used if you want to launch PX4 and wait for a simulator (Gazebo, Gazebo Classic, or some other simulator). For example, `make px4_sitl none_iris` launches PX4 without a simulator (but with the iris airframe). ::: @@ -307,7 +307,7 @@ make list_config_targets - You can use three underscores if you want to specify a default value between two other settings. For example, `gazebo-classic___gdb` is equivalent to `gazebo-classic_iris_gdb`. - You can use a `none` value for `VIEWER_MODEL_DEBUGGER` to start PX4 and wait for a simulator. - For example start PX4 using `make px4_sitl_default none` and jMAVSim using `./Tools/simulation/jmavsim/jmavsim_run.sh -l`. + For example start PX4 using `make px4_sitl_default none` and then start your simulator. ::: diff --git a/docs/en/dev_setup/dev_env_linux_arch.md b/docs/en/dev_setup/dev_env_linux_arch.md index 655792ef07b..527ea4113ef 100644 --- a/docs/en/dev_setup/dev_env_linux_arch.md +++ b/docs/en/dev_setup/dev_env_linux_arch.md @@ -9,7 +9,7 @@ See [Toolchain Installation](../dev_setup/dev_env.md) for information about the The PX4-Autopilot repository provides a convenient script to set your Arch installation up for PX4 development: [Tools/setup/arch.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/setup/arch.sh). -The script installs (by default) all tools to build PX4 for NuttX targets and run simulation with [JMAVSim](../sim_jmavsim/index.md). +The script installs (by default) all tools to build PX4 for NuttX targets and run simulation with [SIH](../sim_sih/index.md). You can additionally install the [Gazebo Classic](../sim_gazebo_classic/index.md) simulator by specifying the command line argument: `--gazebo`. ![Gazebo on Arch](../../assets/simulation/gazebo_classic/arch-gazebo.png) @@ -45,4 +45,4 @@ The script takes the following optional parameters: ::: - `--no-nuttx`: Do not install the NuttX/Pixhawk toolchain (i.e. if only using simulation). -- `--no-sim-tools`: Do not install jMAVSim/Gazebo (i.e. if only targeting Pixhawk/NuttX targets) +- `--no-sim-tools`: Do not install the simulation dependencies (i.e. if only targeting Pixhawk/NuttX targets) diff --git a/docs/en/dev_setup/dev_env_windows_cygwin.md b/docs/en/dev_setup/dev_env_windows_cygwin.md index cc44511da36..48d7930b9c5 100644 --- a/docs/en/dev_setup/dev_env_windows_cygwin.md +++ b/docs/en/dev_setup/dev_env_windows_cygwin.md @@ -14,7 +14,7 @@ The following instructions explain how to set up a (Cygwin-based) PX4 developmen This environment can be used to build PX4 for: - Pixhawk and other NuttX-based hardware -- [jMAVSim Simulation](../sim_jmavsim/index.md) +- jMAVSim simulation (removed from PX4, see the note in [Getting Started](#getting-started)) @@ -68,6 +68,11 @@ The toolchain uses a specially configured console window (started by running the 1. For example, to run JMAVSim: + ::: info + jMAVSim has been removed from PX4, so this example only works with PX4 versions that still include it. + Current PX4 uses [SIH](../sim_sih/index.md) with the [Hawkeye](../sim_hawkeye/index.md) visualizer instead. + ::: + ```sh # Navigate to PX4-Autopilot repo cd Firmware diff --git a/docs/en/dev_setup/dev_env_windows_vm.md b/docs/en/dev_setup/dev_env_windows_vm.md index 13dc7b5b4df..f3f9062be47 100644 --- a/docs/en/dev_setup/dev_env_windows_vm.md +++ b/docs/en/dev_setup/dev_env_windows_vm.md @@ -13,7 +13,7 @@ After setting up the virtual machine, the installation and setup of PX4 within t While using a VM is a very easy way to set up and test an environment for building firmware, users should be aware: 1. Firmware building will be slower than native building on Linux. -2. The JMAVSim simulation, frame rate be much slower than on native Linux. +2. Simulation frame rates will be much slower than on native Linux. In some cases the vehicle may crash due to issues related to insufficient VM resources. 3. Gazebo and ROS can be installed, but are unusably slow. @@ -37,7 +37,7 @@ VMWare performance is acceptable for basic usage (building Firmware) but not for 5. Enable 3D acceleration in the VM's settings: **VM > Settings > Hardware > Display > Accelerate 3D graphics** ::: info - This option is required to properly run 3D simulation environments like jMAVSim and Gazebo Classic. + This option is required to properly run 3D simulation environments like Gazebo and Gazebo Classic. We recommend this is done before installing Linux in the virtual environment. ::: diff --git a/docs/en/releases/main.md b/docs/en/releases/main.md index 36f410a3203..b9ce3a9adef 100644 --- a/docs/en/releases/main.md +++ b/docs/en/releases/main.md @@ -32,6 +32,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide). - `COM_ARM_TRAFF` has been replaced by `COM_TRAFF_AVOID`. The old value 3 ("enforce for mission modes only") is migrated to `COM_TRAFF_AVOID=2`, which blocks arming in all modes, not just mission modes. If you relied on being able to arm manually with traffic detected, set `COM_TRAFF_AVOID=1` (warning only) instead. - `PCA9685_SCHD_HZ` has been removed. `PCA9685_PWM_FREQ` now sets both the PWM frequency of the PCA9685 and the rate at which values are pushed to it; if you had `PCA9685_SCHD_HZ` set to a non-default value, set `PCA9685_PWM_FREQ` to it after upgrading. Frequencies above 400 Hz (previously only usable in duty-cycle mode) are no longer supported. +- **jMAVSim has been removed.** `make px4_sitl jmavsim` and the `10017_jmavsim_iris` airframe (`SYS_AUTOSTART=10017`) no longer exist, and the setup scripts no longer install Java or `ant`. Use [SIH](../sim_sih/index.md) with the [Hawkeye](../sim_hawkeye/index.md) visualizer instead (`make px4_sitl_sih sihsim_quadx`), or [Gazebo](../sim_gazebo_gz/index.md). - **Re-check motor failure handling on hexarotors.** [CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) = `1` now also stops the motor opposite the failed one on a hexarotor (previously only the failed motor was removed from the allocation). Other airframes are unaffected, and `CA_FAILURE_MODE=0` (the default) is unchanged. See [Motor Failure Recovery](../config/motor_failure_recovery.md). ([PX4-Autopilot#28078](https://github.com/PX4/PX4-Autopilot/pull/28078)) ## Other changes @@ -76,6 +77,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### Simulation +- jMAVSim has been removed in favour of [SIH](../sim_sih/index.md) with the [Hawkeye](../sim_hawkeye/index.md) visualizer. See the [Upgrade Guide](#upgrade-guide). - Gazebo: the GNSS failure injection commands (`failure gps off`, `stuck` and `wrong`) now apply to the NavSat data published by the gz bridge, consistent with the other simulator paths. ([PX4-Autopilot#28398](https://github.com/PX4/PX4-Autopilot/pull/28398)) ### Debug & Logging diff --git a/docs/en/ros/mavros_custom_messages.md b/docs/en/ros/mavros_custom_messages.md index a9956836e9e..938b7617bb2 100644 --- a/docs/en/ros/mavros_custom_messages.md +++ b/docs/en/ros/mavros_custom_messages.md @@ -322,10 +322,10 @@ Now you are ready to build all your work! make px4_fmu-v5_default upload ``` - - to build for SITL execute the following command in the root of the PX4-Autopilot directory (using jmavsim simulation): + - to build for SITL execute the following command in the root of the PX4-Autopilot directory (using SIH simulation): ```sh - make px4_sitl jmavsim + make px4_sitl_sih sihsim_quadx ``` ## Running the Code diff --git a/docs/en/ros2/multi_vehicle.md b/docs/en/ros2/multi_vehicle.md index 05a9e695f8c..d35c4da995e 100644 --- a/docs/en/ros2/multi_vehicle.md +++ b/docs/en/ros2/multi_vehicle.md @@ -7,7 +7,7 @@ This is particular useful in simulation as only one agent needs to be started. The only requirements are -- To be able to run [multi-vehicle simulation](../simulation/multi-vehicle-simulation.md) without ROS 2 with the desired simulator ([Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md), [Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md#multiple-vehicle-with-gazebo-classic), [FlightGear](../sim_flightgear/multi_vehicle.md) and [JMAVSim](../sim_jmavsim/multi_vehicle.md)). +- To be able to run [multi-vehicle simulation](../simulation/multi-vehicle-simulation.md) without ROS 2 with the desired simulator ([Gazebo](../sim_gazebo_gz/multi_vehicle_simulation.md), [Gazebo Classic](../sim_gazebo_classic/multi_vehicle_simulation.md#multiple-vehicle-with-gazebo-classic), [FlightGear](../sim_flightgear/multi_vehicle.md) and [SIH](../sim_sih/index.md#multi-vehicle-simulation)). - To be able to use [ROS 2](../ros2/user_guide.md) in a single vehicle simulation. ## Principle of Operation diff --git a/docs/en/sim_jmavsim/index.md b/docs/en/sim_jmavsim/index.md index 3603e9a0ad9..02b6dd42319 100644 --- a/docs/en/sim_jmavsim/index.md +++ b/docs/en/sim_jmavsim/index.md @@ -1,399 +1 @@ -# jMAVSim with SITL - -:::warning -This simulator is [community supported and maintained](../simulation/community_supported_simulators.md). -It may or may not work with current versions of PX4 and may be removed in future releases. - -See [Toolchain Installation](../dev_setup/dev_env.md) for information about the environments and tools supported by the core development team. -::: - -jMAVSim is a simple multirotor/Quad simulator that allows you to fly _copter_ type vehicles running PX4 around a simulated world. -It is easy to set up and can be used to test that your vehicle can take off, fly, land, and responds appropriately to various fail conditions (e.g. GPS failure). - -Supported Vehicles: - -- Quad - -This topic shows how to set up jMAVSim to connect with a SITL version of PX4. - -:::tip -jMAVSim can also be used for HITL Simulation ([as shown here](../simulation/hitl.md#jmavsim-quadrotor-only)). -::: - -## Installation - -jMAVSim requires JDK 17 or later. -On Ubuntu and Windows, the [standard development environment setup](../dev_setup/dev_env.md) scripts install all required dependencies including Java. -On macOS, `./Tools/setup/macos.sh --sim-tools` installs a suitable JDK and links it into `/Library/Java/JavaVirtualMachines` (see [macOS Development Environment](../dev_setup/dev_env_mac.md)). -If you set up without `--sim-tools`, install Java manually as shown below. - -### macOS - -jMAVSim requires OpenJDK 17 or later. -Install it via Homebrew: - -```sh -brew install openjdk@17 -``` - -Homebrew installs OpenJDK but does not link it into your `PATH`, so you need to set `JAVA_HOME` for jMAVSim to find it. -Add this to your shell profile (e.g. `~/.zshrc`): - -```sh -export JAVA_HOME=$(/usr/libexec/java_home -v 17) -``` - -## Simulation Environment - -Software in the Loop Simulation runs the complete system on the host machine and simulates the autopilot. -It connects via local network to the simulator. -The setup looks like this: - -[![Mermaid graph: SITL Simulator](https://mermaid.ink/img/eyJjb2RlIjoiZ3JhcGggTFI7XG4gIFNpbXVsYXRvci0tPk1BVkxpbms7XG4gIE1BVkxpbmstLT5TSVRMOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9)](https://mermaid-js.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggTFI7XG4gIFNpbXVsYXRvci0tPk1BVkxpbms7XG4gIE1BVkxpbmstLT5TSVRMOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In0sInVwZGF0ZUVkaXRvciI6ZmFsc2V9) - - - -## Running SITL - -After ensuring that the [simulation prerequisites](../dev_setup/dev_env.md) are installed on the system, just launch: The convenience make target will compile the POSIX host build and run the simulation. - -```sh -make px4_sitl_default jmavsim -``` - -This will bring up the PX4 shell: - -```sh -[init] shell id: 140735313310464 -[init] task name: px4 - -______ __ __ ___ -| ___ \ \ \ / / / | -| |_/ / \ V / / /| | -| __/ / \ / /_| | -| | / /^\ \ \___ | -\_| \/ \/ |_/ - -Ready to fly. - - -pxh> -``` - -It will also bring up a window showing a 3D view of the [jMAVSim](https://github.com/PX4/jMAVSim) simulator: - -![jMAVSim 3d View](../../assets/simulation/jmavsim/jmavsim.jpg) - -## Taking it to the Sky - -The system will start printing status information. -You will be able to start flying once you have a position lock (shortly after the console displays the message: _EKF commencing GPS fusion_). - -To takeoff enter the following into the console: - -```sh -pxh> commander takeoff -``` - -You can use _QGroundControl_ to fly a mission or to connect to a [joystick](#using-a-joystick). - -## Usage/Configuration Options - -Options that apply to all simulators are covered in the top level [Simulation](../simulation/index.md#sitl-simulation-environment) topic (some of these may be duplicated below). - -### Simulating Sensor/Hardware Failure - -[Simulate Failsafes](../simulation/failsafes.md) explains how to trigger safety failsafes like GPS failure and battery drain. - -### Set Custom Takeoff Location - -The default takeoff location in can be overridden using the environment variables: `PX4_HOME_LAT`, `PX4_HOME_LON`, and `PX4_HOME_ALT`. - -For example, to set the latitude, longitude and altitude: - -```sh -export PX4_HOME_LAT=28.452386 -export PX4_HOME_LON=-13.867138 -export PX4_HOME_ALT=28.5 -make px4_sitl_default jmavsim -``` - -### Change Simulation Speed - -The simulation speed can be increased or decreased with respect to realtime using the environment variable `PX4_SIM_SPEED_FACTOR`. - -To run at double real-time: - -```sh -PX4_SIM_SPEED_FACTOR=2 make px4_sitl_default jmavsim -``` - -To run at half real-time: - -```sh -PX4_SIM_SPEED_FACTOR=0.5 make px4_sitl_default jmavsim -``` - -To apply a factor to all SITL runs in the current session, use `EXPORT`: - -```sh -export PX4_SIM_SPEED_FACTOR=2 -make px4_sitl_default jmavsim -``` - -### Using a Joystick - -Joystick and thumb-joystick support are supported through _QGroundControl_ ([setup instructions here](../simulation/index.md#joystick-gamepad-integration)). - -### Simulating a Wifi Drone - -There is a special target to simulate a drone connected via Wifi on the local network: - -```sh -make broadcast jmavsim -``` - -The simulator broadcasts its address on the local network as a real drone would do. - -### Start JMAVSim and PX4 Separately - -You can start JMAVSim and PX4 separately: - -```sh -./Tools/simulation/jmavsim/jmavsim_run.sh -l -make px4_sitl none -``` - -This allows a faster testing cycle (restarting jMAVSim takes significantly more time). - -### Headless Mode - -To start jMAVSim without the GUI, set the env variable `HEADLESS=1` as shown: - -```sh -HEADLESS=1 make px4_sitl jmavsim -``` - -## Multi-Vehicle Simulation - -JMAVSim can be used for multi-vehicle simulation: [Multi-Vehicle Sim with JMAVSim](../sim_jmavsim/multi_vehicle.md). - -## Lockstep - -PX4 SITL and jMAVSim have been set up to run in _lockstep_. -What this means is that PX4 and the simulator run at the same speed, and therefore can react appropriately to sensor and actuator messages. -Lockstep makes it possible to [change the simulation speed](#change-simulation-speed), and also to pause it in order to step through code. - -#### Lockstep Sequence - -The sequence of steps for lockstep are: - -1. The simulation sends a sensor message [HIL_SENSOR](https://mavlink.io/en/messages/common.html#HIL_SENSOR) including a timestamp `time_usec` to update the sensor state and time of PX4. -2. PX4 receives this and does one iteration of state estimation, controls, etc. and eventually sends an actuator message [HIL_ACTUATOR_CONTROLS](https://mavlink.io/en/messages/common.html#HIL_ACTUATOR_CONTROLS). -3. The simulation waits until it receives the actuator/motor message, then simulates the physics and calculates the next sensor message to send to PX4 again. - -The system starts with a "freewheeling" period where the simulation sends sensor messages including time and therefore runs PX4 until it has initialized and responds with an actuator message. - -#### Disabling Lockstep - -The lockstep simulation can be disabled if, for example, SITL is to be used with a simulator that does not support this feature. -In this case the simulator and PX4 use the host system time and do not wait on each other. - -To disable lockstep in: - -- PX4, run `make px4_sitl_default boardconfig` and set the `BOARD_NOLOCKSTEP` "Force disable lockstep" symbol which is located under toolchain. -- jMAVSim, remove `-l` in [sitl_run.sh](https://github.com/PX4/PX4-Autopilot/blob/main/Tools/simulation/jsbsim/sitl_run.sh#L40), or make sure otherwise that the java binary is started without the `-lockstep` flag. - - - - - -## Extending and Customizing - -To extend or customize the simulation interface, edit the files in the **Tools/jMAVSim** folder. -The code can be accessed through the[jMAVSim repository](https://github.com/px4/jMAVSim) on Github. - -::: info -The build system enforces the correct submodule to be checked out for all dependencies, including the simulator. -It will not overwrite changes in files in the directory, however, when these changes are committed the submodule needs to be registered in the Firmware repo with the new commit hash. -To do so, `git add Tools/jMAVSim` and commit the change. -This will update the GIT hash of the simulator. -::: - -## Interfacing to ROS - -The simulation can be [interfaced to ROS](../simulation/ros_interface.md) the same way as onboard a real vehicle. - -## Important Files - -- The startup scripts are discussed in [System Startup](../concept/system_startup.md). -- The simulated root file system ("`/`" directory) is created inside the build directory here: `build/px4_sitl_default/rootfs`. - -## Display-Only Mode - -jMAVSim can run as a display-only renderer for other simulators (like [SIH](../sim_sih/index.md)), with its internal physics disabled. -In this mode, jMAVSim receives vehicle position via MAVLink and only renders the 3D view. - -To use jMAVSim as a display for SIH running in SITL: - -```sh -# Start SIH first -make px4_sitl_sih sihsim_quadx - -# In another terminal, start jMAVSim in display-only mode -./Tools/simulation/jmavsim/jmavsim_run.sh -p 19410 -u -q -o # 19410 is the default SIH display port -``` - -For SIH running on flight controller hardware: - -```sh -./Tools/simulation/jmavsim/jmavsim_run.sh -q -d /dev/ttyACM0 -b 2000000 -o -``` - -Use `-a` for airplane display or `-t` for tailsitter display. - -## Command-Line Reference - -The `jmavsim_run.sh` launch script accepts the following flags: - -| Flag | Description | -| ------------- | ------------------------------------------------ | -| `-b ` | Serial baud rate (default: 921600) | -| `-d ` | Serial device path (e.g., `/dev/ttyACM0`) | -| `-u` | Use UDP connection instead of serial | -| `-i ` | Simulated MAVLink system ID | -| `-p ` | UDP port (default: 14560) | -| `-q` | No interactive console | -| `-s ` | TCP serial port | -| `-r ` | Render rate in Hz | -| `-l` | Enable lockstep | -| `-o` | Display-only mode (disable physics, render only) | -| `-a` | Use airplane model | -| `-t` | Use tailsitter model | -| `HEADLESS=1` | Environment variable: run without GUI window | - -## How jMAVSim Works - -jMAVSim is a Java-based lightweight simulator that communicates with PX4 via MAVLink HIL (Hardware-In-the-Loop) messages. - -In normal mode: - -1. PX4 sends actuator commands via [HIL_ACTUATOR_CONTROLS](https://mavlink.io/en/messages/common.html#HIL_ACTUATOR_CONTROLS). -2. jMAVSim runs its physics engine to compute the vehicle state. -3. jMAVSim sends sensor data back via [HIL_SENSOR](https://mavlink.io/en/messages/common.html#HIL_SENSOR) and [HIL_GPS](https://mavlink.io/en/messages/common.html#HIL_GPS). - -In **display-only mode** (`-o` flag), jMAVSim disables its physics engine and only reads [HIL_STATE_QUATERNION](https://mavlink.io/en/messages/common.html#HIL_STATE_QUATERNION) messages to render the vehicle position. -This allows it to visualize vehicles from other simulators like SIH. - -jMAVSim supports [lockstep synchronization](#lockstep) with PX4 (enabled with `-l` flag), ensuring deterministic simulation results. - -## Keyboard Shortcuts - -Camera modes in the jMAVSim 3D view: - -| Key | Camera Mode | -| ------------- | ------------------------------------ | -| **F** | First person (attached to vehicle) | -| **S** | Stationary (fixed position) | -| **G** | Gimbal (follows vehicle orientation) | -| **(default)** | Third person follow | - -## Troubleshooting - -### java.long.NoClassDefFoundError - -```sh -Exception in thread "main" java.lang.NoClassDefFoundError: javax/vecmath/Tuple3d -at java.base/java.lang.Class.forName0(Native Method) -at java.base/java.lang.Class.forName(Class.java:374) -at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56) -Caused by: java.lang.ClassNotFoundException: javax.vecmath.Tuple3d -at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) -... 3 more -Exception in thread "main" java.lang.NoClassDefFoundError: javax/vecmath/Tuple3d -at java.base/java.lang.Class.forName0(Native Method) -at java.base/java.lang.Class.forName(Class.java:374) -at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56) -Caused by: java.lang.ClassNotFoundException: javax.vecmath.Tuple3d -at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566) -at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) -``` - -This error should no longer occur once the jMAVSim submodule is [updated to newer jar libs](https://github.com/PX4/jMAVSim/pull/119) and Java 11 or Java 14 should work fine. - -### An illegal reflective access operation has occurred - -This warning can be ignored (it will probably be displayed but the simulation will still work correctly). - -```sh -WARNING: An illegal reflective access operation has occurred -WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (rsrc:j3dcore.jar) to method sun.awt.AppContext.getAppContext() -WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline -WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations -WARNING: All illegal access operations will be denied in a future release -Inconsistency detected by ld.so: dl-lookup.c: 112: check_match: Assertion version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed! -``` - -### java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper - -```sh -Exception in thread "main" java.lang.reflect.InvocationTargetException -at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) -at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) -at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) -at java.lang.reflect.Method.invoke(Method.java:498) -at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) -Caused by: java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper -at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807) -at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886) -at java.awt.Window.getToolkit(Window.java:1358) -at java.awt.Window.init(Window.java:506) -at java.awt.Window.(Window.java:537) -at java.awt.Frame.(Frame.java:420) -at java.awt.Frame.(Frame.java:385) -at javax.swing.JFrame.(JFrame.java:189) -at me.drton.jmavsim.Visualizer3D.(Visualizer3D.java:104) -at me.drton.jmavsim.Simulator.(Simulator.java:157) -at me.drton.jmavsim.Simulator.main(Simulator.java:678) -``` - -If you see this error, try this workaround: - -Edit the **accessibility.properties** file: - -```sh -sudo gedit /etc/java-8-openjdk/accessibility.properties -``` - -and comment out the line indicated below: - -```sh -#assistive_technologies=org.GNOME.Accessibility.AtkWrapper -``` - -For more info, check [this GitHub issue](https://github.com/PX4/PX4-Autopilot/issues/9557). -A contributor found the fix in [askubuntu.com](https://askubuntu.com/questions/695560/assistive-technology-not-found-awterror). - -### Exception in thread "main" java.lang.UnsupportedClassVersionError - -When compiling jMAVsim, you might encounter the following error: - -```sh -Exception in thread "main" java.lang.UnsupportedClassVersionError: me/drton/jmavsim/Simulator has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 58.0 -``` - -This error is telling you, you need a more recent version of Java in your environment. -Class file version 58 corresponds to jdk14, version 59 to jdk15, version 60 to jdk 16 etc. - -To fix it under macOS, install a newer OpenJDK via Homebrew: - -```sh -brew install openjdk@17 -``` + diff --git a/docs/en/sim_jmavsim/multi_vehicle.md b/docs/en/sim_jmavsim/multi_vehicle.md index 68b8a7217de..f290cdc9e72 100644 --- a/docs/en/sim_jmavsim/multi_vehicle.md +++ b/docs/en/sim_jmavsim/multi_vehicle.md @@ -1,53 +1 @@ -# Multi-Vehicle Simulation with JMAVSim - -This topic explains how to simulate multiple UAV (multicopter) vehicles using [JMAVSim](../sim_jmavsim/index.md) and SITL. -All vehicle instances are started at the same position in the simulation. - -:::tip -This is the easiest way to simulate multiple vehicles running PX4. -It is suitable for testing multi-vehicle support in _QGroundControl_ (or the [MAVSDK](https://mavsdk.mavlink.io/), etc.). -[Multi-Vehicle Simulation with Gazebo](../simulation/multi-vehicle-simulation.md) should be used for swarm simulations with many vehicles, or for testing features like computer vision that are only supported by Gazebo. -::: - -## How to Start Multiple Instances - -To start multiple instances (on separate ports): - -1. Build PX4 - - ```sh - make px4_sitl_default - ``` - -1. Run **sitl_multiple_run.sh**, specifying the number of instances to start (e.g. 2): - - ```sh - ./Tools/sitl_multiple_run.sh 2 - ``` - -1. Start the first instance in the same terminal (this will run in the foreground): - - ```sh - ./Tools/simulation/jmavsim/jmavsim_run.sh -l - ``` - -1. Open a new terminal for each subsequent instance, specifying the _simulation_ TCP port for the instance: - - ```sh - ./Tools/simulation/jmavsim/jmavsim_run.sh -p 4560 -l - ``` - - The port should be set to `4560+i` where `i` iterates for each instance (from `0` to `N-1`) - -_QGroundControl_ should automatically connect to all the new vehicle instances (all GCS traffic is sent to PX4's remote UDP port: `14550` from all instances). -The vehicle that is currently being controlled is displayed in the application to bar; you can select this vehicle text to display a selection list of all of the (simulated) connected vehicle instances (`Vehicle 1`, `Vehicle 2`, etc.) and choose a new vehicle to control. - -Developer APIs such as _MAVSDK_ or _MAVROS_ can connect to individual instances by listening on sequentially allocated PX4 remote UDP ports from `14540` (first instance) to `14549`. -Additional instances _all_ connect to port `14549`. - -> **Tip** The **sitl_multiple_run.sh** script starts a separate process for each vehicle. -> To restart the simulations after killing one of them, you must call **sitl_multiple_run.sh** again, and also restart each of the individual instances in their own terminals. - -## Additional Resources - -- See [Simulation](../simulation/index.md) for more information about the port configuration. + diff --git a/docs/en/sim_sih/hardware.md b/docs/en/sim_sih/hardware.md index 8d9cba7304e..e3c63027af5 100644 --- a/docs/en/sim_sih/hardware.md +++ b/docs/en/sim_sih/hardware.md @@ -94,7 +94,6 @@ You can add SIH to any board -- see [Check if SIH is in Firmware](#check-if-sih- - A flight controller with SIH module included in firmware (see [Firmware Builds with SIH](#firmware-builds-with-sih)). - USB connection for QGroundControl. -- Optional: jMAVSim for 3D visualization via serial link (see [Visualization](#hardware-visualization)). ## Check if SIH is in Firmware @@ -115,16 +114,24 @@ If you need a visual aid to see what the simulated vehicle is doing on hardware: Connect the flight controller via USB. QGC shows the vehicle on the map view with attitude, position, and telemetry, the same as a real flight. -### jMAVSim (3D Display-Only) +### Hawkeye (3D Display-Only) -jMAVSim can render a 3D view of the vehicle over a serial connection. No physics are simulated in jMAVSim -- it is display-only. +[Hawkeye](../sim_hawkeye/index.md) can render a 3D view of the vehicle from the [HIL_STATE_QUATERNION](https://mavlink.io/en/messages/common.html#HIL_STATE_QUATERNION) messages SIH sends. +No physics are simulated in Hawkeye: it is display-only. + +Hawkeye listens on UDP, so bridge the flight controller's serial link to UDP port 19410 (for example with [MAVProxy](https://ardupilot.org/mavproxy/)), then start Hawkeye: ```sh -./Tools/simulation/jmavsim/jmavsim_run.sh -q -d /dev/ttyACM0 -b 2000000 -o +# Terminal 1 +mavproxy.py --master /dev/ttyACM0 --out udp:localhost:19410 --out udp:localhost:14550 + +# Terminal 2 +hawkeye ``` Where `/dev/ttyACM0` is the serial device for the flight controller. On macOS, this is typically `/dev/tty.usbmodem*`. +The second `--out` keeps QGroundControl connected on its default port. ## Controlling Actuators diff --git a/docs/en/simulation/community_supported_simulators.md b/docs/en/simulation/community_supported_simulators.md index adacb2d9b08..ef29d46b4a6 100644 --- a/docs/en/simulation/community_supported_simulators.md +++ b/docs/en/simulation/community_supported_simulators.md @@ -16,7 +16,6 @@ Questions about these tools should be raised on the [discussion forums](../contr | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [AirSim](../sim_airsim/index.md) |

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 Setup - jMAVSim and Gazebo Classic](../../assets/simulation/px4_hitl_overview_jmavsim_gazebo.svg) +![HITL Setup - Gazebo Classic](../../assets/simulation/px4_hitl_overview_jmavsim_gazebo.svg) ## 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).