diff --git a/.gitmodules b/.gitmodules index 6f82656ddf5..b538c19b158 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,10 +2,6 @@ path = src/modules/mavlink/mavlink url = https://github.com/mavlink/mavlink.git branch = master -[submodule "Tools/simulation/jmavsim/jMAVSim"] - path = Tools/simulation/jmavsim/jMAVSim - url = https://github.com/PX4/jMAVSim.git - branch = main [submodule "Tools/simulation/gazebo-classic/sitl_gazebo-classic"] path = Tools/simulation/gazebo-classic/sitl_gazebo-classic url = https://github.com/PX4/PX4-SITL_gazebo-classic.git diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 80490d515f5..f6ef97a912c 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -49,23 +49,6 @@ "group": "test" } }, - { - "label": "jmavsim kill", - "type": "shell", - "command": "kill $(ps aux | grep jmavsim | grep -v 'grep' | awk '{print $2}') || true", - "presentation": { - "echo": true, - "reveal": "never", - "revealProblems": "onProblem", - "focus": false, - "panel": "dedicated", - "showReuseMessage": false, - "clear": false, - "close": true - }, - "problemMatcher": [], - "dependsOn":["px4_sitl_cleanup"] - }, { "label": "gazebo-classic build", "type": "shell", diff --git a/ROMFS/px4fmu_common/init.d-posix/CMakeLists.txt b/ROMFS/px4fmu_common/init.d-posix/CMakeLists.txt index ab830be4da7..7ab1a751dfa 100644 --- a/ROMFS/px4fmu_common/init.d-posix/CMakeLists.txt +++ b/ROMFS/px4fmu_common/init.d-posix/CMakeLists.txt @@ -37,7 +37,6 @@ px4_add_romfs_files( px4-rc.mavlink px4-rc.simulator px4-rc.gzsim - px4-rc.jmavsim px4-rc.mavlinksim px4-rc.sihsim px4-rc.rotorpy diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/10017_jmavsim_iris b/ROMFS/px4fmu_common/init.d-posix/airframes/10017_jmavsim_iris deleted file mode 100644 index 4cd88cc111d..00000000000 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/10017_jmavsim_iris +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# @name 3DR Iris Quadrotor SITL jMAVSim -# -# @type Quadrotor Wide -# -# @maintainer Julian Oes -# - -. ${R}etc/init.d/rc.mc_defaults - -param set-default CA_AIRFRAME 0 - -param set-default CA_ROTOR_COUNT 4 -param set-default CA_ROTOR0_PX 0.1515 -param set-default CA_ROTOR0_PY 0.245 -param set-default CA_ROTOR0_KM 0.05 -param set-default CA_ROTOR1_PX -0.1515 -param set-default CA_ROTOR1_PY -0.1875 -param set-default CA_ROTOR1_KM 0.05 -param set-default CA_ROTOR2_PX 0.1515 -param set-default CA_ROTOR2_PY -0.245 -param set-default CA_ROTOR2_KM -0.05 -param set-default CA_ROTOR3_PX -0.1515 -param set-default CA_ROTOR3_PY 0.1875 -param set-default CA_ROTOR3_KM -0.05 - -param set-default PWM_MAIN_FUNC1 101 -param set-default PWM_MAIN_FUNC2 102 -param set-default PWM_MAIN_FUNC3 103 -param set-default PWM_MAIN_FUNC4 104 diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/5010_xplane_ehang184 b/ROMFS/px4fmu_common/init.d-posix/airframes/5010_xplane_ehang184 index 7068ab638ce..817167f2dc7 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/5010_xplane_ehang184 +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/5010_xplane_ehang184 @@ -133,7 +133,7 @@ param set-default EKF2_ABL_ACCLIM 35.0 param set-default EKF2_ACC_NOISE 1.0 # Better accelerometer trust param set-default EKF2_ACC_B_NOISE 0.001 # Accel bias damping for frame-paced SITL updates -# X-PLANE SITL NOTE: EKF2_ABL_LIM = 2.5 (vs Gazebo/jMAVSim default 0.4) +# X-PLANE SITL NOTE: EKF2_ABL_LIM = 2.5 (vs Gazebo default 0.4) # Required because X-Plane sensor updates are frame-paced and can vary with # rendering load, which can make EKF2 estimate higher acceleration bias. # This does NOT affect flight performance - only the preflight arming check. diff --git a/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt b/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt index ce93573d155..84ca19e30b7 100644 --- a/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt +++ b/ROMFS/px4fmu_common/init.d-posix/airframes/CMakeLists.txt @@ -102,7 +102,6 @@ px4_add_romfs_files( 10015_gazebo-classic_iris 10016_none_iris - 10017_jmavsim_iris 10018_gazebo-classic_iris_foggy_lidar 10019_gazebo-classic_omnicopter 10030_gazebo-classic_px4vision diff --git a/ROMFS/px4fmu_common/init.d-posix/px4-rc.jmavsim b/ROMFS/px4fmu_common/init.d-posix/px4-rc.jmavsim deleted file mode 100644 index bb488d2c52e..00000000000 --- a/ROMFS/px4fmu_common/init.d-posix/px4-rc.jmavsim +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC2154 - -echo "INFO [init] jMAVSim simulator" - -if jps | grep -i jmavsim; then - kill "$(jps | grep -i jmavsim | awk '{print $1}')" || true - sleep 1 -fi - -param set IMU_INTEG_RATE 250 -./jmavsim_run.sh -l -r 250 & - -simulator_mavlink start -h localhost $((4560+px4_instance)) diff --git a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator index d1d91f837fe..2907f4d9e1b 100644 --- a/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator +++ b/ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator @@ -23,10 +23,6 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then # Run Gazebo (gz) . px4-rc.gzsim -elif [ "$PX4_SIM_MODEL" = "jmavsim_iris" ] || [ "$(param show -q SYS_AUTOSTART)" -eq "10017" ]; then - # Run jMAVSim - . px4-rc.jmavsim - elif [ "$PX4_SIMULATOR" = "xplane" ]; then # Run X-Plane through the mavlink simulator bridge . px4-rc.mavlinksim diff --git a/Tools/packaging/containers/Dockerfile.sih b/Tools/packaging/containers/Dockerfile.sih index 9f70a19d249..5a95dc091a6 100644 --- a/Tools/packaging/containers/Dockerfile.sih +++ b/Tools/packaging/containers/Dockerfile.sih @@ -56,7 +56,7 @@ RUN chmod +x /opt/px4/bin/px4-entrypoint.sh ENV PX4_SIM_MODEL=sihsim_quadx ENV HOME=/root -# MAVLink (QGC, MAVSDK), DDS (ROS 2), jMAVSim/viewer display +# MAVLink (QGC, MAVSDK), DDS (ROS 2), Hawkeye viewer display EXPOSE 14550/udp 14540/udp 19410/udp 8888/udp WORKDIR /root diff --git a/Tools/setup/arch.sh b/Tools/setup/arch.sh index 1ab164b2aaf..9b1e947bb24 100755 --- a/Tools/setup/arch.sh +++ b/Tools/setup/arch.sh @@ -4,9 +4,9 @@ ## Tested on Arch 2023-03-01 ## ## Installs: -## - Common dependencies and tools for nuttx, jMAVSim +## - Common dependencies and tools for nuttx ## - NuttX toolchain (omit with arg: --no-nuttx) -## - jMAVSim simulator (omit with arg: --no-sim-tools) +## - Simulation dependencies (omit with arg: --no-sim-tools) ## - Gazebo simulator (not by default, use --gazebo) ## @@ -93,11 +93,6 @@ if [[ $INSTALL_SIM == "true" ]]; then echo echo "Installing PX4 simulation dependencies" - # java (jmavsim) - sudo pacman -S --noconfirm --needed \ - ant \ - ; - # Gazebo setup if [[ $INSTALL_GAZEBO == "true" ]]; then echo diff --git a/Tools/setup/macos.sh b/Tools/setup/macos.sh index c92b97c4287..27cf0f248ea 100755 --- a/Tools/setup/macos.sh +++ b/Tools/setup/macos.sh @@ -6,7 +6,7 @@ ## Installs: ## - Common dependencies and tools for building PX4 ## - Cross compilers for building hardware targets using NuttX -## - With --sim-tools: Gazebo Harmonic and jMAVSim simulation stack +## - With --sim-tools: Gazebo Harmonic simulation stack ## ## --sim-tools pins the osrf/simulation tap to gz-tap-pin.txt so Gazebo ## installs from bottles even while OSRF has them pulled, and protobuf to @@ -99,7 +99,6 @@ brew_tap PX4/px4 # Package list. This replaces the px4-dev meta-formula, which is kept # as a deprecated no-op upstream. See PX4/homebrew-px4 for history. PX4_BREW_PACKAGES=( - ant astyle bash-completion ccache @@ -283,13 +282,6 @@ if [[ $INSTALL_SIM == "--sim-tools" ]]; then # XQuartz is not in the pinned package repos. env -u HOMEBREW_NO_INSTALL_FROM_API brew install --cask xquartz fi - - # jMAVSim requires a JDK (Java 17 LTS recommended) - if ! brew ls --versions openjdk@17 > /dev/null; then - echo "[macos.sh] Installing OpenJDK 17 (required for jMAVSim)" - brew install openjdk@17 - sudo ln -sfn $(brew --prefix openjdk@17)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk - fi fi echo "" diff --git a/Tools/simulation/jmavsim/jMAVSim b/Tools/simulation/jmavsim/jMAVSim deleted file mode 160000 index 665b26d62d3..00000000000 --- a/Tools/simulation/jmavsim/jMAVSim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 665b26d62d36a33b6bf01c5931c589beb812c6a2 diff --git a/Tools/simulation/jmavsim/jmavsim_run.sh b/Tools/simulation/jmavsim/jmavsim_run.sh deleted file mode 100755 index 285b013ae08..00000000000 --- a/Tools/simulation/jmavsim/jmavsim_run.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -set -e - -SCRIPT_DIR=$(dirname $(readlink -f "$BASH_SOURCE")) - -cd "$SCRIPT_DIR/jMAVSim" - -port=4560 -extra_args= -baudrate=921600 -device= -ip="127.0.0.1" -protocol="tcp" -while getopts "b:d:ui:p:qsr:loat" opt; do - case $opt in - b) - baudrate=$OPTARG - ;; - d) - device="$OPTARG" - ;; - u) - protocol="udp" - ;; - i) - ip="$OPTARG" - ;; - p) - port=$OPTARG - ;; - q) - extra_args="$extra_args -qgc" - ;; - s) - extra_args="$extra_args -sdk" - ;; - r) - extra_args="$extra_args -r $OPTARG" - ;; - l) - extra_args="$extra_args -lockstep" - ;; - o) - extra_args="$extra_args -disponly" - ;; - a) - extra_args="$extra_args -fw" # aircraft model - ;; - t) - extra_args="$extra_args -ts" # tailsitter model - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - exit 1 - ;; - esac -done - -if [ "$device" == "" ]; then - if [ "$protocol" == "tcp" ]; then - device="-tcp $ip:$port" - else - device="-udp $port" - fi -else - device="-serial $device $baudrate" -fi - -if [ "$HEADLESS" = "1" ]; then - extra_args="$extra_args -no-gui" -fi - -ant create_run_jar copy_res -cd out/production - -java --add-exports java.base/java.lang=ALL-UNNAMED --add-exports java.desktop/sun.awt=ALL-UNNAMED --add-exports java.desktop/sun.java2d=ALL-UNNAMED \ - -XX:GCTimeRatio=20 -Djava.ext.dirs= -jar jmavsim_run.jar $device $extra_args diff --git a/boards/modalai/voxl2/src/drivers/qurt/dsp_hitl/dsp_hitl.cpp b/boards/modalai/voxl2/src/drivers/qurt/dsp_hitl/dsp_hitl.cpp index 0a455fe3396..c444bfea734 100644 --- a/boards/modalai/voxl2/src/drivers/qurt/dsp_hitl/dsp_hitl.cpp +++ b/boards/modalai/voxl2/src/drivers/qurt/dsp_hitl/dsp_hitl.cpp @@ -312,7 +312,7 @@ void send_actuator_data() actuator_sent_counter++; - if (_debug) { PX4_INFO("Successful write of actuator back to jMAVSim: %d at %llu", writeRetval, hrt_absolute_time()); } + if (_debug) { PX4_INFO("Successful write of actuator back to the simulator: %d at %llu", writeRetval, hrt_absolute_time()); } first_sent = true; @@ -327,7 +327,7 @@ void send_actuator_data() actuator_sent_counter++; - if (_debug) { PX4_INFO("Successful write of actuator back to jMAVSim: %d at %llu", writeRetval, hrt_absolute_time()); } + if (_debug) { PX4_INFO("Successful write of actuator back to the simulator: %d at %llu", writeRetval, hrt_absolute_time()); } send_esc_status(hil_act_control); } diff --git a/boards/modalai/voxl2/target/voxl-px4-sih-start b/boards/modalai/voxl2/target/voxl-px4-sih-start index 02d33d2e0bd..605dfed0786 100755 --- a/boards/modalai/voxl2/target/voxl-px4-sih-start +++ b/boards/modalai/voxl2/target/voxl-px4-sih-start @@ -88,7 +88,7 @@ mavlink stream -u 14556 -s HEARTBEAT -r 10 # start the slow normal mode for voxl-mavlink-server to forward to GCS mavlink start -x -u 14558 -o 14559 -r 100000 -n lo -# Start the jmavsim visualization stream. Change -t ip address to your desired endpoint +# Start the SIH visualization stream for Hawkeye (run `hawkeye -udp 14560` on the endpoint). Change -t ip address to your desired endpoint # TODO: Should go through voxl-mavlink-server, not just direct like this # mavlink start -x -u 14560 -o 14560 -r 4000000 -t 192.168.101.1 -m minimal # mavlink stream -u 14560 -s HIL_STATE_QUATERNION -r 200 diff --git a/cmake/mavsdk_tests.cmake b/cmake/mavsdk_tests.cmake index ad619e740f5..0a2ef6533f9 100644 --- a/cmake/mavsdk_tests.cmake +++ b/cmake/mavsdk_tests.cmake @@ -33,7 +33,7 @@ # mavsdk_tests is a black-box MAVLink integration-test driver that talks to a # running PX4 over UDP. It does not depend on any specific simulator backend -# (sitl_gazebo-classic, gz, sih, jmavsim, ...) — it just needs a PX4 binary +# (sitl_gazebo-classic, gz, sih, ...): it just needs a PX4 binary # to be running. Defined here at the top level rather than under any sitl # backend file so the dependency graph is honest. include(ExternalProject) diff --git a/platforms/posix/Debug/launch_sitl.json.in b/platforms/posix/Debug/launch_sitl.json.in index 6703f429034..0d518da56e6 100644 --- a/platforms/posix/Debug/launch_sitl.json.in +++ b/platforms/posix/Debug/launch_sitl.json.in @@ -131,47 +131,6 @@ ] } }, - { - "name": "SITL (jmavsim_iris SYS_AUTOSTART=10017)", - "type": "cppdbg", - "request": "launch", - "program": "${command:cmake.launchTargetPath}", - "args": [ - "${workspaceFolder}/ROMFS/px4fmu_common" - ], - "stopAtEntry": false, - "cwd": "${command:cmake.buildDirectory}/rootfs", - "environment": [ - { - "name": "PX4_SYS_AUTOSTART", - "value": "10017" - } - ], - "postDebugTask": "jmavsim kill", - "linux": { - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - }, - { - "description": "PX4 ignore wq signals", - "text": "handle SIGCONT nostop noprint nopass", - "ignoreFailures": true - } - ] - }, - "osx": { - "MIMode": "lldb", - "setupCommands": [ - { - "text": "pro hand -p true -s false -n false SIGCONT", - } - ] - } - }, { "name": "SITL (shell)", "type": "cppdbg", diff --git a/posix-configs/rpi/px4_hil.config b/posix-configs/rpi/px4_hil.config index bdd987e8019..a1617c23356 100644 --- a/posix-configs/rpi/px4_hil.config +++ b/posix-configs/rpi/px4_hil.config @@ -4,8 +4,6 @@ . px4-alias.sh # HITL configuration -# connect to it with jMAVSim: -# ./Tools/simulation/jmavsim/jmavsim_run.sh -q -i -p 14577 -r 250 param select parameters.bson param import diff --git a/src/modules/mc_raptor/README.md b/src/modules/mc_raptor/README.md index 753187b43e2..d49f71a6f9c 100644 --- a/src/modules/mc_raptor/README.md +++ b/src/modules/mc_raptor/README.md @@ -67,9 +67,9 @@ param save reboot ``` -New terminal: +New terminal (visualization, see [Hawkeye](https://docs.px4.io/main/en/sim_hawkeye/)): ```bash -./Tools/simulation/jmavsim/jmavsim_run.sh -u -p 13337 -o +hawkeye -udp 13337 ``` diff --git a/src/modules/simulation/simulator_mavlink/CMakeLists.txt b/src/modules/simulation/simulator_mavlink/CMakeLists.txt index 749cc22cf57..dde2afab5e3 100644 --- a/src/modules/simulation/simulator_mavlink/CMakeLists.txt +++ b/src/modules/simulation/simulator_mavlink/CMakeLists.txt @@ -58,7 +58,6 @@ px4_add_module( include(sitl_targets_flightgear.cmake) include(sitl_targets_gazebo-classic.cmake) -include(sitl_targets_jmavsim.cmake) include(sitl_targets_jsbsim.cmake) include(sitl_targets_xplane.cmake) diff --git a/src/modules/simulation/simulator_mavlink/SimulatorMavlink.hpp b/src/modules/simulation/simulator_mavlink/SimulatorMavlink.hpp index 93c90d32421..06e9f18000f 100644 --- a/src/modules/simulation/simulator_mavlink/SimulatorMavlink.hpp +++ b/src/modules/simulation/simulator_mavlink/SimulatorMavlink.hpp @@ -37,7 +37,7 @@ * @file SimulatorMavlink.hpp * * This module interfaces via MAVLink to a software in the loop simulator (SITL) - * such as jMAVSim or Gazebo. + * such as Gazebo Classic or X-Plane. */ #pragma once diff --git a/src/modules/simulation/simulator_mavlink/sitl_targets_jmavsim.cmake b/src/modules/simulation/simulator_mavlink/sitl_targets_jmavsim.cmake deleted file mode 100644 index 7585fac325d..00000000000 --- a/src/modules/simulation/simulator_mavlink/sitl_targets_jmavsim.cmake +++ /dev/null @@ -1,41 +0,0 @@ - -find_program(JAVA_ANT_PATH "ant") -find_package(Java) - -if(JAVA_ANT_PATH AND Java_JAVAC_EXECUTABLE AND Java_JAVA_EXECUTABLE) - - px4_add_git_submodule(TARGET git_jmavsim PATH "${PX4_SOURCE_DIR}/Tools/simulation/jmavsim/jMAVSim") - - add_custom_target(jmavsim_run_symlink - COMMAND ${CMAKE_COMMAND} -E create_symlink ${PX4_SOURCE_DIR}/Tools/simulation/jmavsim/jmavsim_run.sh ${PX4_BINARY_DIR}/rootfs/jmavsim_run.sh - BYPRODUCTS ${PX4_BINARY_DIR}/rootfs/jmavsim_run.sh - ) - - # build_jmavsim - add_custom_command( - OUTPUT ${PX4_SOURCE_DIR}/Tools/simulation/jmavsim/jMAVSim/out/production/jmavsim_run.jar - COMMAND ${JAVA_ANT_PATH} create_run_jar copy_res - WORKING_DIRECTORY ${PX4_SOURCE_DIR}/Tools/simulation/jmavsim/jMAVSim/ - USES_TERMINAL - DEPENDS git_jmavsim jmavsim_run_symlink - COMMENT "building jMAVSim" - ) - add_custom_target(build_jmavsim - DEPENDS - ${PX4_SOURCE_DIR}/Tools/simulation/jmavsim/jMAVSim/out/production/jmavsim_run.jar - jmavsim_run_symlink - ) - - # launch helper - add_custom_target(jmavsim_iris - COMMAND ${CMAKE_COMMAND} -E env PX4_SYS_AUTOSTART=10017 $ - WORKING_DIRECTORY ${SITL_WORKING_DIR} - USES_TERMINAL - DEPENDS - px4 git_jmavsim build_jmavsim jmavsim_run_symlink - ${PX4_SOURCE_DIR}/ROMFS/px4fmu_common/init.d-posix/airframes/10017_jmavsim_iris - COMMENT "launching px4 jmavsim_iris (SYS_AUTOSTART=10017)" - ) - add_custom_target(jmavsim DEPENDS jmavsim_iris) # alias - -endif()