Ubuntu22.04源码安装ROS-noetic(ROS1非ROS2),编译运行VINS-MONO

1. Ubuntu22.04源码编译安装ROS-noetic

由于22.04默认安装ROS2,但很多仓库都是基于ROS1的,不想重装系统,参考这两个博客安装了ROS-noetic:

我的库版本(实测可行):

  • eigen:3.3.7
  • ceres:1.14.0(用2.系列版本的编译时需要把C++版本设为14,可能也可以适配,但我当时折腾时用我这一套跑通了,直接github clone源码然后cmake… , make,sudo make install即可)
  • opencv:3.4.15

编译可能会出现一些bug,先解掉能编过,一会儿改了cv_bridge后再编一次。

编译ROS时,按照博客1里面的解决掉bug,剩下的应该可以编过,如果可能会出现编译不过的情况,比如返回值不是0之类的,尝试接着从没编过的包开始继续编译:

./src/catkin/bin/catkin_make_isolated --from-pkg 你失败的包的名字 --install -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3

如果还编不过就google或者GPT吧。

更改cv_bridge

ROS-noetic默认使用OpenCV 4,我试过改源码适配4,但是最后还是有别的问题,而且别的仓库用3的可能也多一点,所以我就参照参考博客2中的方法改了cv_bridge(其实就是替换了ROS源码中的src/vision_opencv/cv_bridge下的相应的cv_bridge的源码,然后删掉build_isolated, devel_isolated,install_isolated文件夹后重编,不删可能会出现奇怪的问题),改好的cv_bridge结果如下:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

2. 跑VINS-MONO

工程编译过之后就可以run起来了:

# 跑VINS-MONO
roslaunch vins_estimator euroc.launch
# 跑可视化rviz
roslaunch vins_estimator vins_rviz.launch
# 跑数据,发出topic
rosbag play /mnt/For_Linux/Dataset/EuRoc/machine_hall/MH_01_easy/MH_01_easy.bag

在这里插入图片描述

跑出来后可以接着深入看代码了,边改边看。


代码解读系列文章:

VINS-MONO代码解读1----配置文件,数据结构,前端feature_tracker
VINS-MONO代码解读2----vins_estimator(整体pipeline和KF selection部分)
VINS-MONO代码解读3----vins_estimator(鲁棒初始化部分)
VINS-MONO代码解读4----vins_estimator(后端求解部分)
VINS-MONO代码解读5----vins_estimator(marginalization部分)
VINS-MONO代码解读6----pose_graph(完结篇)
代码注释和扩展工作已上传GitHub

  • 0
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
首先,确保你已经安装Ubuntu 22.04操作系统。然后,按照以下步骤安装ROS Noetic: 1. 添加ROS Noetic软件仓库 打开终端,运行以下命令: ``` sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-noetic.list' ``` 2. 添加ROS公钥 运行以下命令: ``` curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - ``` 3. 更新软件包列表 运行以下命令: ``` sudo apt update ``` 4. 安装ROS Noetic 运行以下命令: ``` sudo apt install ros-noetic-desktop-full ``` 此命令将安装ROS Noetic的完整版本,包括可视化工具和仿真环境。 5. 初始化rosdep 运行以下命令: ``` sudo rosdep init rosdep update ``` 6. 设置ROS环境变量 运行以下命令: ``` echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc ``` 7. 安装ROS工具 运行以下命令: ``` sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool build-essential ``` 完成上述步骤后,ROS Noetic已经安装Ubuntu 22.04中。你可以通过运行以下命令测试安装: ``` roscore ``` 如果一切正常,你应该能够看到ROS Master节点启动并输出以下消息: ``` ... logging to /home/your_user_name/.ros/log/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/roslaunch-ubuntu-xxxxx.log started roslaunch server http://xxx.xxx.xxx.xxx:xxxxx/ ros_comm version x.x.x SUMMARY ======== PARAMETERS * /rosdistro: noetic * /rosversion: x.x.x NODES auto-starting new master process[master]: started with pid [xxxx] ROS_MASTER_URI=http://xxx.xxx.xxx.xxx:xxxxx/ setting /run_id to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx process[rosout-1]: started with pid [xxxx] started core service [/rosout] ``` 现在你已经成功安装ROS Noetic

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值