eband_local_planner_ros.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2010, 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: Christian Connette
36  *********************************************************************/
37 
38 #ifndef EBAND_LOCAL_PLANNER_ROS_H_
39 #define EBAND_LOCAL_PLANNER_ROS_H_
40 
41 #include <ros/ros.h>
42 
43 // abstract class from which our plugin inherits
45 
46 // dynamic reconfigure
47 #include <dynamic_reconfigure/server.h>
48 
49 // classes wich are parts of this pkg
54 #include <eband_local_planner/EBandPlannerConfig.h>
55 
56 // local planner specific classes which provide some macros
58 
59 // msgs
60 #include <nav_msgs/Path.h>
61 #include <nav_msgs/Odometry.h>
62 #include <geometry_msgs/PoseStamped.h>
63 #include <visualization_msgs/MarkerArray.h>
64 #include <visualization_msgs/Marker.h>
65 
66 // transforms
67 #include <angles/angles.h>
68 #include <tf/tf.h>
69 #include <tf/transform_listener.h>
70 
71 // costmap & geometry
73 
74 // boost classes
75 #include <boost/bind.hpp>
76 #include <boost/shared_ptr.hpp>
77 
78 
79 namespace eband_local_planner{
80 
86 
87  public:
92 
99  EBandPlannerROS(std::string name, tf::TransformListener* tf,
100  costmap_2d::Costmap2DROS* costmap_ros);
101 
106 
113  void initialize(std::string name, tf::TransformListener* tf,
114  costmap_2d::Costmap2DROS* costmap_ros);
115 
121  bool setPlan(const std::vector<geometry_msgs::PoseStamped>& orig_global_plan);
122 
128  bool computeVelocityCommands(geometry_msgs::Twist& cmd_vel);
129 
134  bool isGoalReached();
135 
136  private:
137 
143  void reconfigureCallback(EBandPlannerConfig& config, uint32_t level);
144 
145  typedef dynamic_reconfigure::Server<
146  eband_local_planner::EBandPlannerConfig> drs;
149 
150  // pointer to external objects (do NOT delete object)
153 
154  // parameters
157 
158  // Topics & Services
162 
163  // data
164  nav_msgs::Odometry base_odom_;
165  std::vector<geometry_msgs::PoseStamped> global_plan_; // plan as handed over from move_base or global planner
166  std::vector<geometry_msgs::PoseStamped> transformed_plan_; // plan transformed into the map frame we are working in
167  std::vector<int> plan_start_end_counter_; // stores which number start and end frame of the transformed plan have inside the global plan
168 
169  // pointer to locally created objects (delete - except for smart-ptrs:)
173 
175 
176  // flags
178  boost::mutex odom_mutex_; // mutex to lock odometry-callback while data is read from topic
179 
180 
181  // methods
182 
187  void odomCallback(const nav_msgs::Odometry::ConstPtr& msg);
188 
189  };
190 };
191 #endif
192 
193 
boost::shared_ptr< EBandPlanner > eband_
bool isGoalReached()
Check if the goal pose has been achieved.
boost::shared_ptr< EBandTrajectoryCtrl > eband_trj_ctrl_
tf::TransformListener * tf_
pointer to Transform Listener
EBandPlannerROS()
Default constructor for the ros wrapper.
bool setPlan(const std::vector< geometry_msgs::PoseStamped > &orig_global_plan)
Set the plan that the controller is following; also reset eband-planner.
double trans_stopped_vel_
lower bound for absolute value of velocity (with respect to stick-slip behaviour) ...
double xy_goal_tolerance_
parameters to define region in which goal is treated as reached
Plugin to the ros base_local_planner. Implements a wrapper for the Elastic Band Method.
dynamic_reconfigure::Server< eband_local_planner::EBandPlannerConfig > drs
std::vector< geometry_msgs::PoseStamped > transformed_plan_
bool computeVelocityCommands(geometry_msgs::Twist &cmd_vel)
Given the current position, orientation, and velocity of the robot, compute velocity commands to send...
boost::shared_ptr< EBandVisualization > eband_visual_
ros::Publisher g_plan_pub_
publishes modified global plan
void odomCallback(const nav_msgs::Odometry::ConstPtr &msg)
Odometry-Callback: function is called whenever a new odometry msg is published on that topic...
~EBandPlannerROS()
Destructor for the wrapper.
std::vector< geometry_msgs::PoseStamped > global_plan_
void initialize(std::string name, tf::TransformListener *tf, costmap_2d::Costmap2DROS *costmap_ros)
Initializes the ros wrapper.
void reconfigureCallback(EBandPlannerConfig &config, uint32_t level)
Reconfigures node parameters.
ros::Publisher l_plan_pub_
publishes prediction for local commands
costmap_2d::Costmap2DROS * costmap_ros_
pointer to costmap
ros::Subscriber odom_sub_
subscribes to the odometry topic in global namespace
boost::shared_ptr< drs > drs_
dynamic reconfigure server ptr


eband_local_planner
Author(s): Christian Connette, Bhaskara Marthi, Piyush Khandelwal
autogenerated on Sat Feb 22 2020 04:03:28