PX4 / PX4-Avoidance

PX4 avoidance ROS node for obstacle detection and avoidance.
http://px4.io
BSD 3-Clause "New" or "Revised" License
616 stars 321 forks source link

How to simulate multiple UAVs? #613

Open Prashant446 opened 3 years ago

Prashant446 commented 3 years ago

I am trying to simulate multiple UAVs and then I plan to modify or write my own code for planning. I am using the following launch file:

<?xml version="1.0"?>
<launch>
  <!-- MAVROS posix SITL environment launch script -->
  <!-- launches Gazebo environment and 2x: MAVROS, PX4 SITL, and spawns vehicle -->

  <arg name="gui" default="true"/>
  <arg name="world_file_name" default="simple_obstacle" />
  <arg name="world_path" default="$(find avoidance)/sim/worlds/$(arg world_file_name).world" />
  <!-- Launch Gazebo -->
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="gui" value="$(arg gui)"/>
    <arg name="world_name" value="$(arg world_path)" />
  </include>
  <!-- UAV0 -->
  <group ns="uav0">
    <!-- MAVROS and vehicle configs -->
    <arg name="ID" value="0"/>
    <arg name="fcu_url" default="udp://:14540@localhost:14580"/>

    <include file="$(find offb)/launch/global_planner_stereo.launch">
      <arg name="ID" value="$(arg ID)"/>
    </include>
  </group>
</launch>

I have only modified avoidance_sitl_mavros.launch to launch gazebo beforehand. Octomap is not working and I think the reason is some topics are not mapped to the namespace:

