JointLimitTable.h
Go to the documentation of this file.
1 #ifndef __JOINT_LIMIT_TABLE_H__
2 #define __JOINT_LIMIT_TABLE_H__
3 #include <hrpModel/Body.h>
4 #include <hrpModel/Link.h>
5 #include <cmath>
6 #include <coil/stringutil.h>
7 
8 namespace hrp {
9  // JointLimitTable for one joint
10  // self_joint : a joint to obtain llimit and ulimit from this class.
11  // target_joint : self_joint's limit is difference for target_joint's joint angle.
13  private:
14  int target_jointId; // jointId for target_joint
15  int target_llimit_angle, target_ulimit_angle; // llimit and ulimit angle [deg] for target_joint
16  hrp::dvector llimit_table, ulimit_table; // Tables for self_joint's llimit and ulimit
17  double getInterpolatedLimitAngle (const double target_joint_angle, const bool is_llimit_angle) const;
18  public:
19  JointLimitTable (const int _target_jointId,
20  const int _target_llimit_angle, const int _target_ulimit_angle,
21  const hrp::dvector& _llimit_table, const hrp::dvector& _ulimit_table)
22  : target_jointId(_target_jointId), target_llimit_angle(_target_llimit_angle), target_ulimit_angle(_target_ulimit_angle), llimit_table(_llimit_table), ulimit_table(_ulimit_table) {};
24  int getTargetJointId () const { return target_jointId; };
25  double getLlimit (const double target_joint_angle) const // [rad]
26  {
27  return getInterpolatedLimitAngle(target_joint_angle, true); // [rad]
28  };
29  double getUlimit (const double target_joint_angle) const // [rad]
30  {
31  return getInterpolatedLimitAngle(target_joint_angle, false); // [rad]
32  };
33  };
34 
35  void readJointLimitTableFromProperties (std::map<std::string, hrp::JointLimitTable>& joint_mm_tables,
37  const std::string& prop_string,
38  const std::string& instance_name);
39 };
40 
41 #endif //__JOINT_LIMIT_TABLE_H__
double getUlimit(const double target_joint_angle) const
hrp::dvector llimit_table
hrp::dvector ulimit_table
Eigen::VectorXd dvector
void readJointLimitTableFromProperties(std::map< std::string, hrp::JointLimitTable > &joint_mm_tables, hrp::BodyPtr m_robot, const std::string &prop_string, const std::string &instance_name)
double getInterpolatedLimitAngle(const double target_joint_angle, const bool is_llimit_angle) const
int getTargetJointId() const
double getLlimit(const double target_joint_angle) const
JointLimitTable(const int _target_jointId, const int _target_llimit_angle, const int _target_ulimit_angle, const hrp::dvector &_llimit_table, const hrp::dvector &_ulimit_table)
hrp::BodyPtr m_robot


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50