mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
sitl_run: allow to start required ROS2 plugins with Gazebo when ROS_VERSION is set to 2
This commit is contained in:
+8
-1
@@ -56,6 +56,13 @@ else
|
||||
follow_mode=""
|
||||
fi
|
||||
|
||||
# To use gazebo_ros ROS2 plugins
|
||||
if [[ -n "$ROS_VERSION" ]] && [ "$ROS_VERSION" == "2" ]; then
|
||||
ros_args="-s libgazebo_ros_init.so -s libgazebo_ros_factory.so"
|
||||
else
|
||||
ros_args=""
|
||||
fi
|
||||
|
||||
if [ "$program" == "jmavsim" ]; then
|
||||
jmavsim_pid=`ps aux | grep java | grep "\-jar jmavsim_run.jar" | awk '{ print $2 }'`
|
||||
if [ -n "$jmavsim_pid" ]; then
|
||||
@@ -133,7 +140,7 @@ elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then
|
||||
world_path="$PX4_SITL_WORLD"
|
||||
fi
|
||||
fi
|
||||
gzserver $verbose $world_path &
|
||||
gzserver $verbose $world_path $ros_args &
|
||||
SIM_PID=$!
|
||||
|
||||
# Check all paths in ${GAZEBO_MODEL_PATH} for specified model
|
||||
|
||||
Reference in New Issue
Block a user