Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef FOOTSTEP_PLANNER_STATE_H__
00031 #define FOOTSTEP_PLANNER_STATE_H__
00032
00033 #include <geometry_msgs/Pose.h>
00034 #include <geometry_msgs/Vector3.h>
00035
00036 #include <vigir_footstep_planning_msgs/footstep_planning_msgs.h>
00037
00038 #include <vigir_footstep_planning_lib/math.h>
00039
00040
00041
00042 namespace vigir_footstep_planning
00043 {
00049 class State
00050 {
00051 public:
00052 State();
00053 State(double x, double y, double z, double roll, double pitch, double yaw, Leg leg);
00054 State(const geometry_msgs::Vector3& position, double roll, double pitch, double yaw, Leg leg);
00055 State(const geometry_msgs::Vector3& position, const geometry_msgs::Vector3& normal, double yaw, Leg leg);
00056 State(const geometry_msgs::Pose& pose, Leg leg);
00057 State(const tf::Transform& t, Leg leg);
00058 State(const msgs::Foot foot);
00059 State(const msgs::Step step);
00060
00061 ~State();
00062
00067 bool operator==(const State& s2) const;
00068
00073 bool operator!=(const State& s2) const;
00074
00075 void setX(double x) { ivPose.getOrigin().setX(x); }
00076 void setY(double y) { ivPose.getOrigin().setY(y); }
00077 void setZ(double z) { ivPose.getOrigin().setZ(z); }
00078 void setPosition(const geometry_msgs::Point& position);
00079 void setRoll(double roll) { setRPY(roll, ivPitch, ivYaw); }
00080 void setPitch(double pitch) { setRPY(ivRoll, pitch, ivYaw); }
00081 void setYaw(double yaw) { setRPY(ivRoll, ivPitch, yaw); }
00082 void setRPY(double roll, double pitch, double yaw);
00083 void setOrientation(const geometry_msgs::Quaternion& q);
00084 void setNormal(const geometry_msgs::Vector3 &normal);
00085 void setNormal(double x, double y, double z);
00086 void setSwingHeight(double swing_height) { ivSwingHeight = swing_height; }
00087 void setSwayDuration(double sway_duration) { ivSwayDuration = sway_duration; }
00088 void setStepDuration(double step_duration) { ivStepDuration = step_duration; }
00089 void setSwayDistance(double sway_distance) { this->sway_distance = sway_distance; }
00090 void setSwingDistance(double swing_distance) { this->swing_distance = swing_distance; }
00091 void setLeg(Leg leg) { ivLeg = leg; }
00092 void setGroundContactSupport(double ground_contact_support) { ivGroundContactSupport = ground_contact_support; }
00093 void setBodyVelocity(const geometry_msgs::Vector3& body_vel) { this->body_vel = body_vel; }
00094 void setCost(double cost) { this->cost = cost; }
00095 void setRisk(double risk) { this->risk = risk; }
00096
00097 double getX() const { return ivPose.getOrigin().getX(); }
00098 double getY() const { return ivPose.getOrigin().getY(); }
00099 double getZ() const { return ivPose.getOrigin().getZ(); }
00100 double getRoll() const { return ivRoll; }
00101 double getPitch() const { return ivPitch; }
00102 double getYaw() const { return ivYaw; }
00103 const geometry_msgs::Vector3& getNormal() const { return ivNormal; }
00104 double getNormalX() const { return ivNormal.x; }
00105 double getNormalY() const { return ivNormal.y; }
00106 double getNormalZ() const { return ivNormal.z; }
00107 double getSwingHeight() const { return ivSwingHeight; }
00108 double getSwayDuration() const { return ivSwayDuration; }
00109 double getStepDuration() const { return ivStepDuration; }
00110 double getSwayDistance() const { return sway_distance; }
00111 double getSwingDistance() const { return swing_distance; }
00112 Leg getLeg() const { return ivLeg; }
00113 double getGroundContactSupport() const { return ivGroundContactSupport; }
00114 const geometry_msgs::Vector3& getBodyVelocity() const { return body_vel; }
00115 double getCost() const { return cost; }
00116 double getRisk() const { return risk; }
00117
00118 const tf::Pose &getPose() const { return ivPose; }
00119 tf::Pose &getPose() { return ivPose; }
00120 void getFoot(msgs::Foot& foot) const;
00121 void getStep(msgs::Step& step) const;
00122
00123 private:
00124 void recomputeNormal();
00125
00126 tf::Pose ivPose;
00127
00129 Leg ivLeg;
00130
00132 double ivRoll;
00133 double ivPitch;
00134 double ivYaw;
00136 geometry_msgs::Vector3 ivNormal;
00137 double ivSwingHeight;
00138 double ivSwayDuration;
00139 double ivStepDuration;
00140
00142 double ivGroundContactSupport;
00143
00144 geometry_msgs::Vector3 body_vel;
00145
00146 double sway_distance;
00147 double swing_distance;
00148
00149 double cost;
00150 double risk;
00151 };
00152 }
00153 #endif