mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
feat(sim): add SIH SITL build target and multi-instance args
- Add boards/px4/sitl/sih.px4board disabling Gazebo bridge/msgs/plugins - Update sitl_multiple_run.sh to accept model and build target arguments - Add openjdk@17 to macOS setup script for jMAVSim display-only mode Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
parent
f46609ac8b
commit
4f2918ee3b
@ -79,6 +79,13 @@ if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
||||
elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
||||
brew reinstall px4-sim
|
||||
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 "[macos.sh] All set! The PX4 Autopilot toolchain was installed."
|
||||
|
||||
@ -1,25 +1,28 @@
|
||||
#!/bin/bash
|
||||
# run multiple instances of the 'px4' binary, but w/o starting the simulator.
|
||||
# It assumes px4 is already built, with 'make px4_sitl_default'
|
||||
# Run multiple instances of the 'px4' binary, without starting an external simulator.
|
||||
# It assumes px4 is already built with the specified build target.
|
||||
#
|
||||
# Usage: ./Tools/simulation/sitl_multiple_run.sh [num_instances] [model] [build_target]
|
||||
# Examples:
|
||||
# ./Tools/simulation/sitl_multiple_run.sh 3 sihsim_quadx px4_sitl_sih
|
||||
# ./Tools/simulation/sitl_multiple_run.sh 2 gazebo-classic_iris px4_sitl_default
|
||||
# ./Tools/simulation/sitl_multiple_run.sh # defaults: 2 instances, gazebo-classic_iris, px4_sitl_default
|
||||
|
||||
# The simulator is expected to send to TCP port 4560+i for i in [0, N-1]
|
||||
# For example jmavsim can be run like this:
|
||||
#./Tools/simulation/jmavsim/jmavsim_run.sh -p 4561 -l
|
||||
|
||||
sitl_num=2
|
||||
[ -n "$1" ] && sitl_num="$1"
|
||||
sitl_num=${1:-2}
|
||||
sim_model=${2:-gazebo-classic_iris}
|
||||
build_target=${3:-px4_sitl_default}
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
src_path="$SCRIPT_DIR/../../"
|
||||
|
||||
build_path=${src_path}/build/px4_sitl_default
|
||||
build_path=${src_path}/build/${build_target}
|
||||
|
||||
echo "killing running instances"
|
||||
pkill -x px4 || true
|
||||
|
||||
sleep 1
|
||||
|
||||
export PX4_SIM_MODEL=gazebo-classic_iris
|
||||
export PX4_SIM_MODEL=${sim_model}
|
||||
|
||||
n=0
|
||||
while [ $n -lt $sitl_num ]; do
|
||||
|
||||
3
boards/px4/sitl/sih.px4board
Normal file
3
boards/px4/sitl/sih.px4board
Normal file
@ -0,0 +1,3 @@
|
||||
CONFIG_MODULES_SIMULATION_GZ_BRIDGE=n
|
||||
CONFIG_MODULES_SIMULATION_GZ_MSGS=n
|
||||
CONFIG_MODULES_SIMULATION_GZ_PLUGINS=n
|
||||
Loading…
x
Reference in New Issue
Block a user