ROS利用RRT*导航代码报错process has died [pid 16501, exit code -11的解决方法
#ROS导航代码报错:[move_base-3] process has died [pid 7588, exit code 1, cmd /home/wheeltec-client/wheeltec_robot/devel/lib/move_base/move_base __name:=move_base __log:=/home/wheeltec-client/.ros/log/3a3df818-ebe7-11ed-afab-000c2926fa04/move_base-3.log].已解决
导航参考代码
参考这位老哥的RRT*代码:https://zhuanlan.zhihu.com/p/336867657
移植
参考了这位大哥的移植方法:https://blog.csdn.net/bluewhalerobot/article/details/73771020?utm_source=blogxgwz4
拿carrot_planner魔改再一顿复制粘贴就行。理论上来说,只要命名和内容都改完了,就没太大问题了。
报错
Failed to create the rrt_star_planner/RRTSTARPlanner planner, are yousure it is properly registered and that the containing library is built? Exception: MultiLibraryClassLoader: Could not create object of class type rt_star_planner::RRTSTARPlanner as no factory exists for it.Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
这是一开始发现的报错。结果发现是改代码时 rrt_star_planner::RRTSTARPlanner 写错写成了 rt_star_planner::RRTSTARPlanner。这种错误基本根据报错提示就能改正。
另外,有时也报错:
Failed to create the rrt_star_planner/RRTSTARPlanner planner, are you
sure it is properly registered and that the containing library is built?
的话,貌似可以通过运行setup.bash来使工作环境配置生效。
在工作空间文件夹运行:
source devel/setup.bash
有可能会解决问题。
重难点报错
只针对上述老大哥的代码哈~
process has died [pid 16501, exit code -11, cmd /home/wheeltec-client/wheeltec_robot/devel/lib/move_base/move_base __name:=move_base __log:=/home/wheeltec-client/.ros/log/128979f2-ec12-11ed-afab-000c2926fa04/move_base-3.log].
log file: /home/wheeltec-client/.ros/log/128979f2-ec12-11ed-afab-000c2926fa04/move_base-3*.log
这个报错是在利用Gazebo仿真导航launch文件运行后,再Rviz界面下使用Publish point设置初始点和目标点时会产生的。
由于哥们ROS不太懂,参考ROS官方导航代码planner_core.cpp中有:
bool GlobalPlanner::makePlanService(nav_msgs::GetPlan::Request& req, nav_msgs::GetPlan::Response& resp) {makePlan(req.start, req.goal, resp.plan.poses);resp.plan.header.stamp = ros::Time::now();resp.plan.header.frame_id = frame_id_;return true;
}
这样一个非常神秘的函数,但是老大哥的代码里并没有,于是仿照这个我也写了一个:
bool RRTSTARPlanner::makePlanService(nav_msgs::GetPlan::Request& req, nav_msgs::GetPlan::Response& resp) {makePlan(req.start, req.goal, resp.plan.poses);resp.plan.header.stamp = ros::Time::now();resp.plan.header.frame_id = frame_id_;return true;
}
在初始化函数下还加上了:
make_plan_service_ = private_nh.advertiseService("make_plan", &PlannerWithCostmap::makePlanService, this);
在头文件里加上了函数声明,结果该报错还是报错。(我甚至怀疑是move_base中的代码错了。)
解决
哥们只会笨办法,把 ROS_WARN(“ABCD”); 这个放到makeplan函数里寻找程序到底是在哪个位置崩了。终于发现,在一开始声明节点数组(叫容器吗?我不知道叫什么)时:
std::vector<Node> nodes;
貌似定义了一个空数组,里面没有东西。
接着在寻找最接近的节点时,直接引用这个:
node_nearest = getNearest(nodes, p_rand); // The nearest node of the random point
原函数:
Node RRTSTARPlanner::getNearest(std::vector<Node> nodes, std::pair<float, float> p_rand){Node node = nodes[0];for (int i = 1; i < nodes.size(); i++){if (distance(nodes[i].x, nodes[i].y, p_rand.first, p_rand.second) < distance(node.x, node.y, p_rand.first, p_rand.second))node = nodes[i];}return node;}
大概是因为其中没有节点,所以就报错了。
于是,在定义了起始节点之后,我就把起始节点加进去了:
Node start_node;start_node.x = start.pose.position.x;start_node.y = start.pose.position.y;start_node.node_id = 0;start_node.parent_id = -1; // None parent nodestart_node.cost = 0.0;nodes.push_back(start_node); //只有这一句是我加的
然后问题就解决了。
总结
我估计就是具体情况具体分析,一般就是某部分代码错了。如果你也可以像我一样,用 ROS_WARN(“ABCD”); 找代码运行到什么位置崩了,那真的是。。。!
ROS利用RRT*导航代码报错process has died [pid 16501, exit code -11的解决方法相关推荐
- DS-SLAM的运行[TUM-1] process has died [pid 27902, exit code -11, cmd /home/jerry/catkin_ws/src/DS-SLAM/
心态崩了 折腾了一周 还是没运行成功 上篇博客已经编译通过了,然后下载数据集 然后解压,然后别忘了下载tum数据集提供的关联工具工具associate.py 将associate.py拷贝到数据集目录 ...
- 启动gazebo失败报错[gazebo-1] process has died [pid 10999, exit code 255
启动完Gazebo后,关闭,再次启动出现如下报错: [gazebo-1] process has died [pid 10999, exit code 255, cmd /opt/ros/melodi ...
- 绝对路径! 报错:[gazebo-2] process has died [pid 2382, exit code 134
当执行 roslaunch turtlebot_gazebo turtlebot_world.launch world_file:=/PATH时,报错如下信息: (注:/PATH 是你要打开的worl ...
- ubuntu18.04 下运行roscore报错:[rosout-1] process has died [pid 13103, exit code 127
roscore之后报错: [rosout-1] process has died [pid 13103, exit code 127, cmd /opt/ros/melodic/lib/rosout/ ...
- [gazebo_gui-2] process has died [pid 4588, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzc
当打算算使用gazebo工具导入urdf模型进行仿真,首先在一个终端输入: roscore 再在另一个终端输入: roslaunch pkg_name xxxxx.launch 出现如下错误提 ...
- spawner: error: too few arguments [controller_spawner-4] process has died [pid 19013, exit code 2, c
用moveit生成配置文件后,启动roslaunch arm4 demo_gazebo.com报错,如下: spawner: error: too few arguments XmbTextListT ...
- [mbot_teleop-1] process has died [pid 3237, exit code 127, cmd /home/arise/sources/catkin_ws/src/mbo
在slam自主导航时候 启动键盘控制时候报错 错误: [mbot_teleop-1] process has died [pid 3237, exit code 127, cmd /home/aris ...
- 解决运行gazebo时出现“[gazebo-2] process has died [pid 7920, exit code 255.....“的问题
在运行gazebo时,经常出现"[gazebo-2] process has died [pid 7920, exit code 255, cmd /opt/ros/melodic/lib/ ...
- [robot_state_publisher-4] process has died [pid 20533, exit code 1, cmd /opt/ros/melodic/lib/robot_s
sudo gedit /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher 打开文件后,在文件头加上 reload(sys) ...
最新文章
- 刚刚,华为全场景 AI 计算框架MindSpore正式开源!国产深度学习框架的春天来了!...
- 服务器数据恢复难题--操作系统恢复的方法和思路
- linux下的nfs服务配置
- 图像降噪算法——Variance Stabilizing Transform / Generalization Anscombe Transform算法
- ubuntu18.04搭建 kubernetes(k8s)集群
- 【C++ 与 STL】栈:stack
- DataGrid中DropDownList触发SelectedIndexChanged事件并修改DataGrid行值(转载)
- trados 有道api_小白教程(四) | 你和专业翻译还差一个Trados
- VS2015静态库的使用(下)
- 业内人士解读:开发一个App到底要多少钱?
- 用Unity的GetSpectrumData方法识别钢琴曲中的钢琴琴键
- [导入]运筹帷幄之中,决胜千里之外(搜索世界的监视器为你所用)
- 廊坊金彩教育:怎么做好人群标签
- 全景Engine智能管理软件7.0-PLG模式全新上线
- cross_camera muti-target tracking项目
- Web身份验证(WebAuthn)
- JAVA-企业微信报警工具类
- 整合腾讯云地图的绘制和编辑几何图形
- 国家天地图API 创建点 覆盖物
- 推土距离, Wasserstein distance
热门文章
- 关于一加载jsp页面就跳转到servlet获取数据然后再跳回jsp页面的问题
- UGUI -TextMeshPro(TMP) 多材质
- 【HNOI2014】世界树
- Django前端开发:项目笔记及链接
- Android 装逼技术之暗码启动应用
- Cinnamon Applet 设置
- 配置目标跟踪开源项目traj_gen_vis踩过的坑
- 冯诺依曼计算机的主要组成及其特征
- nb757l400安装说明书_NB NB757-L400(32-60英寸)电视挂架 电视架 电视机挂架 电视支架 旋转伸缩 乐视海信海尔TCL康佳三星夏普LG...
- 要求输入一个企业员工的姓名,性别,工号,月基本工资,奖金补贴后,计算个人所得税。系统输出员工姓名,性别,工号,和月应发薪水和实发薪水(月应发薪水-个人所得税)