/actual_path
/blocked_marker
/camera/rgb/image_raw
/clicked_point
/clock
/closest_point
/closest_point_array
/cloud_in
/current_setpoint
/deg60_point
/deg60_point_array
/diagnostics
/drone
/drone_array
/explored_cells
/extended_marker
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/global_goal
/global_temp_goal
/global_temp_path
/goal_position
/local_pointcloud
/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/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/estimator_status
/mavros/extended_state
/mavros/fake_gps/mocap/tf
/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_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
/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/manual_control/control
/mavros/manual_control/send
/mavros/mission/reached
/mavros/mission/waypoints
/mavros/mocap/tf
/mavros/mount_control/command
/mavros/mount_control/orientation
/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/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/time_reference
/mavros/timesync_status
/mavros/trajectory/desired
/mavros/trajectory/generated
/mavros/trajectory/path
/mavros/vfr_hud
/mavros/vision_pose/pose
/mavros/vision_pose/pose_cov
/mavros/vision_speed/speed_vector
/mavros/wind_estimation
/move_base_simple/goal
/occupied_cells_vis_array
/octomap_full
/path_actual
/path_actual_array
/path_waypoint
/path_waypoint_array
/projected_map
/projected_map_updates
/rejected_marker
/reprojected_points
/rosout
/rosout_agg
/selected_marker
/smooth_path
/stereo/left/camera_info
/stereo/left/image_raw
/stereo/left/image_raw/compressed
/stereo/left/image_raw/compressed/parameter_descriptions
/stereo/left/image_raw/compressed/parameter_updates
/stereo/left/image_raw/compressedDepth
/stereo/left/image_raw/compressedDepth/parameter_descriptions
/stereo/left/image_raw/compressedDepth/parameter_updates
/stereo/left/image_raw/theora
/stereo/left/image_raw/theora/parameter_descriptions
/stereo/left/image_raw/theora/parameter_updates
/stereo/left/parameter_descriptions
/stereo/left/parameter_updates
/stereo/right/camera_info
/stereo/right/image_raw
/stereo/right/image_raw/compressed
/stereo/right/image_raw/compressed/parameter_descriptions
/stereo/right/image_raw/compressed/parameter_updates
/stereo/right/image_raw/compressedDepth
/stereo/right/image_raw/compressedDepth/parameter_descriptions
/stereo/right/image_raw/compressedDepth/parameter_updates
/stereo/right/image_raw/theora
/stereo/right/image_raw/theora/parameter_descriptions
/stereo/right/image_raw/theora/parameter_updates
/stereo/right/parameter_descriptions
/stereo/right/parameter_updates
/tf
/tf_static
/uav0/cloud_in
/uav0/free_cells_vis_array
/uav0/global_planner_node/parameter_descriptions
/uav0/global_planner_node/parameter_updates
/uav0/global_planner_node/uav0/stereo/points2
/uav0/occupied_cells_vis_array
/uav0/octomap_binary
/uav0/octomap_full
/uav0/octomap_point_cloud_centers
/uav0/octomap_server/parameter_descriptions
/uav0/octomap_server/parameter_updates
/uav0/projected_map
/uav0/stereo/disparity
/uav0/stereo/left/image_color
/uav0/stereo/left/image_color/compressed
/uav0/stereo/left/image_color/compressed/parameter_descriptions
/uav0/stereo/left/image_color/compressed/parameter_updates
/uav0/stereo/left/image_color/compressedDepth
/uav0/stereo/left/image_color/compressedDepth/parameter_descriptions
/uav0/stereo/left/image_color/compressedDepth/parameter_updates
/uav0/stereo/left/image_color/theora
/uav0/stereo/left/image_color/theora/parameter_descriptions
/uav0/stereo/left/image_color/theora/parameter_updates
/uav0/stereo/left/image_mono
/uav0/stereo/left/image_mono/compressed
/uav0/stereo/left/image_mono/compressed/parameter_descriptions
/uav0/stereo/left/image_mono/compressed/parameter_updates
/uav0/stereo/left/image_mono/compressedDepth
/uav0/stereo/left/image_mono/compressedDepth/parameter_descriptions
/uav0/stereo/left/image_mono/compressedDepth/parameter_updates
/uav0/stereo/left/image_mono/theora
/uav0/stereo/left/image_mono/theora/parameter_descriptions
/uav0/stereo/left/image_mono/theora/parameter_updates
/uav0/stereo/left/image_rect
/uav0/stereo/left/image_rect/compressed
/uav0/stereo/left/image_rect/compressed/parameter_descriptions
/uav0/stereo/left/image_rect/compressed/parameter_updates
/uav0/stereo/left/image_rect/compressedDepth
/uav0/stereo/left/image_rect/compressedDepth/parameter_descriptions
/uav0/stereo/left/image_rect/compressedDepth/parameter_updates
/uav0/stereo/left/image_rect/theora
/uav0/stereo/left/image_rect/theora/parameter_descriptions
/uav0/stereo/left/image_rect/theora/parameter_updates
/uav0/stereo/left/image_rect_color
/uav0/stereo/left/image_rect_color/compressed
/uav0/stereo/left/image_rect_color/compressed/parameter_descriptions
/uav0/stereo/left/image_rect_color/compressed/parameter_updates
/uav0/stereo/left/image_rect_color/compressedDepth
/uav0/stereo/left/image_rect_color/compressedDepth/parameter_descriptions
/uav0/stereo/left/image_rect_color/compressedDepth/parameter_updates
/uav0/stereo/left/image_rect_color/theora
/uav0/stereo/left/image_rect_color/theora/parameter_descriptions
/uav0/stereo/left/image_rect_color/theora/parameter_updates
/uav0/stereo/points2
/uav0/stereo/right/image_color
/uav0/stereo/right/image_color/compressed
/uav0/stereo/right/image_color/compressed/parameter_descriptions
/uav0/stereo/right/image_color/compressed/parameter_updates
/uav0/stereo/right/image_color/compressedDepth
/uav0/stereo/right/image_color/compressedDepth/parameter_descriptions
/uav0/stereo/right/image_color/compressedDepth/parameter_updates
/uav0/stereo/right/image_color/theora
/uav0/stereo/right/image_color/theora/parameter_descriptions
/uav0/stereo/right/image_color/theora/parameter_updates
/uav0/stereo/right/image_mono
/uav0/stereo/right/image_mono/compressed
/uav0/stereo/right/image_mono/compressed/parameter_descriptions
/uav0/stereo/right/image_mono/compressed/parameter_updates
/uav0/stereo/right/image_mono/compressedDepth
/uav0/stereo/right/image_mono/compressedDepth/parameter_descriptions
/uav0/stereo/right/image_mono/compressedDepth/parameter_updates
/uav0/stereo/right/image_mono/theora
/uav0/stereo/right/image_mono/theora/parameter_descriptions
/uav0/stereo/right/image_mono/theora/parameter_updates
/uav0/stereo/right/image_rect
/uav0/stereo/right/image_rect/compressed
/uav0/stereo/right/image_rect/compressed/parameter_descriptions
/uav0/stereo/right/image_rect/compressed/parameter_updates
/uav0/stereo/right/image_rect/compressedDepth
/uav0/stereo/right/image_rect/compressedDepth/parameter_descriptions
/uav0/stereo/right/image_rect/compressedDepth/parameter_updates
/uav0/stereo/right/image_rect/theora
/uav0/stereo/right/image_rect/theora/parameter_descriptions
/uav0/stereo/right/image_rect/theora/parameter_updates
/uav0/stereo/right/image_rect_color
/uav0/stereo/right/image_rect_color/compressed
/uav0/stereo/right/image_rect_color/compressed/parameter_descriptions
/uav0/stereo/right/image_rect_color/compressed/parameter_updates
/uav0/stereo/right/image_rect_color/compressedDepth
/uav0/stereo/right/image_rect_color/compressedDepth/parameter_descriptions
/uav0/stereo/right/image_rect_color/compressedDepth/parameter_updates
/uav0/stereo/right/image_rect_color/theora
/uav0/stereo/right/image_rect_color/theora/parameter_descriptions
/uav0/stereo/right/image_rect_color/theora/parameter_updates
/uav0/stereo/stereo_image_proc/parameter_descriptions
/uav0/stereo/stereo_image_proc/parameter_updates
/uav0/stereo/stereo_image_proc_debayer_left/parameter_descriptions
/uav0/stereo/stereo_image_proc_debayer_left/parameter_updates
/uav0/stereo/stereo_image_proc_debayer_right/parameter_descriptions
/uav0/stereo/stereo_image_proc_debayer_right/parameter_updates
/uav0/stereo/stereo_image_proc_rectify_color_left/parameter_descriptions
/uav0/stereo/stereo_image_proc_rectify_color_left/parameter_updates
/uav0/stereo/stereo_image_proc_rectify_color_right/parameter_descriptions
/uav0/stereo/stereo_image_proc_rectify_color_right/parameter_updates
/uav0/stereo/stereo_image_proc_rectify_mono_left/parameter_descriptions
/uav0/stereo/stereo_image_proc_rectify_mono_left/parameter_updates
/uav0/stereo/stereo_image_proc_rectify_mono_right/parameter_descriptions
/uav0/stereo/stereo_image_proc_rectify_mono_right/parameter_updates
/world
KimHyungSub commented 3 years ago

@Prashant446 Could you share any update about simulating multiple UAVs? Actually, I have the same problem.

001zwzwzw commented 2 years ago

@Prashant446 Could you share any update about simulating multiple UAVs? Actually, I have the same problem.thanks!

Cavalletta98 commented 1 year ago

How do you get namespace near camera topics?