pattern_generator.h
Go to the documentation of this file.
1 //=================================================================================================
2 // Copyright (c) 2018, Alexander Stumpf, TU Darmstadt
3 // All rights reserved.
4 
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 // * Neither the name of the Simulation, Systems Optimization and Robotics
13 // group, TU Darmstadt nor the names of its contributors may be used to
14 // endorse or promote products derived from this software without
15 // specific prior written permission.
16 
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //=================================================================================================
28 
29 #ifndef VIGIR_PATTERN_GENERATOR_H__
30 #define VIGIR_PATTERN_GENERATOR_H__
31 
32 #include <map>
33 
34 #include <ros/ros.h>
35 #include <tf/tf.h>
36 
38 
39 #include <geometry_msgs/Pose.h>
40 #include <geometry_msgs/PoseStamped.h>
41 #include <geometry_msgs/PoseWithCovarianceStamped.h>
42 #include <geometry_msgs/Twist.h>
43 
44 #include <vigir_footstep_planning_lib/helper.h>
45 #include <vigir_footstep_planning_msgs/footstep_planning_msgs.h>
46 #include <vigir_footstep_planning_msgs/step_plan.h>
47 
49 
50 
51 
53 {
55 {
56 public:
58  virtual ~PatternGenerator();
59 
60  void reset();
61  void setParams(const msgs::PatternGeneratorParameters& params);
62  void setEnabled(bool enabled);
63  bool isEnabled() const;
64  bool isSimulationMode() const;
65 
66  bool hasSteps() const;
67  bool hasNewSteps() const;
68  void getCompleteStepPlan(msgs::StepPlan& step_plan) const;
69  void getLastStepSequence(msgs::StepPlan& step_plan) const;
70  void clearStepPlan();
71 
72  int getNextStartStepIndex() const;
73 
74  void update(const ros::TimerEvent& timer);
76 
77  // simple pattern generator
78  msgs::ErrorStatus generatePattern(const msgs::StepPlanRequest& step_plan_request, msgs::StepPlan& step_plan);
79 
80  // typedefs
83 
84 private:
85  void updateFeetStartPose(const msgs::Foot& foot);
86  void updateFeetStartPose(const msgs::Feet& feet);
87  void updateFeetStartPose(const msgs::Step& step);
88 
89  void generateSteps(unsigned int n);
90 
91  // handler for joystick input
93  geometry_msgs::Twist joystick_cmd_;
94 
95  // limits
97  double max_vel_y_;
98  double max_vel_yaw_;
99 
100  // generator params
101  std::string world_frame_id_;
103  msgs::PatternGeneratorParameters params_;
104 
105  // controller feedback
108 
109  // state of pattern generator
110  msgs::Feet::Ptr start_feet_pose_;
113  mutable bool has_new_steps_;
114 
115  // generated step plan
116  StepPlan step_plan_;
117  msgs::StepPlan last_step_sequence_;
118 
119  // service clients
123 
124  // action clients
126 };
127 }
128 
129 #endif
boost::shared_ptr< PatternGenerator > Ptr
void update(const ros::TimerEvent &timer)
void updateFirstChangeableStepIndex(int first_changeable_step_index_)
void setParams(const msgs::PatternGeneratorParameters &params)
msgs::PatternGeneratorParameters params_
void updateFeetStartPose(const msgs::Foot &foot)
boost::shared_ptr< actionlib::SimpleActionClient< msgs::ExecuteStepPlanAction > > execute_step_plan_ac_
void getCompleteStepPlan(msgs::StepPlan &step_plan) const
boost::shared_ptr< PatternGenerator > ConstPtr
msgs::ErrorStatus generatePattern(const msgs::StepPlanRequest &step_plan_request, msgs::StepPlan &step_plan)
void getLastStepSequence(msgs::StepPlan &step_plan) const


vigir_pattern_generator
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:30:06