FootstepNavigation.h
Go to the documentation of this file.
1 /*
2  * A footstep planner for humanoid robots
3  *
4  * Copyright 2010-2011 Johannes Garimort, Armin Hornung, University of Freiburg
5  * http://www.ros.org/wiki/footstep_planner
6  *
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, version 3.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef FOOTSTEP_PLANNER_FOOTSTEPNAVIGATION_H_
22 #define FOOTSTEP_PLANNER_FOOTSTEPNAVIGATION_H_
23 
26 #include <footstep_planner/State.h>
27 #include <geometry_msgs/Pose.h>
28 #include <geometry_msgs/PoseStamped.h>
29 #include <geometry_msgs/PoseWithCovarianceStamped.h>
30 #include <humanoid_nav_msgs/ClipFootstep.h>
31 #include <humanoid_nav_msgs/ExecFootstepsAction.h>
32 #include <humanoid_nav_msgs/ExecFootstepsFeedback.h>
33 #include <humanoid_nav_msgs/PlanFootsteps.h>
34 #include <humanoid_nav_msgs/StepTargetService.h>
35 #include <nav_msgs/Path.h>
36 #include <nav_msgs/OccupancyGrid.h>
37 #include <ros/ros.h>
38 #include <tf/tf.h>
39 #include <tf/transform_listener.h>
40 
41 #include <assert.h>
42 
43 
44 namespace footstep_planner
45 {
51 {
52 public:
54  virtual ~FootstepNavigation();
55 
57  bool setGoal(const geometry_msgs::PoseStampedConstPtr goal_pose);
58 
60  bool setGoal(float x, float y, float theta);
61 
67  void goalPoseCallback(
68  const geometry_msgs::PoseStampedConstPtr& goal_pose);
69 
75  void mapCallback(const nav_msgs::OccupancyGridConstPtr& occupancy_map);
76 
77 protected:
84  bool plan();
85 
94  bool replan();
95 
97  void startExecution();
98 
104  bool getFootTransform(const std::string& foot_id,
105  const std::string& world_frame_id,
106  const ros::Time& time,
107  const ros::Duration& waiting_time,
108  tf::Transform* foot);
109 
116  bool getFootstep(const tf::Pose& from, const State& from_planned,
117  const State& to, humanoid_nav_msgs::StepTarget* footstep);
118 
133  const State& current_support_leg, int starting_step_num,
134  std::vector<humanoid_nav_msgs::StepTarget>& footsteps);
135 
137  bool updateStart();
138 
140  void executeFootsteps();
141 
146  void executeFootstepsFast();
147 
152  void activeCallback();
153 
158  void doneCallback(
160  const humanoid_nav_msgs::ExecFootstepsResultConstPtr& result);
161 
166  void feedbackCallback(
167  const humanoid_nav_msgs::ExecFootstepsFeedbackConstPtr& fb);
168 
169  bool performable(const humanoid_nav_msgs::StepTarget& footstep);
170  bool performable(float step_x, float step_y);
171 
180  bool performanceValid(const humanoid_nav_msgs::ClipFootstep& footstep);
181 
183  bool performanceValid(const State& planned, const State& executed);
184 
186  bool performanceValid(float a_x, float a_y, float a_theta,
187  float b_x, float b_y, float b_theta);
188 
190 
194 
197 
199 
200  boost::mutex ivExecutionLock;
201 
203 
204  std::string ivIdFootRight;
205  std::string ivIdFootLeft;
206  std::string ivIdMapFrame;
207 
208  double ivAccuracyX;
209  double ivAccuracyY;
211  double ivCellSize;
213 
216 
219 
222 
225  humanoid_nav_msgs::ExecFootstepsAction> ivFootstepsExecution;
226 
228  const int ivExecutionShift;
229 
235 
241 
244 
245  double ivMaxStepX;
246  double ivMaxStepY;
251 
252  std::vector<std::pair<double, double> > ivStepRange;
253 };
254 }
255 #endif // FOOTSTEP_PLANNER_FOOTSTEPNAVIGATION_H_
void executeFootstepsFast()
Alternative (and more fluid) execution of footsteps using ROS&#39; actionlib.
bool replan()
Starts the planning task. First FootstepPlanner::replan() is called to use planning information from ...
bool setGoal(const geometry_msgs::PoseStampedConstPtr goal_pose)
Wrapper for FootstepPlanner::setGoal.
bool getFootstepsFromPath(const State &current_support_leg, int starting_step_num, std::vector< humanoid_nav_msgs::StepTarget > &footsteps)
Extracts the footsteps necessary to perform the calculated path.
void activeCallback()
Called from within ROS&#39; actionlib at the start of a new goal request.
A class to control the performance of a planned footstep path on the NAO robot.
A class to control the interaction between ROS and the footstep planner.
const int ivExecutionShift
Fixed delay (=2) of the incoming footsteps.
actionlib::SimpleActionClient< humanoid_nav_msgs::ExecFootstepsAction > ivFootstepsExecution
Simple action client to control a footstep execution.
bool updateStart()
Updates the robot&#39;s current pose.
A class representing the robot&#39;s pose (i.e. position and orientation) in the (continuous) world view...
Definition: State.h:34
bool getFootstep(const tf::Pose &from, const State &from_planned, const State &to, humanoid_nav_msgs::StepTarget *footstep)
Calculates the footstep necessary to reach &#39;to&#39; from within &#39;from&#39;.
bool performable(const humanoid_nav_msgs::StepTarget &footstep)
void goalPoseCallback(const geometry_msgs::PoseStampedConstPtr &goal_pose)
Callback to set a simulated robot at a certain pose.
bool performanceValid(const humanoid_nav_msgs::ClipFootstep &footstep)
std::vector< std::pair< double, double > > ivStepRange
bool ivExecutingFootsteps
Used to lock the calculation and execution of footsteps.
void doneCallback(const actionlib::SimpleClientGoalState &state, const humanoid_nav_msgs::ExecFootstepsResultConstPtr &result)
Called from within ROS&#39; actionlib at the end of a goal request.
double ivFeedbackFrequency
The rate the action server sends its feedback.
void startExecution()
Starts the execution of the calculated path.
bool plan()
Starts the planning task from scratch discarding previous planning information.
bool getFootTransform(const std::string &foot_id, const std::string &world_frame_id, const ros::Time &time, const ros::Duration &waiting_time, tf::Transform *foot)
Obtains the pose of the robot&#39;s foot from tf.
void mapCallback(const nav_msgs::OccupancyGridConstPtr &occupancy_map)
Callback to set the map.
void feedbackCallback(const humanoid_nav_msgs::ExecFootstepsFeedbackConstPtr &fb)
Called from within ROS&#39; actionlib during the execution of a goal request.
void executeFootsteps()
Executes footsteps as boost::thread.
boost::shared_ptr< boost::thread > ivFootstepExecutionPtr
bool ivSafeExecution
Whether to use the slower but more cautious execution or not.


footstep_planner
Author(s): Johannes Garimort, Armin Hornung
autogenerated on Mon Jun 10 2019 13:38:24