Skip to content

Commit

Permalink
removed all models and reworked logic
Browse files Browse the repository at this point in the history
Signed-off-by: frederik <[email protected]>
  • Loading branch information
frede791 committed Dec 6, 2023
1 parent 0528a5e commit 7fb60b1
Show file tree
Hide file tree
Showing 42 changed files with 27 additions and 8,546 deletions.
24 changes: 11 additions & 13 deletions ROMFS/px4fmu_common/init.d-posix/px4-rc.simulator
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,8 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then
param set SIM_GZ_HOME_ALT ${PX4_HOME_LON}
fi

# source generated gz_env.sh for GZ_SIM_RESOURCE_PATH
if [ -f ./gz_env.sh ]; then
. ./gz_env.sh

elif [ -f ../gz_env.sh ]; then
. ../gz_env.sh
fi

# Only start up Gazebo if PX4_GZ_STANDALONE set to false
if [ "$PX4_GZ_STANDALONE" != '1' ]; then
# Only start up Gazebo if PX4_GZ_SIM set to true
if [ "$PX4_GZ_SIM" = '1' ]; then

# "gz sim" only avaiilable in Garden and later
GZ_SIM_VERSIONS=$(gz sim --versions 2>&1)
Expand All @@ -78,17 +70,23 @@ elif [ "$PX4_SIMULATOR" = "gz" ] || [ "$(param show -q SIM_GZ_EN)" = "1" ]; then
gz_world=$( ${gz_command} topic -l | grep -m 1 -e "^/world/.*/clock" | sed 's/\/world\///g; s/\/clock//g' )

# shellcheck disable=SC2153
if [ -z "${gz_world}" ] && [ -n "${PX4_GZ_WORLDS}" ] && [ -n "${PX4_GZ_WORLD}" ]; then
echo "INFO [init] PX4_GZ_WORLD: ${PX4_GZ_WORLD}"
echo "INFO [init] GZ_SIM_RESOURCE_PATH: ${GZ_SIM_RESOURCE_PATH}"
if [ -z "${gz_world}" ] && [ -n "${GZ_SIM_RESOURCE_PATH}" ] && [ -n "${PX4_GZ_WORLD}" ]; then

echo "INFO [init] starting gazebo with world: ${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf"
echo "INFO [init] starting gazebo with world: ${GZ_SIM_RESOURCE_PATH}/worlds/${PX4_GZ_WORLD}.sdf"

${gz_command} ${gz_sub_command} --verbose=1 -r -s "${PX4_GZ_WORLDS}/${PX4_GZ_WORLD}.sdf" &
${gz_command} ${gz_sub_command} --verbose=1 -r -s "${GZ_SIM_RESOURCE_PATH}/worlds/${PX4_GZ_WORLD}.sdf" &

if [ -z "${HEADLESS}" ]; then
# HEADLESS not set, starting gui
${gz_command} ${gz_sub_command} -g &
fi

elif [ -z "${GZ_SIM_RESOURCE_PATH}" ] && [ -z "${gz_world}" ]; then
echo "ERROR [init] GZ_SIM_RESOURCE_PATH not set, and no world running"
exit 1

else
echo "INFO [init] gazebo already running world: ${gz_world}"
PX4_GZ_WORLD=${gz_world}
Expand Down
14 changes: 0 additions & 14 deletions Tools/simulation/gz/models/advanced_plane/model.config

This file was deleted.

Loading

0 comments on commit 7fb60b1

Please sign in to comment.