Error: unknown target | Unable to simulate the iris_stereo_camera model

Hi.

I’m trying to run a gazebo px4 sitl simulation with the iris_stereo_camera model.

My setup works with the default iris model, but not with the iris_stereo_camera model.

This one works:

cd /path/to/PX4-Autopilot
DONT_RUN=1 make px4_sitl_default gazebo
source ~/catkin_ws/devel/setup.bash    # (optional)
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo
roslaunch px4 posix_sitl.launch x:=0 y:=0 z:=0 R:=0 P:=0 Y:=1.57079 vehicle:=iris

This one doesn’t work:

cd /path/to/PX4-Autopilot
DONT_RUN=1 make px4_sitl gazebo_iris_stereo_camera
source ~/catkin_ws/devel/setup.bash    # (optional)
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo
roslaunch px4 posix_sitl.launch x:=0 y:=0 z:=0 R:=0 P:=0 Y:=1.57079 vehicle:=iris_stereo_camera

The error is:

ninja: error: unknown target ‘gazebo_iris_stereo_camera’
Makefile:224: recipe for target ‘px4_sitl’ failed
make: *** [px4_sitl] Error 1

Error: Unknown model ‘iris_stereo_camera’
process[gazebo-2]: started with pid [31272]
ERROR [px4] Startup script returned with return value: 256
process[gazebo_gui-3]: started with pid [31280]
process[vehicle_spawn_eialab1_AERO_15_X9_31243_4218840550519229751-4]: started with pid [31285]
================================================================================REQUIRED process [sitl-1] has died!
process has died [pid 31258, exit code 255, cmd /home/eia-lab1/PX4-SITL/PX4-Autopilot/build/px4_sitl_default/bin/px4 /home/eia-lab1/PX4-SITL/PX4-Autopilot/ROMFS/px4fmu_common -s etc/init.d-posix/rcS __name:=sitl __log:=/home/eia-lab1/.ros/log/ab72c876-76ee-11eb-841b-fc777466ce75/sitl-1.log].
log file: /home/eia-lab1/.ros/log/ab72c876-76ee-11eb-841b-fc777466ce75/sitl-1*.log
Initiating shutdown!
================================================================================

As I understand from here: https://docs.px4.io/master/en/simulation/gazebo_vehicles.html#quadrotor_optical_flow,

The desired vehicle model needs to be appended after gazebo as follows: make px4_sitl gazebo_iris_opt_flow

FYI. My firmware version is 1.11.2dev. I’m using Ubuntu 18.04LTS

@canberkgurel The iris_stereo_camera is a ROS dependent model (e.g. the stereo camera is a ROS plugin), therefore it is not a make target.

You cannot run the model without ROS. If you want to use the model, you need to spawn it using ROS

@Jaeyoung-Lim How do I do that? I’m already using ROS. Did you see the roslaunch file I’m running in my original post?

@canberkgurel You can use https://github.com/PX4/PX4-Avoidance/blob/master/avoidance/launch/avoidance_sitl_mavros.launch as reference.

The launchfile you are using assumes that the name of the airframe config matches the name of your model, while in your case you are just running a iris airframe config and want to use a iris_stereo_camera sdf model

@Jaeyoung-Lim I made some modifications in the PX4-Autopilot software to get it working. I think there was a gap in the implementation. I’ll create a PR and you can review it if you want.

@canberkgurel yes please

Please see https://github.com/PX4/PX4-Autopilot/pull/16993