当前位置:   article > 正文

基于gazebo的四旋翼无人机iris双目相机ORB_SLAM2_orbslam2无人机

orbslam2无人机

gazebo环境中的四旋翼双目ORB仿真

ORB SLAM2的编译

Build

cd ORB_SLAM2
chmod +x build.sh
./build.sh
  • 1
  • 2
  • 3

Build in ROS

  • copy ORB_SLAM2 to catkin_ws/src
  • add Path, export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/catkin_ws/src/ORB_SLAM2/Examples/ROS to .bashrc
  • source ~/.bashrc

in file catkin_ws/src/ORB_SLAM2

chmod +x build_ros.sh
./build_ros.sh
  • 1
  • 2

遇到的BUG基本上找关键词然后在网上可以解决,也可以参考ORB SLAM2 configuration(with bugs fixed),我应该是遇到了比较多的bug

gazebo中world的搭建

双目相机的搭建

  • px4/launch中找mavros_posix_sitl.launch
  • 拷贝一份作备份
  • 修改如下
    <!-- 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"/> -->
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • .gazebo/models中删除stereo_camera,因为默认先选这个,这里要用px4/tools/sitl_gazebo/models里面的

运行

我在launch了mavros_posix_sitl.launch后,使用rostopic list命令,发现有:

/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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

存在,于是构建对应的.sh文件

rosrun ORB_SLAM2 Stereo ~/catkin_ws/src/ORB_SLAM2/Vocabulary/ORBvoc.txt ~/catkin_ws/src/ORB_SLAM2/Examples/Stereo/px4_sitl.yaml true /camera/left/image_raw:=/stereo/left/image_raw /camera/right/image_raw:=/stereo/right/image_raw /orbslam2/vision_pose/pose:=/mavros/vision_pose/pose
  • 1

结果如下:

stereo

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/683884?site
推荐阅读
相关标签
  

闽ICP备14008679号