NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ruleapplier.h
1 // Class to apply rule parts to keyframe
2 // Author: Dmytro Pavlichenko <dm.mark999@gmail.com>
3 
4 #ifndef RULEAPPLIER_H
5 #define RULEAPPLIER_H
6 
7 #include <boost/shared_ptr.hpp>
8 #include <gait/util/gait_inverse_pose.h>
9 #include <gait/util/gait_abstract_pose.h>
10 #include <Eigen/Geometry>
11 #include <vector>
12 
13 namespace motionfile
14 {
15 
16 class Keyframe;
17 class RulePart;
18 
19 typedef boost::shared_ptr<motionfile::Keyframe> KeyframePtr;
20 
21 class RuleApplier
22 {
23 public:
24  RuleApplier();
25  ~RuleApplier();
26 
27  bool applyRulePart(motionfile::KeyframePtr frame, const std::vector<std::string> &joint_list
28  , const motionfile::RulePart &part, double delta, bool apply, bool limit_inverse, double epsilon);
29 
30 private:
31  bool applyJoint(motionfile::KeyframePtr frame, const std::vector<std::string> &joint_list
32  , const motionfile::RulePart &part, double delta, bool apply);
33 
34  bool applyAbstract(motionfile::KeyframePtr frame, const std::vector<std::string> &joint_list
35  , const motionfile::RulePart &part, double delta, bool apply);
36 
37  bool applyInverse(motionfile::KeyframePtr frame, const std::vector<std::string> &joint_list
38  , const motionfile::RulePart &part, double delta, bool apply, bool limit_inverse, double epsilon);
39 
40  double getPos(const gait::AbstractPose& abstract_pose, const std::string& joint_name);
41  void setPos(gait::AbstractPose& abstract_pose, const std::string& joint_name, const double value);
42 
43  double getPos(const gait::InversePose& inverse_pose, const std::string& joint_name);
44  void setPos(gait::InversePose& inverse_pose, const std::string& joint_name, const double value);
45 
46  bool inAbstractLimits(const std::string& joint_name, const double value);
47  bool inInverseLimits(const std::string& joint_name, const double value);
48 
49 private:
50  gait::InversePose m_inverse_pose;
51  gait::InversePose m_temp_inverse_pose;
52 };
53 
54 }
55 
56 #endif
Data struct that encompasses the inverse representation of a robot pose.
Definition: gait_inverse_pose.h:188
Data struct that encompasses the abstract representation of a robot pose.
Definition: gait_abstract_pose.h:214