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"