ROS报错记录及解决方法(不定期更新)

ROS下载缓慢

如果是在国内安装,建议在安装之前先配置国内的镜像源,在软件和更新进行更改即可
在这里插入图片描述

参考:Ubuntu18.04下安装ROS

由于没有公钥,无法验证下列签名

安装ROS时报错:

W: GPG 错误:http://mirrors.ustc.edu.cn/ros/ubuntu bionic InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY F42ED6FBAB17C654
E: 仓库 “http://mirrors.ustc.edu.cn/ros/ubuntu bionic InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。

解决方法:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F42ED6FBAB17C654

其中F42ED6FBAB17C654要替代为报错时NO_PUBKEY后的序列号

fatal error: ros/ros.h: 没有那个文件或目录

使用VScode配置ROS开发环境时报错

fatal error: ros/ros.h: 没有那个文件或目录

解决方法为在创建ROS包时,要选择roscpp依赖项

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
)

tf时间戳

出现警告

Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 1.59764e+09 according to authority unknown_publisher

解决方法

rosparam set use_sim_time true

安装Realsense的ROS功能包报错

CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by
  "ddynamic_reconfigure" with any of the following names:

    ddynamic_reconfigureConfig.cmake
    ddynamic_reconfigure-config.cmake

  Add the installation prefix of "ddynamic_reconfigure" to CMAKE_PREFIX_PATH
  or set "ddynamic_reconfigure_DIR" to a directory containing one of the
  above files.  If "ddynamic_reconfigure" provides a separate development
  package or SDK, be sure it has been installed.

https://github.com/pal-robotics/ddynamic_reconfigure/tree/kinetic-devel下载ddynamic_reconfigure,放到/src文件夹下,重新编译即可

运行时报错:undefined symbol

报错信息:

devel/lib//libsampling_planner_lib.so: undefined symbol: _ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE

使用以下指令查看具体报错信息:

c++filt _ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE

返回:

base_local_planner::CostmapModel::CostmapModel(costmap_2d::Costmap2D const&)

可以看出是找不到base_local_planner依赖项
解决方法:在CMakeList的find_package字段中加入base_local_planner

error: invalid use of non-static member function ‘xxxx’

在订阅话题时,回调函数必须是静态成员或者lambda表达式,不能直接使用类中非静态成员作为回调函数,可以使用boost::bind()函数进行处理,如下:

nh_.subscribe<livox_ros_driver::CustomMsg>("/livox/lidar", 100, 
                                        boost::bind(&ScanRegistration::laserCloudHandler, this, _1));

其中_1表示占位符

使用robot_upstart设置自启时,串口无法打开

有两个解决方法,一是在/etc/udev/rules.d中创建一个新文件,命名为:40-permissions.rules,填入一下内容:

KERNEL=="ttyACM0", MODE="0666"

但是在重启后该节点可能并不会工作,使用sudo service xxxx status查看该服务的状态时,发现有错误:

...'serial::IOException'  what(): IO Exception (16): Device or resource busy...

可能原因是系统还未完全启动,所以解决方法是:在打开串口前要进行延时,等待串口得到操作权限。

进程结束后,roslaunch没有退出

程序运行结束后显示如下,但是并没有退出终端

process has finished cleanly

解决方法:在<node>tag中添加required="true"

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值