Go to the documentation of this file.00001 #ifndef __JOINT_LIMIT_TABLE_H__
00002 #define __JOINT_LIMIT_TABLE_H__
00003 #include <hrpModel/Body.h>
00004 #include <hrpModel/Link.h>
00005 #include <cmath>
00006 #include <coil/stringutil.h>
00007
00008 namespace hrp {
00009
00010
00011
00012 class JointLimitTable {
00013 private:
00014 int target_jointId;
00015 int target_llimit_angle, target_ulimit_angle;
00016 hrp::dvector llimit_table, ulimit_table;
00017 double getInterpolatedLimitAngle (const double target_joint_angle, const bool is_llimit_angle) const;
00018 public:
00019 JointLimitTable (const int _target_jointId,
00020 const int _target_llimit_angle, const int _target_ulimit_angle,
00021 const hrp::dvector& _llimit_table, const hrp::dvector& _ulimit_table)
00022 : target_jointId(_target_jointId), target_llimit_angle(_target_llimit_angle), target_ulimit_angle(_target_ulimit_angle), llimit_table(_llimit_table), ulimit_table(_ulimit_table) {};
00023 ~JointLimitTable() {};
00024 int getTargetJointId () const { return target_jointId; };
00025 double getLlimit (const double target_joint_angle) const
00026 {
00027 return getInterpolatedLimitAngle(target_joint_angle, true);
00028 };
00029 double getUlimit (const double target_joint_angle) const
00030 {
00031 return getInterpolatedLimitAngle(target_joint_angle, false);
00032 };
00033 };
00034
00035 void readJointLimitTableFromProperties (std::map<std::string, hrp::JointLimitTable>& joint_mm_tables,
00036 hrp::BodyPtr m_robot,
00037 const std::string& prop_string,
00038 const std::string& instance_name);
00039 };
00040
00041 #endif //__JOINT_LIMIT_TABLE_H__