I’d like to launch the iris_fpv_cam model(iris with a camera). I checked Running the simulation but it is not mentioned.
I tried to follow the same pattern make px4_sitl gazebo_iris_fpv_cam
but there is no target for it.
then I tried roslaunch px4 mavros_posix_sitl.launch vehicle:=iris_fpv_cam
as suggested in one of the discussions on GitHub
output
Error: Unknown model 'iris_fpv_cam'
ERROR [px4] Startup script returned with return value: 256
I have my px4 sourced in the .bashrc
px4_dir=~/Firmware
source $px4_dir/Tools/setup_gazebo.bash $px4_dir $px4_dir/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir/Tools/sitl_gazebo
I tried a launch file mylaunch.launch
<?xml version="1.0"?>
<launch>
<include file="$(find px4)/launch/mavros_posix_sitl.launch">
<arg name="vehicle" value="iris_fpv_cam" />
<arg name="sdf" value="$(find mavlink_sitl_gazebo)/models/iris_fpv_cam/iris_fpv_cam.sdf"/>
</include>
</launch>
I sourced my workspace and tried to run I get this error, I think because the source of the workspace override the px4 source mentioned above.
Resource not found: px4
ROS path [0]=/opt/ros/noetic/share/ros
...
Is a way to launch iris_fpv_cam without creating my own launch file
@Mohamed_Ahmed iris_fpv_cam
model uses a camera model called fpv_cam
which uses the gazebo_ros_camera_plugin
Therefore it doesn’t make sense to use that model without using it with roslaunch
1 Like
I thought that there was a target in the make file as for 3DR iris.
so I think the problem is with defining the environment variable to the models?
@Mohamed_Ahmed No, what I meant is that you CANNOT use the iris_fpv_cam
model without using ROS.
Therefore it doesn’t make sense to enable the model to work with the make
command.
I think my problem was about the environment variables.
I tried to launch roslaunch px4 mavros_posix_sitl.launch
it gave me errors
After I set them in the .bashrc
it worked fine.
px4_dir=~/Firmware
source /opt/ros/noetic/setup.bash
source ~/drone_ws/devel/setup.bash
source $px4_dir/Tools/setup_gazebo.bash $px4_dir $px4_dir/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir/Tools/sitl_gazebo
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/usr/lib/x86_64-linux-gnu/gazebo-11/plugins
To launch the iris_fpv_cam, I passed the sdf of my model to the sdf argument
roslaunch px4 mavros_posix_sitl.launch sdf:=~/Firmware/Tools/sitl_gazebo/models/iris_fpv_cam/iris_fpv_cam.sdf
another solution is to create your own launch. It can be like this
<?xml version="1.0"?>
<launch>
<arg name="vehicle" default="iris"/>
<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/iris_fpv_cam/iris_fpv_cam.sdf"/>
<include file="$(find px4)/launch/mavros_posix_sitl.launch">
<arg name="respawn_gazebo" value="true"/>
<arg name="respawn_mavros" value="true"/>
<arg name="vehicle" value="$(arg vehicle)"/>
<arg name="sdf" value="$(arg sdf)"/>
<arg name="verbose" value="true"/>
</include>
</launch>
Thank you very much @Jaeyoung-Lim
2 Likes