PX4 / PX4-SITL_gazebo-classic

Set of plugins, models and worlds to use with OSRF Gazebo Simulator in SITL and HITL.
http://dev.px4.io/simulation-gazebo.html
379 stars 798 forks source link

PX4 SITL Gazebo some plugins not working #927

Open saksham2001 opened 2 years ago

saksham2001 commented 2 years ago

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:

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

Operating System: Ubuntu 22.04

ROS: Noetic

Results after gazebo topics -l

/gazebo/default/atmosphere
/gazebo/default/default/depth_camera/cmd
/gazebo/default/diagnostics
/gazebo/default/factory
/gazebo/default/factory/light
/gazebo/default/gui
/gazebo/default/gzclient_camera/cmd
/gazebo/default/iris_depth_camera/baro
/gazebo/default/iris_depth_camera/camera/link/irlock
/gazebo/default/iris_depth_camera/depth_camera/link/depth_camera/image
/gazebo/default/iris_depth_camera/depth_camera/link/wrench
/gazebo/default/iris_depth_camera/gazebo/command/motor_speed
/gazebo/default/iris_depth_camera/groundtruth
/gazebo/default/iris_depth_camera/iris/base_link/wrench
/gazebo/default/iris_depth_camera/iris/gps0/link/gps
/gazebo/default/iris_depth_camera/iris/gps0/link/wrench
/gazebo/default/iris_depth_camera/iris/imu/link/imu/imu
/gazebo/default/iris_depth_camera/iris/imu/link/wrench
/gazebo/default/iris_depth_camera/iris/mag/link/magnetometer
/gazebo/default/iris_depth_camera/iris/mag/link/wrench
/gazebo/default/iris_depth_camera/iris/rotor_0/wrench
/gazebo/default/iris_depth_camera/iris/rotor_1/wrench
/gazebo/default/iris_depth_camera/iris/rotor_2/wrench
/gazebo/default/iris_depth_camera/iris/rotor_3/wrench
/gazebo/default/iris_depth_camera/link/gps0
/gazebo/default/iris_depth_camera/link/imu
/gazebo/default/iris_depth_camera/link/mag
/gazebo/default/iris_depth_camera/px4flow/link/opticalFlow
/gazebo/default/iris_depth_camera/vision_odom
/gazebo/default/iris_depth_camera::iris::imu::link
/gazebo/default/joint
/gazebo/default/light/modify
/gazebo/default/log/control
/gazebo/default/log/status
/gazebo/default/model/info
/gazebo/default/model/modify
/gazebo/default/physics
/gazebo/default/physics/contacts
/gazebo/default/playback_control
/gazebo/default/pose/info
/gazebo/default/pose/local/info
/gazebo/default/pose/modify
/gazebo/default/request
/gazebo/default/response
/gazebo/default/roads
/gazebo/default/scene
/gazebo/default/selection
/gazebo/default/sensor
/gazebo/default/skeleton_pose/info
/gazebo/default/sky
/gazebo/default/undo_redo
/gazebo/default/user_camera/joy_pose
/gazebo/default/user_camera/joy_twist
/gazebo/default/user_camera/pose
/gazebo/default/user_cmd
/gazebo/default/user_cmd_stats
/gazebo/default/visual
/gazebo/default/wind
/gazebo/default/world_control
/gazebo/default/world_stats
/gazebo/default/world_wind
/gazebo/motor_failure_num
/gazebo/performance_metrics
/gazebo/server/control
/gazebo/world/modify

Results after rostopic list:

