CCM_SLAM多无人机视觉SLAM仿真(gazebo环境)

0. 偷师学艺

follow instructions:

For using you own datasets or camera, you need to create according calibration and launch files:

  • Create a new camera calibration file, e.g. by copying and adjusting

    conf/vi_euroc.yaml
    
    • If you don’t know the parameters of your camera, you can find them using a camera calibration toolbox, such as kalibr.
  • Create a new launch file, e.g. by copying and adjusting

    launch/EuRoC/Client0_euroc.yaml
    
    • Change the parameter cam to the path of your new camera file.
    • Change the parameter TopicNameCamSub to the name of your camera topic.
    • Hint: If you have an existing rosbag-file with camera data, you can directly modify the topic when playing the bagfile: rosbag play mybag.bag existing_topic:=new_name
  • There is no need to change Server.launch, however, you can adjust the number of Agents in the system by changing NumOfClients. The maximum is set to 4 in the current implementation.

  • If you are using a downward-looking camera instead of a forward-looking (as in the EuRoC sequences), it is recommended to change the rotational part of the static transform publishers in the launch files to 0 0 -3.142, e.g. <node pkg="tf" type="static_transform_publisher" name="linkS0_broadcaster" args="0 0 5 0 0 -3.142 world odomS0 100" />.

  • There should be no need to change the name of the frame-IDs, such as odomC0.

1. 设置相机参数文件

cslam/conf中添加之前ORB用的px4_sitl.yaml参数文件

2. 新建launch文件

先参考一下ccm自带的写成什么样, Client0_euroc.launch

<?xml version="1.0"?>
<launch>

<arg name="dist" default="0"/>
<arg name="cam" default="$(find ccmslam)/conf/vi_euroc.yaml"/>

  <group ns="ccmslam">

  <node pkg="tf" type="static_transform_publisher" name="linkC0_broadcaster" args="-100 300 5 -1.571 0 -2 world odomC0 100" /> 

<node pkg="ccmslam" type="ccmslamClientNode" name="ccmslamClientNode0" args="$(find ccmslam)/conf/ORBvoc.txt $(arg cam)" output="screen">

  <!-- ++++++++++++++++++++++++++++++++++++++++++++++ -->
  <!-- Agent Specific Params - !!!MUST BE ADJUSTED!!! -->

  <param name="~FrameId" type="string" value="odomC0" />
  <param name="~ClientId" type="int" value="0" />

  <param name="~TopicNameCamSub" type="string" value="/cam0/image_raw" />

  <param name="~MapInTopicName" type="string" value="MapOutServer0" unless="$(arg dist)" />
  <param name="~MapInTopicName" type="string" value="MapOutServer0Disturbed" if="$(arg dist)" /> 

</node>

  </group>
</launch>

按需求更改;

<?xml version="1.0"?>
<launch>

<arg name="dist" default="0"/>
<arg name="cam" default="$(find ccmslam)/conf/px4_sitl.yaml"/>

  <group ns="ccmslam">

  <node pkg="tf" type="static_transform_publisher" name="linkC0_broadcaster" args="-100 300 5 -1.571 0 -2 world odomC0 100" /> 

<node pkg="ccmslam" type="ccmslamClientNode" name="ccmslamClientNode0" args="$(find ccmslam)/conf/ORBvoc.txt $(arg cam)" output="screen">

  <!-- ++++++++++++++++++++++++++++++++++++++++++++++ -->
  <!-- Agent Specific Params - !!!MUST BE ADJUSTED!!! -->

  <param name="~FrameId" type="string" value="odomC0" />
  <param name="~ClientId" type="int" value="0" />

  <param name="~TopicNameCamSub" type="string" value="/iris0/usb_cam/image_raw" />

  <param name="~MapInTopicName" type="string" value="MapOutServer0" unless="$(arg dist)" />
  <param name="~MapInTopicName" type="string" value="MapOutServer0Disturbed" if="$(arg dist)" /> 

</node>

  </group>
</launch>

修改Server.launch中的client number

3. 运行

  • launch px4 launch file

  • roslaunch ccmslam Server.launch

  • roslaunch ccmslam Client0_px4.launch

  • roslaunch ccmslam Client1_px4.launch

  • use rviz to show,

  • roscd ccmslam
    rviz -d conf/rviz/ccmslam.rviz
    

过程如图:

在这里插入图片描述
结果
在这里插入图片描述

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值