ubuntu 20.04 ROS Noetic 无serial包解决方法

ubuntu 20.04 ROS Noetic 无serial包解决方法

在ros-noetic版本之前的ros-kinetic或者ros-meldic版本,进行串口通信的时候可以采用

sudo apt-get install ros-kinetic-serial
或sudo apt-get install ros-meldic-serial

来安装serial包,但是在ros-noetic版本中,如果采用类似方法则会提示

E: Unable to locate package ros-noetic-serial

原因是因为ros-noetic为集成serial包,需要自己进行源码编译安装,具体做法如下:

cd ~
cd catkin_ws/src
git clone https://github.com/wjwwood/serial.git

进入serial目录编译,安装

cd serial
make
make install

当我们的ros其他功能包要调用serial时,则需要进行如下配置:
1.在serial文件夹下,对CMakeLists.txt进行如下修改

## Include headers
include_directories(include)
## 改成
## Include headers
include_directories(include  ${catkin_INCLUDE_DIRS})

2.在其他用到serial功能包中的package.xml中添加

  <build_depend>serial</build_depend>
  <build_export_depend>serial</build_export_depend>

3.在其他功能包中的CMakeLists.txt中的find语句里,添加serial的依赖,如

find_package(catkin REQUIRED COMPONENTS
  roscpp
  serial
  # 。。。
)

4.添加头文件路径

## Include headers
include_directories(include  ${catkin_INCLUDE_DIRS})

参考:
https://blog.youkuaiyun.com/tsuibeyond/article/details/106744745?spm=1001.2014.3001.5501

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值