/diagnostics
/mavlink/from
/mavlink/gcs_ip
/mavlink/to
/mavros/actuator_control
/mavros/adsb/send
/mavros/adsb/vehicle
/mavros/altitude
/mavros/battery
/mavros/cam_imu_sync/cam_imu_stamp
/mavros/camera/image_captured
/mavros/cellular_status/status
/mavros/companion_process/status
/mavros/debug_value/debug
/mavros/debug_value/debug_vector
/mavros/debug_value/named_value_float
/mavros/debug_value/named_value_int
/mavros/debug_value/send
/mavros/esc_info
/mavros/esc_status
/mavros/esc_telemetry
/mavros/estimator_status
/mavros/extended_state
/mavros/fake_gps/mocap/tf
/mavros/geofence/waypoints
/mavros/global_position/compass_hdg
/mavros/global_position/global
/mavros/global_position/gp_lp_offset
/mavros/global_position/gp_origin
/mavros/global_position/home
/mavros/global_position/local
/mavros/global_position/raw/fix
/mavros/global_position/raw/gps_vel
/mavros/global_position/raw/satellites
/mavros/global_position/rel_alt
/mavros/global_position/set_gp_origin
/mavros/gps_input/gps_input
/mavros/gps_rtk/rtk_baseline
/mavros/gps_rtk/send_rtcm
/mavros/gpsstatus/gps1/raw
/mavros/gpsstatus/gps1/rtk
/mavros/gpsstatus/gps2/raw
/mavros/gpsstatus/gps2/rtk
/mavros/hil/actuator_controls
/mavros/hil/controls
/mavros/hil/gps
/mavros/hil/imu_ned
/mavros/hil/optical_flow
/mavros/hil/rc_inputs
/mavros/hil/state
/mavros/home_position/home
/mavros/home_position/set
/mavros/imu/data
/mavros/imu/data_raw
/mavros/imu/diff_pressure
/mavros/imu/mag
/mavros/imu/static_pressure
/mavros/imu/temperature_baro
/mavros/imu/temperature_imu
/mavros/landing_target/lt_marker
/mavros/landing_target/pose
/mavros/landing_target/pose_in
/mavros/local_position/accel
/mavros/local_position/odom
/mavros/local_position/pose
/mavros/local_position/pose_cov
/mavros/local_position/velocity_body
/mavros/local_position/velocity_body_cov
/mavros/local_position/velocity_local
/mavros/log_transfer/raw/log_data
/mavros/log_transfer/raw/log_entry
/mavros/mag_calibration/report
/mavros/mag_calibration/status
/mavros/manual_control/control
/mavros/manual_control/send
/mavros/mission/reached
/mavros/mission/waypoints
/mavros/mocap/pose
/mavros/mount_control/command
/mavros/mount_control/orientation
/mavros/mount_control/status
/mavros/nav_controller_output
/mavros/obstacle/send
/mavros/odometry/in
/mavros/odometry/out
/mavros/onboard_computer/status
/mavros/param/param_value
/mavros/play_tune
/mavros/px4flow/ground_distance
/mavros/px4flow/raw/optical_flow_rad
/mavros/px4flow/raw/send
/mavros/px4flow/temperature
/mavros/radio_status
/mavros/rallypoint/waypoints
/mavros/rc/in
/mavros/rc/out
/mavros/rc/override
/mavros/setpoint_accel/accel
/mavros/setpoint_attitude/cmd_vel
/mavros/setpoint_attitude/thrust
/mavros/setpoint_position/global
/mavros/setpoint_position/global_to_local
/mavros/setpoint_position/local
/mavros/setpoint_raw/attitude
/mavros/setpoint_raw/global
/mavros/setpoint_raw/local
/mavros/setpoint_raw/target_attitude
/mavros/setpoint_raw/target_global
/mavros/setpoint_raw/target_local
/mavros/setpoint_trajectory/desired
/mavros/setpoint_trajectory/local
/mavros/setpoint_velocity/cmd_vel
/mavros/setpoint_velocity/cmd_vel_unstamped
/mavros/state
/mavros/statustext/recv
/mavros/statustext/send
/mavros/target_actuator_control
/mavros/terrain/report
/mavros/time_reference
/mavros/timesync_status
/mavros/trajectory/desired
/mavros/trajectory/generated
/mavros/trajectory/path
/mavros/tunnel/in
/mavros/tunnel/out
/mavros/vfr_hud
/mavros/vision_pose/pose
/mavros/vision_pose/pose_cov
/mavros/vision_speed/speed_twist_cov
/mavros/wind_estimation
/move_base_simple/goal
/rosout
/rosout_agg
/tf
/tf_static

Output after running the make command:

[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.

sibujacob commented 1 year ago

i also have the same issue....do you have a solution

The-Michael-Chen commented 1 year ago

i have the same issue

reo7749 commented 1 year ago

i have the same issue, ubuntu 20.04

AnishMathewOommen commented 7 months ago

I have the same issue in Ubuntu 20.04

karzito commented 1 month ago

i hvae the same issue