JointLimitTable.h
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     // JointLimitTable for one joint
00010     //   self_joint   : a joint to obtain llimit and ulimit from this class.
00011     //   target_joint : self_joint's limit is difference for target_joint's joint angle.
00012     class JointLimitTable {
00013     private:
00014         int target_jointId; // jointId for target_joint
00015         int target_llimit_angle, target_ulimit_angle; // llimit and ulimit angle [deg] for target_joint
00016         hrp::dvector llimit_table, ulimit_table; // Tables for self_joint's llimit and ulimit
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 // [rad]
00026         {
00027             return getInterpolatedLimitAngle(target_joint_angle, true); // [rad]
00028         };
00029         double getUlimit (const double target_joint_angle) const // [rad]
00030         {
00031             return getInterpolatedLimitAngle(target_joint_angle, false); // [rad]
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__


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Wed May 15 2019 05:02:18