goal_functions.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * Software License Agreement (BSD License)
4 *
5 * Copyright (c) 2009, Willow Garage, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of Willow Garage, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 * Author: Eitan Marder-Eppstein
36 *********************************************************************/
37 #ifndef BASE_LOCAL_PLANNER_GOAL_FUNCTIONS_H_
38 #define BASE_LOCAL_PLANNER_GOAL_FUNCTIONS_H_
39 
40 #include <ros/ros.h>
41 #include <nav_msgs/Odometry.h>
42 #include <nav_msgs/Path.h>
43 #include <geometry_msgs/PoseStamped.h>
44 #include <geometry_msgs/Twist.h>
45 #include <geometry_msgs/Point.h>
46 #include <tf2_ros/buffer.h>
47 
48 #include <string>
49 #include <cmath>
50 
51 #include <angles/angles.h>
52 #include <costmap_2d/costmap_2d.h>
53 
54 namespace base_local_planner {
55 
63  double getGoalPositionDistance(const geometry_msgs::PoseStamped& global_pose, double goal_x, double goal_y);
64 
72  double getGoalOrientationAngleDifference(const geometry_msgs::PoseStamped& global_pose, double goal_th);
73 
80  void publishPlan(const std::vector<geometry_msgs::PoseStamped>& path, const ros::Publisher& pub);
81 
88  void prunePlan(const geometry_msgs::PoseStamped& global_pose, std::vector<geometry_msgs::PoseStamped>& plan, std::vector<geometry_msgs::PoseStamped>& global_plan);
89 
101  const std::vector<geometry_msgs::PoseStamped>& global_plan,
102  const geometry_msgs::PoseStamped& global_robot_pose,
103  const costmap_2d::Costmap2D& costmap,
104  const std::string& global_frame,
105  std::vector<geometry_msgs::PoseStamped>& transformed_plan);
106 
115  bool getGoalPose(const tf2_ros::Buffer& tf,
116  const std::vector<geometry_msgs::PoseStamped>& global_plan,
117  const std::string& global_frame,
118  geometry_msgs::PoseStamped &goal_pose);
119 
133  bool isGoalReached(const tf2_ros::Buffer& tf,
134  const std::vector<geometry_msgs::PoseStamped>& global_plan,
135  const costmap_2d::Costmap2D& costmap,
136  const std::string& global_frame,
137  geometry_msgs::PoseStamped& global_pose,
138  const nav_msgs::Odometry& base_odom,
139  double rot_stopped_vel, double trans_stopped_vel,
140  double xy_goal_tolerance, double yaw_goal_tolerance);
141 
149  bool stopped(const nav_msgs::Odometry& base_odom,
150  const double& rot_stopped_velocity,
151  const double& trans_stopped_velocity);
152 };
153 #endif
base_local_planner::isGoalReached
bool isGoalReached(const tf2_ros::Buffer &tf, const std::vector< geometry_msgs::PoseStamped > &global_plan, const costmap_2d::Costmap2D &costmap, const std::string &global_frame, geometry_msgs::PoseStamped &global_pose, const nav_msgs::Odometry &base_odom, double rot_stopped_vel, double trans_stopped_vel, double xy_goal_tolerance, double yaw_goal_tolerance)
Check if the goal pose has been achieved.
ros::Publisher
ros.h
base_local_planner::getGoalPose
bool getGoalPose(const tf2_ros::Buffer &tf, const std::vector< geometry_msgs::PoseStamped > &global_plan, const std::string &global_frame, geometry_msgs::PoseStamped &goal_pose)
Returns last pose in plan.
Definition: goal_functions.cpp:174
costmap_2d.h
buffer.h
base_local_planner::transformGlobalPlan
bool transformGlobalPlan(const tf2_ros::Buffer &tf, const std::vector< geometry_msgs::PoseStamped > &global_plan, const geometry_msgs::PoseStamped &global_robot_pose, const costmap_2d::Costmap2D &costmap, const std::string &global_frame, std::vector< geometry_msgs::PoseStamped > &transformed_plan)
Transforms the global plan of the robot from the planner frame to the frame of the costmap,...
Definition: goal_functions.cpp:96
costmap_2d::Costmap2D
base_local_planner::getGoalPositionDistance
double getGoalPositionDistance(const geometry_msgs::PoseStamped &global_pose, double goal_x, double goal_y)
return squared distance to check if the goal position has been achieved
Definition: goal_functions.cpp:49
base_local_planner::getGoalOrientationAngleDifference
double getGoalOrientationAngleDifference(const geometry_msgs::PoseStamped &global_pose, double goal_th)
return angle difference to goal to check if the goal orientation has been achieved
Definition: goal_functions.cpp:53
tf2_ros::Buffer
base_local_planner::prunePlan
void prunePlan(const geometry_msgs::PoseStamped &global_pose, std::vector< geometry_msgs::PoseStamped > &plan, std::vector< geometry_msgs::PoseStamped > &global_plan)
Trim off parts of the global plan that are far enough behind the robot.
Definition: goal_functions.cpp:77
tf
base_local_planner
Definition: costmap_model.h:44
base_local_planner::publishPlan
void publishPlan(const std::vector< geometry_msgs::PoseStamped > &path, const ros::Publisher &pub)
Publish a plan for visualization purposes.
Definition: goal_functions.cpp:58
angles.h
base_local_planner::stopped
bool stopped(const nav_msgs::Odometry &base_odom, const double &rot_stopped_velocity, const double &trans_stopped_velocity)
Check whether the robot is stopped or not.
Definition: goal_functions.cpp:239


base_local_planner
Author(s): Eitan Marder-Eppstein, Eric Perko, contradict@gmail.com
autogenerated on Mon Mar 6 2023 03:50:24