本帖最后由 hazyparker 于 2022-3-14 21:07 编辑
参考单目在添加单目相机时,根据参考在launch文件的vehicle model中添加iris_fpv_cam,即 - <!-- vehicle model and world -->
- <arg name="est" default="ekf2"/>
- <arg name="vehicle" default="iris"/>
- <!-- add stereo camera for iris -->
- <arg name="my_camera" default="iris_fpv_cam"/>
- <arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/empty.world"/>
- <!-- also need to revise sdf -->
- <arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg my_camera)/$(arg my_camera).sdf"/>
- <!-- <arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf"/> -->
复制代码
之后运行roslaunch该launch文件,使用rostopic list,可以得到如下话题:
/iris/usb_cam/camera_info /iris/usb_cam/image_raw /iris/usb_cam/image_raw/compressed /iris/usb_cam/image_raw/compressed/parameter_descriptions /iris/usb_cam/image_raw/compressed/parameter_updates /iris/usb_cam/image_raw/compressedDepth /iris/usb_cam/image_raw/compressedDepth/parameter_descriptions /iris/usb_cam/image_raw/compressedDepth/parameter_updates /iris/usb_cam/image_raw/theora /iris/usb_cam/image_raw/theora/parameter_descriptions /iris/usb_cam/image_raw/theora/parameter_updates /iris/usb_cam/parameter_descriptions
/iris/usb_cam/parameter_updates
可以看出ros拿到了相机图像的数据,用rqt_image_view也可以拿到图像;
因此双目也参考类似的方法;
双目写法- <!-- vehicle model and world -->
- <arg name="est" default="ekf2"/>
- <arg name="vehicle" default="iris"/>
- <!-- add stereo camera for iris -->
- <arg name="my_camera" default="iris_stereo_camera"/>
- <arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/empty.world"/>
- <!-- also need to revise sdf -->
- <arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg my_camera)/$(arg my_camera).sdf"/>
- <!-- <arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf"/> -->
复制代码
问题同样的,launch之后用rostopic list,发现没有任何关于iris的cam的话题,rqt_image_view也是什么都没有,是我调用方法不对吗还是?
eason已获得悬赏 3 阿木币最佳答案
单目和双目不一样啊,双目有鱼眼相机的双目和深度相机的双目,简单说为T265相机和D435i相机。两者使用的gazebo插件都不一样,双目的sdf文件你可以参考 https://github.com/amov-lab/Prometheus/blob/master/Simulato ...
|