发表于 2023-11-10 11:55:49
1823 浏览 1 回复
gazebo仿真中使用D435i模型frame_id问题
本帖最后由 Blank 于 2023-11-10 11:55 编辑
在github上找的iris_D453i模型在使用遇到的问题,github链接:tugepaopaoo/realsense_ros_gazebo: D435i, iris_D435i models in gazebo. (github.com)
单独打开D435i模型时,相机发布的主题如下:
rostopic list
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/depth/camera_info
/camera/depth/color/points
/camera/depth/image_raw
/camera/depth/image_raw/compressed
/camera/depth/image_raw/compressed/parameter_descriptions
/camera/depth/image_raw/compressed/parameter_updates
/camera/depth/image_raw/compressedDepth
/camera/depth/image_raw/compressedDepth/parameter_descriptions
/camera/depth/image_raw/compressedDepth/parameter_updates
/camera/depth/image_raw/theora
/camera/depth/image_raw/theora/parameter_descriptions
/camera/depth/image_raw/theora/parameter_updates
/camera/imu
/camera/infra1/camera_info
/camera/infra1/image_raw
/camera/infra1/image_raw/compressed
/camera/infra1/image_raw/compressed/parameter_descriptions
/camera/infra1/image_raw/compressed/parameter_updates
/camera/infra1/image_raw/compressedDepth
/camera/infra1/image_raw/compressedDepth/parameter_descriptions
/camera/infra1/image_raw/compressedDepth/parameter_updates
/camera/infra1/image_raw/theora
/camera/infra1/image_raw/theora/parameter_descriptions
/camera/infra1/image_raw/theora/parameter_updates
/camera/infra2/camera_info
/camera/infra2/image_raw
/camera/infra2/image_raw/compressed
/camera/infra2/image_raw/compressed/parameter_descriptions
/camera/infra2/image_raw/compressed/parameter_updates
/camera/infra2/image_raw/compressedDepth
/camera/infra2/image_raw/compressedDepth/parameter_descriptions
/camera/infra2/image_raw/compressedDepth/parameter_updates
/camera/infra2/image_raw/theora
/camera/infra2/image_raw/theora/parameter_descriptions
/camera/infra2/image_raw/theora/parameter_updates
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg
查看/camera/color/image_raw话题的frame_id如下:
rostopic echo /camera/color/image_raw | grep frame_id
frame_id: "camera_color_frame"
frame_id: "camera_color_frame"
但是当我使用iris_D435i模型时
topic如下:
rostopic list
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressed/parameter_descriptions
/camera/color/image_raw/compressed/parameter_updates
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/compressedDepth/parameter_descriptions
/camera/color/image_raw/compressedDepth/parameter_updates
/camera/color/image_raw/theora
/camera/color/image_raw/theora/parameter_descriptions
/camera/color/image_raw/theora/parameter_updates
/camera/depth/camera_info
/camera/depth/color/points
/camera/depth/image_raw
/camera/depth/image_raw/compressed
/camera/depth/image_raw/compressed/parameter_descriptions
/camera/depth/image_raw/compressed/parameter_updates
/camera/depth/image_raw/compressedDepth
/camera/depth/image_raw/compressedDepth/parameter_descriptions
/camera/depth/image_raw/compressedDepth/parameter_updates
/camera/depth/image_raw/theora
/camera/depth/image_raw/theora/parameter_descriptions
/camera/depth/image_raw/theora/parameter_updates
/camera/imu
/camera/infra1/camera_info
/camera/infra1/image_raw
/camera/infra1/image_raw/compressed
/camera/infra1/image_raw/compressed/parameter_descriptions
/camera/infra1/image_raw/compressed/parameter_updates
/camera/infra1/image_raw/compressedDepth
/camera/infra1/image_raw/compressedDepth/parameter_descriptions
/camera/infra1/image_raw/compressedDepth/parameter_updates
/camera/infra1/image_raw/theora
/camera/infra1/image_raw/theora/parameter_descriptions
/camera/infra1/image_raw/theora/parameter_updates
/camera/infra2/camera_info
/camera/infra2/image_raw
/camera/infra2/image_raw/compressed
/camera/infra2/image_raw/compressed/parameter_descriptions
/camera/infra2/image_raw/compressed/parameter_updates
/camera/infra2/image_raw/compressedDepth
/camera/infra2/image_raw/compressedDepth/parameter_descriptions
/camera/infra2/image_raw/compressedDepth/parameter_updates
/camera/infra2/image_raw/theora
/camera/infra2/image_raw/theora/parameter_descriptions
/camera/infra2/image_raw/theora/parameter_updates
/clock
/diagnostics
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/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_float_array
/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
查看/camera/color/image_raw话题的frame_id变成了这样:
rostopic echo /camera/color/image_raw | grep frame_id
frame_id: "D435i::camera_color_frame"
frame_id: "D435i::camera_color_frame"
D435i发布的话题的frame_id前面都带了D435i,使用rtabmap建图时,报错
[ WARN] [1699587886.688285422, 886.259000000]: Could not get transform from base_link to D435i::camera_color_frame after 0.200000 seconds (for stamp=885.501000)! Error="canTransform: source_frame D435i::camera_color_frame does not exist.. canTransform returned after 0.201 timeout was 0.2.".
[ERROR] [1699587886.688376422, 886.259000000]: TF of received image 0 at time 885.501000s is not set!
[ERROR] [1699587886.688411322, 886.259000000]: Could not convert rgb/depth msgs! Aborting rtabmap_viz update...
整体的tf树如下:
请问大佬如何解决在gazebo中iris_D435i,使用rtabmap建图的问题
附上launch文件:
<launch>
<node pkg = "tf" name ="camera_to_base_link" type = "static_transform_publisher" args ="0.1 0 0 0 0 0 base_link camera_link 100" />
<!-- vehicle pose-->
<arg name ="x" default ="0" />
<arg name ="y" default ="0" />
<arg name ="z" default ="0" />
<arg name ="R" default ="0" />
<arg name ="P" default ="0" />
<arg name ="Y" default ="0" />
<arg name ="world" default ="$(find my_px4)/sim/worlds/test_world.world" />
<arg name ="sdf" default ="$(find realsense_ros_gazebo)/sdf/iris_D435i/iris_D435i.sdf" />
<arg name ="verbose" default ="false" />
<arg name ="debug" default ="false" />
<include file ="$(find px4)/launch/mavros_posix_sitl.launch" >
<arg name ="x" value ="$(arg x)" />
<arg name ="y" value ="$(arg y)" />
<arg name ="z" value ="$(arg z)" />
<arg name ="R" value ="$(arg R)" />
<arg name ="P" value ="$(arg P)" />
<arg name ="Y" value ="$(arg Y)" />
<arg name ="sdf" value ="$(arg sdf)" />
<arg name ="verbose" value ="$(arg verbose)" />
<arg name ="debug" value ="$(arg debug)" />
<arg name ="world" value ="$(arg world)" />
</include>
</launch>
rtabmap的launch文件:
<launch>
<include file ="$(find rtabmap_ros)/launch/rtabmap.launch" >
<arg name ="rtabmap_args" value ="--delete_db_on_start" />
<arg name ="rgb_topic" value ="/camera/color/image_raw" />
<arg name ="depth_topic" value ="/camera/depth/image_raw" />
<arg name ="camera_info_topic" value ="/camera/color/camera_info" />
<arg name ="depth_camera_info_topic" value ="/camera/depth/camera_info" />
<arg name ="approx_sync" value ="true" />
<arg name ="visual_odometry" value ="false" />
<arg name ="map_frame_id" value ="map" />
<arg name ="frame_id" value ="base_link" />
<arg name ="odom_topic" value ="/mavros/local_position/odom" />
<arg name ="rviz" value ="true" />
<arg name ="rtabmapviz" value ="true" />
<arg name ="queue_size" value ="10" />
</include>
</launch>
Blank已获得悬赏 3 阿木币 最佳答案
使用的是px4-PX4 Autopilot 1.12.3版本
扫一扫浏览分享
楼主|
发表于 2023-11-10 11:59:42
使用的是px4-PX4 Autopilot 1.12.3版本