ros2常用网址之抗orb-slam3时查找的资料

ros一键安装:

wget http://fishros.com/install -O fishros && . fishros

运行orb-slam3

./Monocular/mono_euroc ../Vocabulary/ORBvoc.txt ./Monocular/EuRoC.yaml ../dataset/MH01 ./Monocular/EuRoC_TimeStamps/MH01.txt

ros教程

https://getiot.tech/ros2/ros2-installation-on-ubuntu/

ros2打开摄像头

https://blog.youkuaiyun.com/xiaoc100200/article/details/126682060

出现错误按这篇:Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [py]: No module named 'pydantic'
https://blog.youkuaiyun.com/weixin_64037619/article/details/135744098

ros2_usb摄像头标定

pip install pydantic==1.10.14
sudo apt install ros-humble-usb-cam
 
# 显示图像
ros2 run image_view image_view image:=/camera1/image_raw
出错:Package 'image_view' not found
sudo apt-get install ros-humble-image-view

棋盘格标定板生成

https://calib.io/pages/camera-calibration-pattern-generator

cam_slam3

// cam_slam3.cpp
// 该文件将打开你电脑的摄像头,并将图像传递给ORB-SLAM3进行定位

// opencv
#include <opencv2/opencv.hpp>

// ORB-SLAM的系统接口
#include <System.h>
#include <string>
#include <chrono>   // for time stamp
#include <iostream>

using namespace std;

// 参数文件与字典文件
// 如果你系统上的路径不同,请修改它
string parameterFile = "../mycam.yaml"//如果没有标定可以用Examples里的yaml文件代替,比如TUM1.yaml
string vocFile = "../../Vocabulary/ORBvoc.txt"

int main(int argc, char **argv) {

    // 声明 ORB-SLAM3 系统
    ORB_SLAM3::System SLAM(vocFile, parameterFile, ORB_SLAM3::System::MONOCULAR, true);

    // 获取相机图像代码
    cv::VideoCapture cap(0);    //改变参数来调用不同相机

    // 分辨率设为640x480
    cap.set(cv::CAP_PROP_FRAME_WIDTH, 640);;//设置采集视频的宽度
    cap.set(cv::CAP_PROP_FRAME_HEIGHT, 480);//设置采集视频的高度

    // 记录系统时间
    auto start = chrono::system_clock::now();

    while (1) {
        cv::Mat frame;
        cap >> frame;   // 读取相机数据
        auto now = chrono::system_clock::now();
        auto timestamp = chrono::duration_cast<chrono::milliseconds>(now - start);
        SLAM.TrackMonocular(frame, double(timestamp.count())/1000.0);
    }

    return 0;
}

使用本地摄像头跑ORB_SLAM3

https://blog.youkuaiyun.com/m0_73694897/article/details/130391045
https://blog.youkuaiyun.com/chb1945626852/article/details/123311420

自备相机IMU跑通VinsMono记录

https://www.cnblogs.com/lugendary/p/16717782.html

orb-slam3生成点云地图

sudo apt-get install libpcl-dev pcl-tools
https://blog.youkuaiyun.com/Aer_7z/article/details/132645349

安装orb-slam3

step1、安装 eigen-git-mirror-3.3.7
    不要忘记make install
step2、安装 Pangolin-0.9.2
    apt install libepoxy-dev
    sudo ldconfig
    不要忘记make install
step3、安装 boost
    apt install libboost-all-dev
step4、安装 orb-slam3
    修改build.sh下make -jx,x是2,如果是make -j的话,使用全部线程会卡死。
    build_ros.sh,该文件在用到ros的情况下是需要编译的。否则只能运行例程数据。
    直接运行./build.sh会出错。在首目录下的CMakeLists.txt中添加add_compile_options(-std=c++14)
    【运行./build.sh_ros.sh,这一个可以跳过】
step5、配置dataset与本地数据运行测试。
    mkdir dataset/MH01 -p
    将数据集MH_01_easy.zip解压到首目录的dataset下。
    解压 ORB_SLAM3-1.0-release/Vocabulary 下文件。
    ./Monocular/mono_euroc ../Vocabulary/ORBvoc.txt ./Monocular/EuRoC.yaml ../dataset/MH01 ./Monocular/EuRoC_TimeStamps/MH01.txt

    运行后不显示图像,没有窗口出现:
我们打开mono_euroc.cc查看,第83行

// Create SLAM system. It initializes all system threads and gets ready to process frames.
    ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::MONOCULAR, false)
https://blog.youkuaiyun.com/weixin_43318393/article/details/132279858
 

ROS2中node之最简单的HelloWorld(C++)案例

https://blog.youkuaiyun.com/weixin_43488529/article/details/138151602

提示opencv缺少功能


Camera Parameters: 
- Camera: Pinhole
- fx: 458.65399169921875
- fy: 457.29598999023438
- cx: 367.21499633789062
- cy: 248.375
- k1: -0.28340810537338257
- k2: 0.073959067463874817
- p1: 0.00019359000725671649
- p2: 1.7618711353861727e-05
- fps: 20
- color order: RGB (ignored if grayscale)

ORB Extractor Parameters: 
- Number of Features: 1000
- Scale Levels: 8
- Scale Factor: 1.2000000476837158
- Initial Fast Threshold: 20
- Minimum Fast Threshold: 7
Framebuffer with requested attributes not available. Using available framebuffer. You may see visual artifacts.terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.5.2) /opencv/modules/highgui/src/window.cpp:662: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

./run_test.sh: line 1:    60 Aborted                 (core dumped) ./Monocular/mono_euroc ../Vocabulary/ORBvoc.txt ./Monocular/EuRoC.yaml ../dataset/MH01 ./Monocular/EuRoC_TimeStamps/MH01.txt


sudo apt-get install libgtk2.0-dev pkg-config

下载opencv4.5.2,build
一定要先安装sudo apt-get install libgtk2.0-dev pkg-config,再运行cmake,只有这样才会出现gtk yes

编译过程中,会出现错误。因为是多线程编译,在错误发生的情况下,其它线程是会断续编译的。
我们等编译结束,再次编译,就OK了。

还是出错,我们使用make 什么都不加,这回正确了。
先apt remove libopencv-dev
然后make install
出错:/root/opencv-4.5.2/modules/imgcodecs/src/grfmt_exr.hpp:52:10: fatal error: ImfChromaticities.h: No such file or directory
 #include <ImfChromaticities.h>
解决:
sudo apt-get install libopenexr-dev

fatal error: tiff.h: No such file or directory
解决:
apt install libtiff5-dev

fatal error: libavformat/avformat.h: No such file or directory
解决:
apt install ffmpeg


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值