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/

利用 make_plan 规划起点到目标点的路径,并且发布出去的更多相关文章

  1. [LeetCode] All Paths From Source to Target 从起点到目标点到所有路径

    Given a directed, acyclic graph of N nodes.  Find all possible paths from node 0 to node N-1, and re ...

  2. SDUT OJ 图练习-BFS-从起点到目标点的最短步数 (vector二维数组模拟邻接表+bfs , *【模板】 )

    图练习-BFS-从起点到目标点的最短步数 Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 在古老的魔兽传说中,有两个军团,一个叫天 ...

  3. 【强化学习】1-1-2 “探索”(Exploration)还是“ 利用”(Exploitation)都要“面向目标”(Goal-Direct)

    title: [强化学习]1-1-2 "探索"(Exploration)还是" 利用"(Exploitation)都要"面向目标"(Goal ...

  4. hdoj 2196 Computer【树的直径求所有的以任意节点为起点的一个最长路径】

    Computer Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  5. YOLOv5目标检测源码重磅发布了!

    YOLOv5目标检测源码重磅发布了! https://github.com/ultralytics/yolov5 该存储库代表了对未来对象检测方法的超解析开源研究,并结合了在使用之前的YOLO存储库在 ...

  6. JAVA根据A星算法规划起点到终点二维坐标的最短路径

    工具类 AStarUtil.java import java.util.*; import java.util.stream.Collectors; /** * A星算法工具类 */ public c ...

  7. 图练习-BFS-从起点到目标点的最短步数(sdut 2830)邻接边表

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2830 题目描述 在古老的魔兽传说中,有两个军团 ...

  8. 图练习-BFS-从起点到目标点的最短步数

    http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2830 简单bfs #include <s ...

  9. Algorithm-多目标优化-博文路径

    参考博文: 多目标进化算法(MOEA)概述: https://blog.csdn.net/qithon/article/details/72885053 多目标优化问题的算法及其求解: https:/ ...

随机推荐

  1. SQL查看数据库中每张表的数据量和总数据量

    查看所有表对应的数据量 SELECT a.name AS 表名, MAX(b.rows) AS 记录条数 FROM sys.sysobjects AS a INNER JOIN sys.sysinde ...

  2. Python windows环境 搭建问题

    环境安装包下载地址: https://pan.baidu.com/s/1bnVhHMZ?fid=642139599707514 百度地址: http://sw.bos.baidu.com/sw-sea ...

  3. jenkins pipline

    def getHost(){ def remote = [:] remote.name = 'server02' remote.host = '39.19.90' remote.user = 'roo ...

  4. linux IPC简单学习

    Posix和system v区别 所谓的IPC(进程间通信)指的是消息队列,共享内存,信号量3种机制合并起来,当然,这是个狭义的概念,只包含这三种.IPC又可以分为system v进程间通信和posi ...

  5. springboot学习入门简易版二---springboot2.0项目创建

    2 springboot项目创建(5) 环境要求:jdk1.8+ 项目结构: 2.1创建maven工程 Group id :com.springbootdemo Artifact id: spring ...

  6. 安装xshell、xftp

    1.Xshell的软件的下载.安装 xshell是一个终端模拟软件,而且是远程近程都可以. 就是模拟服务器所在的linux,在xshell中可以输入命令, 就像在服务器的linux中输入命令一样.一般 ...

  7. python中read()、readline()、readlines()区别

    1.read([size])方法 read([size])方法从文件当前位置读取size个字节,若无参数size,则表示读取至文件结束位置,它范围为字符串对象   2.readline()方法 从字面 ...

  8. Android笔记(三十四) Android中线程之间的通信(六)Handle中的post()方法详解

    我们之前都是使用sendMessage()方法来发送消息,使用handleMessage来处理消息的,今天我们来看另外一种方法,先看代码: package cn.lixyz.handlertest; ...

  9. java - day018 - 线程续

    生产者,消费者 线程间的通信模型 等待和通知 在生产者和消费者模型中 消费者暂停等待数据 生产者产生数据后发出通知 object 方法 wait(); notify(); 通知一个 notifyAll ...

  10. python小知识点汇总

    一 写mysql 场景:自动化用例中需要构造数据,写入redis 表中已有该primary_key的记录,在现有基础上更新字段 表中无该记录,需要插入 # 请求传入table字段,db.table,c ...