mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Several helper scripts assumes bash is available at /bin/bash. That breaks on systems such as NixOS, where bash is resolved from PATH instead of a fixed /bin location and causes failures like `bad interpreter` during `make format`, e.g., on my host machine: ```sh $ make format /PX4-Autopilot/Tools/astyle/check_code_style.sh: /PX4-Autopilot/Tools/astyle/fix_code_style.sh: /bin/bash: bad interpreter: No such file or directory ``` This change switches these entrypoints to `#!/usr/bin/env bash` so they locate bash properly. No functional changes intended. Signed-off-by: Onur Özkan <work@onurozkan.dev>
26 lines
860 B
Bash
Executable File
26 lines
860 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Setup environment to make PX4 visible to Gazebo.
|
|
#
|
|
# Note, this is not necessary if using a ROS catkin workspace with the px4
|
|
# package as the paths are exported.
|
|
#
|
|
# License: according to LICENSE.md in the root directory of the PX4 Firmware repository
|
|
|
|
if [ "$#" != 2 ]; then
|
|
echo -e "usage: source setup_gazebo.bash src_dir build_dir\n"
|
|
return 1
|
|
fi
|
|
|
|
SRC_DIR=$1
|
|
BUILD_DIR=$2
|
|
|
|
# setup Gazebo env and update package path
|
|
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:${BUILD_DIR}/build_gazebo-classic
|
|
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:${SRC_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${BUILD_DIR}/build_gazebo-classic
|
|
|
|
echo -e "GAZEBO_PLUGIN_PATH $GAZEBO_PLUGIN_PATH"
|
|
echo -e "GAZEBO_MODEL_PATH $GAZEBO_MODEL_PATH"
|
|
echo -e "LD_LIBRARY_PATH $LD_LIBRARY_PATH"
|