Main Page
Namespaces
Classes
Files
File List
File Members
include
vigir_pattern_generator
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
37
#include <
actionlib/client/simple_action_client.h
>
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
48
#include <
vigir_pattern_generator/joystick_handler.h
>
49
50
51
52
namespace
vigir_footstep_planning
53
{
54
class
PatternGenerator
55
{
56
public
:
57
PatternGenerator
(
ros::NodeHandle
& nh);
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);
75
void
updateFirstChangeableStepIndex
(
int
first_changeable_step_index_
);
76
77
// simple pattern generator
78
msgs::ErrorStatus
generatePattern
(
const
msgs::StepPlanRequest& step_plan_request, msgs::StepPlan& step_plan);
79
80
// typedefs
81
typedef
boost::shared_ptr<PatternGenerator>
Ptr
;
82
typedef
boost::shared_ptr<PatternGenerator>
ConstPtr
;
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
92
JoystickHandler::Ptr
joystick_handler_
;
93
geometry_msgs::Twist
joystick_cmd_
;
94
95
// limits
96
double
min_vel_x_
,
max_vel_x_
;
97
double
max_vel_y_
;
98
double
max_vel_yaw_
;
99
100
// generator params
101
std::string
world_frame_id_
;
102
unsigned
int
number_of_steps_needed_
;
103
msgs::PatternGeneratorParameters
params_
;
104
105
// controller feedback
106
int
first_changeable_step_index_
;
107
int
next_step_index_needed_
;
108
109
// state of pattern generator
110
msgs::Feet::Ptr
start_feet_pose_
;
111
unsigned
int
foot_start_step_index_left_
;
112
unsigned
int
foot_start_step_index_right_
;
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
120
ros::ServiceClient
generate_feet_pose_client_
;
121
ros::ServiceClient
step_plan_request_client_
;
122
ros::ServiceClient
stitch_step_plan_client
;
123
124
// action clients
125
boost::shared_ptr<actionlib::SimpleActionClient<msgs::ExecuteStepPlanAction>
>
execute_step_plan_ac_
;
126
};
127
}
128
129
#endif
vigir_footstep_planning::PatternGenerator::has_new_steps_
bool has_new_steps_
Definition:
pattern_generator.h:113
vigir_footstep_planning::PatternGenerator::Ptr
boost::shared_ptr< PatternGenerator > Ptr
Definition:
pattern_generator.h:81
ros::NodeHandle
vigir_footstep_planning::PatternGenerator::update
void update(const ros::TimerEvent &timer)
Definition:
pattern_generator.cpp:140
vigir_footstep_planning::PatternGenerator::hasSteps
bool hasSteps() const
Definition:
pattern_generator.cpp:108
vigir_footstep_planning::PatternGenerator::updateFirstChangeableStepIndex
void updateFirstChangeableStepIndex(int first_changeable_step_index_)
Definition:
pattern_generator.cpp:164
vigir_footstep_planning::PatternGenerator::setParams
void setParams(const msgs::PatternGeneratorParameters ¶ms)
Definition:
pattern_generator.cpp:66
vigir_footstep_planning::PatternGenerator::foot_start_step_index_right_
unsigned int foot_start_step_index_right_
Definition:
pattern_generator.h:112
vigir_footstep_planning::PatternGenerator::PatternGenerator
PatternGenerator(ros::NodeHandle &nh)
Definition:
pattern_generator.cpp:5
vigir_footstep_planning::PatternGenerator::last_step_sequence_
msgs::StepPlan last_step_sequence_
Definition:
pattern_generator.h:117
vigir_footstep_planning::PatternGenerator::foot_start_step_index_left_
unsigned int foot_start_step_index_left_
Definition:
pattern_generator.h:111
vigir_footstep_planning::PatternGenerator::params_
msgs::PatternGeneratorParameters params_
Definition:
pattern_generator.h:103
vigir_footstep_planning::PatternGenerator::setEnabled
void setEnabled(bool enabled)
Definition:
pattern_generator.cpp:86
vigir_footstep_planning::PatternGenerator::isSimulationMode
bool isSimulationMode() const
Definition:
pattern_generator.cpp:103
vigir_footstep_planning::PatternGenerator::updateFeetStartPose
void updateFeetStartPose(const msgs::Foot &foot)
Definition:
pattern_generator.cpp:198
vigir_footstep_planning::PatternGenerator::getNextStartStepIndex
int getNextStartStepIndex() const
Definition:
pattern_generator.cpp:129
vigir_footstep_planning::PatternGenerator::clearStepPlan
void clearStepPlan()
Definition:
pattern_generator.cpp:134
vigir_footstep_planning::PatternGenerator::generateSteps
void generateSteps(unsigned int n)
Definition:
pattern_generator.cpp:241
boost::shared_ptr
vigir_footstep_planning::PatternGenerator::world_frame_id_
std::string world_frame_id_
Definition:
pattern_generator.h:101
vigir_footstep_planning::PatternGenerator::step_plan_request_client_
ros::ServiceClient step_plan_request_client_
Definition:
pattern_generator.h:121
vigir_footstep_planning::PatternGenerator
Definition:
pattern_generator.h:54
vigir_footstep_planning::PatternGenerator::joystick_handler_
JoystickHandler::Ptr joystick_handler_
Definition:
pattern_generator.h:92
vigir_footstep_planning::PatternGenerator::execute_step_plan_ac_
boost::shared_ptr< actionlib::SimpleActionClient< msgs::ExecuteStepPlanAction > > execute_step_plan_ac_
Definition:
pattern_generator.h:125
vigir_footstep_planning::PatternGenerator::reset
void reset()
Definition:
pattern_generator.cpp:49
vigir_footstep_planning
Definition:
joystick_handler.h:41
vigir_footstep_planning::PatternGenerator::getCompleteStepPlan
void getCompleteStepPlan(msgs::StepPlan &step_plan) const
Definition:
pattern_generator.cpp:118
vigir_footstep_planning::PatternGenerator::~PatternGenerator
virtual ~PatternGenerator()
Definition:
pattern_generator.cpp:29
vigir_footstep_planning::PatternGenerator::start_feet_pose_
msgs::Feet::Ptr start_feet_pose_
Definition:
pattern_generator.h:110
vigir_footstep_planning::PatternGenerator::max_vel_yaw_
double max_vel_yaw_
Definition:
pattern_generator.h:98
vigir_footstep_planning::PatternGenerator::ConstPtr
boost::shared_ptr< PatternGenerator > ConstPtr
Definition:
pattern_generator.h:82
vigir_footstep_planning::PatternGenerator::next_step_index_needed_
int next_step_index_needed_
Definition:
pattern_generator.h:107
vigir_footstep_planning::PatternGenerator::generatePattern
msgs::ErrorStatus generatePattern(const msgs::StepPlanRequest &step_plan_request, msgs::StepPlan &step_plan)
Definition:
pattern_generator.cpp:32
vigir_footstep_planning::PatternGenerator::number_of_steps_needed_
unsigned int number_of_steps_needed_
Definition:
pattern_generator.h:102
vigir_footstep_planning::PatternGenerator::stitch_step_plan_client
ros::ServiceClient stitch_step_plan_client
Definition:
pattern_generator.h:122
ros.h
joystick_handler.h
vigir_footstep_planning::PatternGenerator::min_vel_x_
double min_vel_x_
Definition:
pattern_generator.h:96
vigir_footstep_planning::PatternGenerator::max_vel_x_
double max_vel_x_
Definition:
pattern_generator.h:96
ros::ServiceClient
vigir_footstep_planning::PatternGenerator::getLastStepSequence
void getLastStepSequence(msgs::StepPlan &step_plan) const
Definition:
pattern_generator.cpp:123
vigir_footstep_planning::PatternGenerator::hasNewSteps
bool hasNewSteps() const
Definition:
pattern_generator.cpp:113
vigir_footstep_planning::PatternGenerator::max_vel_y_
double max_vel_y_
Definition:
pattern_generator.h:97
ros::TimerEvent
vigir_footstep_planning::PatternGenerator::generate_feet_pose_client_
ros::ServiceClient generate_feet_pose_client_
Definition:
pattern_generator.h:120
simple_action_client.h
vigir_footstep_planning::PatternGenerator::step_plan_
StepPlan step_plan_
Definition:
pattern_generator.h:116
vigir_footstep_planning::PatternGenerator::joystick_cmd_
geometry_msgs::Twist joystick_cmd_
Definition:
pattern_generator.h:93
vigir_footstep_planning::PatternGenerator::isEnabled
bool isEnabled() const
Definition:
pattern_generator.cpp:98
vigir_footstep_planning::PatternGenerator::first_changeable_step_index_
int first_changeable_step_index_
Definition:
pattern_generator.h:106
vigir_pattern_generator
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:30:06