利用 make_plan 规划起点到目标点的路径,并且发布出去
2024-09-01 13:17:39
geometry_msgs::PoseStamped Start;
Start.header.seq = ;
Start.header.stamp = Time();
Start.header.frame_id = "map";
Start.pose.position.x = x1;
Start.pose.position.y = y1;
Start.pose.position.z = 0.0;
Start.pose.orientation.x = 0.0;
Start.pose.orientation.y = 0.0;
Start.pose.orientation.w = 1.0; geometry_msgs::PoseStamped Goal;
Goal.header.seq = ;
Goal.header.stamp = Time();
Goal.header.frame_id = "map";
Goal.pose.position.x = x2;
Goal.pose.position.y = y2;
Goal.pose.position.z = 0.0;
Goal.pose.orientation.x = 0.0;
Goal.pose.orientation.y = 0.0;
Goal.pose.orientation.w = 1.0; ServiceClient check_path = nh_.serviceClient<nav_msgs::GetPlan>("make_plan");
nav_msgs::GetPlan srv;
srv.request.start = Start;
srv.request.goal = Goal;
srv.request.tolerance = 1.5; ROS_INFO("Make plan: %d", (check_path.call(srv) ? : ));
ROS_INFO("Plan size: %d", srv.response.plan.poses.size()); move_base_msgs::MoveBaseGoal move_goal;
move_goal.target_pose.header.frame_id = "map";
move_goal.target_pose.header.stamp = Time(); move_goal.target_pose.pose.position.x = x;
move_goal.target_pose.pose.position.y = y;
move_goal.target_pose.pose.position.z = 0.0;
move_goal.target_pose.pose.orientation.x = 0.0;
move_goal.target_pose.pose.orientation.y = 0.0;
move_goal.target_pose.pose.orientation.w = 1.0; ROS_INFO("Sending goal");
ac_.sendGoal(move_goal,boost::bind(&ExploreAction::doneCb, this, _1, _2));
参考:
https://answers.ros.org/question/264369/move_base-make_plan-service-is-returning-an-empty-path/
最新文章
- jquery-validation 使用
- Android 进阶Android 中的 IOC 框架 【ViewInject】 (上)
- Jmeter--HTTP Cookie管理器
- 删除svn文件的批处理文件
- @Html.DropDownList 设置选中值无效
- Android adb 无线调试
- SHA-2 Certificate Signing Request
- 从ajax获取的数据无法通过Jquery选择器来调用事件
- DDoS-Deflate安装及配置
- JVM调优总结10-调优方法
- MongoDB的交互(mongodb/node-mongodb-native)、MongoDB入门
- “Cache-control”常见的取值有private、no-cache、max-age、must-revalidate等
- 团体程序设计天梯赛-练习集L1-010. 比较大小
- linux配置备忘
- ActiveMQ (二) 常用配置简介
- Oracle闪回恢复
- JavaScript中的高阶函数
- Git里有些费解的术语和设计
- java解决手机上传竖拍照片旋转90\180\270度问题
- 安装Thinkphp5
热门文章
- NoSql 使用小结
- C# mailKit 发邮件 简单代码
- H5之拖拽
- 开源项目hutool之zip_slip漏洞
- What is Verbose Garbage Collection (verbosegc) and How do I Enable it on WebLogic
- PL/SQL Developer_如何快速获得表名或全部列名的文本形式
- 开源框架---tensorflow c++ API 一个卡了很久的问题
- FRDM-KL43开发板驱动段式液晶SLCD的实现方法
- Redis未授权访问漏洞复现及修复方案
- YUSS Round 1