Go to the documentation of this file.
25 #define TIMESTEP 0.002
30 #define LARM_SHOULDER_P 19
31 #define LARM_SHOULDER_R 20
32 #define LARM_SHOULDER_Y 21
34 #define LARM_WRIST_Y 23
35 #define LARM_WRIST_P 24
36 #define LARM_WRIST_R 25
37 #define RARM_SHOULDER_P 6
38 #define RARM_SHOULDER_R 7
39 #define RARM_SHOULDER_Y 8
41 #define RARM_WRIST_Y 10
42 #define RARM_WRIST_P 11
43 #define RARM_WRIST_R 12
48 #define LLEG_ANKLE_P 17
49 #define LLEG_ANKLE_R 18
54 #define RLEG_ANKLE_P 4
55 #define RLEG_ANKLE_R 5
57 #define ANGLE_FILE "etc/angle.dat"
58 #define VEL_FILE "etc/vel.dat"
59 #define ACC_FILE "etc/acc.dat"
61 #define GAIN_FILE "etc/PDgain.dat"
64 const bool CONTROLLER_BRIDGE_DEBUG =
false;
72 "implementation_id",
"SamplePD_HG",
73 "type_name",
"SamplePD_HG",
74 "description",
"Sample PD component",
77 "category",
"Generic",
78 "activity_type",
"DataFlowComponent",
81 "lang_type",
"compile",
89 :
RTC::DataFlowComponentBase(manager),
91 m_angle_inIn(
"angle_in", m_angle_in),
92 m_torqueOut(
"torque", m_torque),
93 m_angle_outOut(
"angle_out", m_angle_out),
94 m_velOut(
"vel", m_vel),
95 m_accOut(
"acc", m_acc),
101 if( CONTROLLER_BRIDGE_DEBUG )
103 std::cout <<
"SamplePD_HG::SamplePD_HG" << std::endl;
130 if( CONTROLLER_BRIDGE_DEBUG )
132 std::cout <<
"onInitialize" << std::endl;
149 for (
int i=0;
i<
DOF;
i++){
155 std::cerr <<
GAIN_FILE <<
" not opened" << std::endl;
193 std::cout <<
"on Activated" << std::endl;
200 for(
int i=0;
i <
DOF; ++
i){
211 std::cout <<
"on Deactivated" << std::endl;
220 if( CONTROLLER_BRIDGE_DEBUG )
222 std::cout <<
"onExecute" << std::endl;
223 std::string localStr;
224 std::cin >> localStr;
233 for (
int i=0;
i<
DOF;
i++){
351 if (!
angle.is_open()){
352 std::cerr <<
ANGLE_FILE <<
" not opened" << std::endl;
357 std::cerr <<
VEL_FILE <<
" not opened" << std::endl;
363 std::cerr <<
ACC_FILE <<
" not opend" << std::endl;
369 if(
angle.is_open() ){
390 manager->registerFactory(
profile,
391 RTC::Create<SamplePD_HG>,
392 RTC::Delete<SamplePD_HG>);
OutPort< TimedDoubleSeq > m_torqueOut
TimedDoubleSeq m_angle_in
SamplePD_HG(RTC::Manager *manager)
OutPort< TimedDoubleSeq > m_angle_outOut
OutPort< TimedDoubleSeq > m_velOut
static const char * SamplePD_HG_spec[]
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
png_infop png_charpp int png_charpp profile
DLL_EXPORT void SamplePD_HGInit(RTC::Manager *manager)
virtual RTC::ReturnCode_t onInitialize()
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
InPort< TimedDoubleSeq > m_angle_inIn
TimedDoubleSeq m_angle_out
std::vector< double > qold
OutPort< TimedDoubleSeq > m_accOut
openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:04