SoftErrorLimiter/robot.cpp
Go to the documentation of this file.
1 #include "robot.h"
2 #include "hrpsys/util/Hrpsys.h"
3 #include <iostream>
4 
5 #define DEFAULT_ANGLE_ERROR_LIMIT (0.2 - 0.02) // [rad]
6 
7 
8 // robot model copy from RobotHardware
10 }
11 robot::~robot() {
12 }
13 bool robot::init() {
14  m_servoErrorLimit.resize(numJoints());
15  for (unsigned int i=0; i<numJoints(); i++){
17  }
18  return true;
19 }
20 
21 bool robot::setServoErrorLimit(const char *i_jname, double i_limit) {
22  hrp::Link *l = NULL;
23  if (strcmp(i_jname, "all") == 0 || strcmp(i_jname, "ALL") == 0){
24  for (unsigned int i=0; i<numJoints(); i++){
25  m_servoErrorLimit[i] = i_limit;
26  }
27  std::cerr << "[el] setServoErrorLimit " << i_limit << "[rad] for all joints" << std::endl;
28  }else if ((l = link(i_jname))){
29  m_servoErrorLimit[l->jointId] = i_limit;
30  std::cerr << "[el] setServoErrorLimit " << i_limit << "[rad] for " << i_jname << std::endl;
31  }else{
32  std::cerr << "[el] Invalid joint name of setServoErrorLimit " << i_jname << "!" << std::endl;
33  return false;
34  }
35  return true;
36 }
png_uint_32 i
~robot()
destructor
robot()
constructor
Link * link(int index) const
#define DEFAULT_ANGLE_ERROR_LIMIT
std::vector< double > m_servoErrorLimit
unsigned int numJoints() const
bool setServoErrorLimit(const char *i_jname, double i_limit)
set servo error limit value for specific joint or joint group


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