Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
rtc
SoftErrorLimiter
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
9
robot::robot
() {
10
}
11
robot::~robot
() {
12
}
13
bool
robot::init
() {
14
m_servoErrorLimit
.resize(
numJoints
());
15
for
(
unsigned
int
i
=0;
i
<
numJoints
();
i
++){
16
m_servoErrorLimit
[
i
] =
DEFAULT_ANGLE_ERROR_LIMIT
;
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
}
sample.l
l
Definition:
rtc/OccupancyGridMap3D/sample/sample.py:15
robot.h
i
png_uint_32 i
robot::~robot
~robot()
destructor
Definition:
RobotHardware/robot.cpp:28
hrp::Link
robot::robot
robot()
constructor
Definition:
SoftErrorLimiter/robot.cpp:9
hrp::Body::link
Link * link(int index) const
DEFAULT_ANGLE_ERROR_LIMIT
#define DEFAULT_ANGLE_ERROR_LIMIT
Definition:
SoftErrorLimiter/robot.cpp:5
robot::m_servoErrorLimit
std::vector< double > m_servoErrorLimit
Definition:
RobotHardware/robot.h:327
hrp::Link::jointId
int jointId
hrp::Body::numJoints
unsigned int numJoints() const
robot::setServoErrorLimit
bool setServoErrorLimit(const char *i_jname, double i_limit)
set servo error limit value for specific joint or joint group
Definition:
RobotHardware/robot.cpp:834
robot::init
bool init()
Definition:
RobotHardware/robot.cpp:33
hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51