Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to launch iris_fpv_cam, iris_depth_camera and others #489

Closed
Rezenders opened this issue May 7, 2020 · 9 comments
Closed

Unable to launch iris_fpv_cam, iris_depth_camera and others #489

Rezenders opened this issue May 7, 2020 · 9 comments

Comments

@Rezenders
Copy link

Rezenders commented May 7, 2020

Hello,

I am trying to run a mavros + gazebo simulation with an iris model with a camera, but I am not able to do so.

When I run a simulation with the following command everything works just fine (this model does not have a camera):

$ roslaunch px4 mavros_posix_sitl.launch 

However, when I run a simulation with any of the models iris_fpv_cam, iris_depth_camera, iris_downward_depth_camera, or iris_stereo_camera it does not work, I am running the following command:

$ roslaunch px4 mavros_posix_sitl.launch vehicle:=iris_depth_camera

I get the error:

NFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
Error: Unknown model 'iris_depth_camera'
ERROR [px4] Startup script returned with return value: 256
process[gazebo-3]: started with pid [27017]
process[gazebo_gui-4]: started with pid [27026]
process[vehicle_spawn_akai_ubuntu_26975_7396985297787011639-5]: started with pid [27031]
process[mavros-6]: started with pid [27032]
================================================================================REQUIRED process [sitl-2] has died!
process has died [pid 27004, exit code 255, cmd /home/gus/Documents/git/Firmware/build/px4_sitl_default/bin/px4 /home/gus/Documents/git/Firmware/ROMFS/px4fmu_common -s etc/init.d-posix/rcS __name:=sitl __log:=/home/gus/.ros/log/a0f8afbc-909b-11ea-9620-9822ef71a76d/sitl-2.log].
log file: /home/gus/.ros/log/a0f8afbc-909b-11ea-9620-9822ef71a76d/sitl-2*.log
Initiating shutdown!
================================================================================

As mentioned in the issue #228 I tried to create a launch file changing the vehicle and sdf arg, but it did not work:

<?xml version="1.0"?>
<launch>
    <arg name="vehicle" default="iris_depth_camera"/>
    <arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).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>

When gazebo is open I can manually insert the models.

When building the Firmware repo I followed the instructions on https://dev.px4.io/v1.9.0/en/simulation/multi-vehicle-simulation.html:

$ cd Firmware_clone
$ git submodule update --init --recursive
$ DONT_RUN=1 make px4_sitl_default gazebo
$ source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
$ export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd):$(pwd)/Tools/sitl_gazebo

I found a similar question on ros answers: https://answers.ros.org/question/345462/trouble-running-gazebo-simulation-with-camera-plugin/

@mzwtju
Copy link

mzwtju commented May 11, 2020

The launch file you created seem to be imcomplete
In mavros_posix_sitl.launch
add <arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/iris_fpv_cam/iris_fpv_cam.sdf"/>
It should work.

@Rezenders
Copy link
Author

Rezenders commented May 13, 2020

It worked, thanks!
I left the vehicle name as iris and used the sdf arg as you described

@induchandran77
Copy link

this works for single vehicle. How can I do it for multiple vehicles?
I use multi_uav_mavros_sitl.launch

@induchandran77
Copy link

<!-- vehicle model and config -->
<arg name="est" default="ekf2"/>
<arg name="vehicle" default="iris"/>
<arg name="ID" default="1"/>
<env name="PX4_SIM_MODEL" value="$(arg vehicle)" />
<arg name="mavlink_udp_port" default="14560"/>
<arg name="mavlink_tcp_port" default="4560"/>
<arg name="gst_udp_port" default="5600"/>
<arg name="video_uri" default="5600"/>
<arg name="mavlink_cam_udp_port" default="14530"/>
<arg name="mavlink_id" value="$(eval 1 + arg('ID'))" />
<!-- PX4 configs -->
<arg name="interactive" default="true"/>
<!-- generate sdf vehicle model -->
<arg name="cmd" default="$(find mavlink_sitl_gazebo)/scripts/jinja_gen.py --stdout --mavlink_id=$(arg mavlink_id) --mavlink_udp_port=$(arg mavlink_udp_port) --mavlink_tcp_port=$(arg mavlink_tcp_port) --gst_udp_port=$(arg gst_udp_port) --video_uri=$(arg video_uri) --mavlink_cam_udp_port=$(arg mavlink_cam_udp_port) $(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf.jinja $(find mavlink_sitl_gazebo)"/>
<param command="$(arg cmd)" name="sdf_$(arg vehicle)$(arg ID)"/>
<!-- PX4 SITL -->
<arg unless="$(arg interactive)" name="px4_command_arg1" value=""/>
<arg     if="$(arg interactive)" name="px4_command_arg1" value="-d"/>
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS -i $(arg ID) -w sitl_$(arg vehicle)_$(arg ID) $(arg px4_command_arg1)">
</node>
<!-- spawn vehicle -->
<node name="$(anon vehicle_spawn)" pkg="gazebo_ros" type="spawn_model" output="screen" args="-sdf -param sdf_$(arg vehicle)$(arg ID) -model $(arg vehicle)$(arg ID) -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg R) -P $(arg P) -Y $(arg Y)"/>

@lijoe123
Copy link

Which verson you use? Noetic or melodic? @induchandran77

@induchandran77
Copy link

I use Noetic

@lijoe123
Copy link

image
image
So if in one vehicle, I only had the two topic of camera. And the realsense in the iris is weird. What about you? @induchandran77

@induchandran77
Copy link

No, I had image_raw and image_info topics listed. I guess it doesn't appear for you because the sdf file is not correctly loaded.

@nicolasfripp
Copy link

this works for single vehicle. How can I do it for multiple vehicles?
I use multi_uav_mavros_sitl.launch

Could you find a solution? @induchandran77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants