I am trying to use the PX4 SITL simulation with gazebo. I wanted to try rgb camera and depth camera attached to the drone and process that using ROS 1. I saw models for iris_fpv_cam and iris_depth_camera models already present in PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo/models. I was not directly able to launch these using the command make px4_sitl gazebo_iris_fpv_cam, so did the following:
created a airframe in ROMFS/px4fmu_common/init.d-posix as 5001_iris_depth_camera and used the same files as in the iris_rplidar frame.
added this airframe in ROMFS/px4fmu_common/init.d-posix/CmakeLists.txt
Now after launching using the command make px4_sitl gazebo_iris_depth_camera, everything works. Gazebo launches and I can see the depth camera on the iris frame. But there are no rostopics published for the depth camera. Same thing for iris_fpv_cam and even iris_rplidar (which is already present and does not require any changes with ROMFS). I have tried launching roscore, or the mavros launch file before starting this and it doesn't help. Ther
[0/2] Re-checking globbed directories...
[0/4] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[3/4] cd /home/saksham/PX4-Autopilot/build/px4_si...home/saksham/PX4-Autopilot/build/px4_sitl_default
SITL ARGS
sitl_bin: /home/saksham/PX4-Autopilot/build/px4_sitl_default/bin/px4
debugger: none
model: iris_depth_camera
world: none
src_path: /home/saksham/PX4-Autopilot
build_path: /home/saksham/PX4-Autopilot/build/px4_sitl_default
GAZEBO_PLUGIN_PATH :/home/saksham/PX4-Autopilot/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/home/saksham/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo/models
LD_LIBRARY_PATH /home/saksham/catkin_ws/devel/lib:/opt/ros/noetic/lib:/opt/ros/noetic/lib/x86_64-linux-gnu:/home/saksham/PX4-Autopilot/build/px4_sitl_default/build_gazebo
empty world, default world iris_depth_camera.world for model found
Using: /home/saksham/PX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo/models/iris_depth_camera/iris_depth_camera.sdf
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available.
SITL COMMAND: "/home/saksham/PX4-Autopilot/build/px4_sitl_default/bin/px4" "/home/saksham/PX4-Autopilot/build/px4_sitl_default"/etc
______ __ __ ___
| ___ \ \ \ / / / |
| |_/ / \ V / / /| |
| __/ / \ / /_| |
| | / /^\ \ \___ |
\_| \/ \/ |_/
px4 starting.
INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
INFO [init] found model autostart file as SYS_AUTOSTART=5001
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from 'parameters.bson'
INFO [parameters] BSON document size 278 bytes, decoded 278 bytes (INT32:11, FLOAT:3)
INFO [param] selected parameter backup file parameters_backup.bson
Gazebo multi-robot simulator, version 11.12.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.41
INFO [dataman] data manager file './dataman' size is 7866640 bytes
PX4 SIM HOST: localhost
INFO [simulator_mavlink] Waiting for simulator to accept connection on TCP port 4560
INFO [simulator_mavlink] Simulator connected on TCP port 4560.
INFO [lockstep_scheduler] setting initial absolute time to 3448000 us
../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available.
INFO [commander] LED: open /dev/led0 failed (22)
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
INFO [health_and_arming_checks] Preflight Fail: No manual control input
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
[Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO [logger] logger started (mode=all)
WARN [logger] Too many subscriptions, failed to add: vehicle_trajectory_waypoint_desired 0
INFO [logger] Start file log (type: full)
INFO [logger] [logger] ./log/2022-11-09/18_55_08.ulg
INFO [logger] Opened full log file: ./log/2022-11-09/18_55_08.ulg
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [px4] Startup script returned successfully
pxh> INFO [health_and_arming_checks] Preflight Fail: No manual control input
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
INFO [tone_alarm] home set
INFO [health_and_arming_checks] Preflight Fail: No manual control input
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
INFO [health_and_arming_checks] Preflight Fail: No manual control input
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
INFO [commander] Ready for takeoff!
INFO [health_and_arming_checks] Preflight Fail: No manual control input
WARN [health_and_arming_checks] Preflight Fail: No connection to the ground control station
INFO [mavlink] partner IP: 127.0.0.1
ERROR [timesync] Time jump detected. Resetting time synchroniser.
ERROR [timesync] Time jump detected. Resetting time synchroniser.
Looking forward to some help. Please let me know if any additional information is required.
I am trying to use the PX4 SITL simulation with gazebo. I wanted to try rgb camera and depth camera attached to the drone and process that using ROS 1. I saw models for
iris_fpv_cam
andiris_depth_camera
models already present inPX4-Autopilot/Tools/simulation/gazebo/sitl_gazebo/models
. I was not directly able to launch these using the commandmake px4_sitl gazebo_iris_fpv_cam
, so did the following:ROMFS/px4fmu_common/init.d-posix
as5001_iris_depth_camera
and used the same files as in the iris_rplidar frame.ROMFS/px4fmu_common/init.d-posix/CmakeLists.txt
Now after launching using the command
make px4_sitl gazebo_iris_depth_camera
, everything works. Gazebo launches and I can see the depth camera on the iris frame. But there are no rostopics published for the depth camera. Same thing foriris_fpv_cam
and eveniris_rplidar
(which is already present and does not require any changes with ROMFS). I have tried launching roscore, or the mavros launch file before starting this and it doesn't help. TherOperating System: Ubuntu 22.04
ROS: Noetic
Results after
gazebo topics -l
Results after
rostopic list
:Output after running the make command:
Looking forward to some help. Please let me know if any additional information is required.