当前位置:   article > 正文

ubuntu22.04 安装 ros1

ubuntu22.04 安装 ros1

ubuntu22.04 安装 ros1

概要

原先只知道ros1 noetic 只支持到ubuntu20.04。现在系统必须升级到ubuntu22.04。

尝试一

Ubuntu22.04 apt 安装 ROS1 ROS Noetic Ninjemys
按照这个教程,

echo "deb [trusted=yes arch=amd64] http://deb.repo.autolabor.com.cn jammy main" | sudo tee /etc/apt/sources.list.d/autolabor.list

sudo apt update

sudo apt install ros-noetic-autolabor
  • 1
  • 2
  • 3
  • 4
  • 5

安装后,发现没有opencv,安装

sudo apt install libopencv-dev
  • 1

后拷贝到 /usr/local/include/opencv,编译还是报错

报错一

/usr/include/log4cxx/boost-std-configuration.h:10:18: error: ‘shared_mutex’ in namespace ‘std’ does not name a type
   10 |     typedef std::shared_mutex shared_mutex;
      |                  ^~~~~~~~~~~~
/usr/include/log4cxx/boost-std-configuration.h:10:13: note: ‘std::shared_mutex’ is only available from C++17 onwards
   10 |     typedef std::shared_mutex shared_mutex;
      |             ^~~
/usr/include/log4cxx/boost-std-configuration.h:12:30: error: ‘shared_lock’ in namespace ‘std’ does not name a template type
   12 |     using shared_lock = std::shared_lock<T>;
      |                              ^~~~~~~~~~~
/usr/include/log4cxx/boost-std-configuration.h:12:25: note: ‘std::shared_lock’ is only available from C++14 onwards
   12 |     using shared_lock = std::shared_lock<T>;
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

编译器设置为c++17还是无效,故放弃。

尝试二

Ubuntu 22.04安装和使用ROS1可行吗

sudo apt install ros-desktop-full-dev
  • 1

安装后,版本为Debian,1.15.14

$: roscore

SUMMARY
========

PARAMETERS
 * /rosdistro: Debian
 * /rosversion: 1.15.14

NODES
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

编译与报错一一致
尝试方法

#修改文件
sudo gedit /usr/include/log4cxx/boost-std-configuration.h 

#将以下代码
#define STD_SHARED_MUTEX_FOUND 1
#define Boost_SHARED_MUTEX_FOUND 0

#修改为
#define STD_SHARED_MUTEX_FOUND 0
#define Boost_SHARED_MUTEX_FOUND 1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

编译通过

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号