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",
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() ){
391 RTC::Create<SamplePD_HG>,
392 RTC::Delete<SamplePD_HG>);
png_infop png_charpp int png_charpp profile
virtual RTC::ReturnCode_t onInitialize()
static const char * SamplePD_HG_spec[]
DLL_EXPORT void SamplePD_HGInit(RTC::Manager *manager)
bool addOutPort(const char *name, OutPortBase &outport)
OutPort< TimedDoubleSeq > m_angle_outOut
std::vector< double > qold
TimedDoubleSeq m_angle_out
ExecutionContextHandle_t UniqueId
InPort< TimedDoubleSeq > m_angle_inIn
OutPort< TimedDoubleSeq > m_torqueOut
SamplePD_HG(RTC::Manager *manager)
OutPort< TimedDoubleSeq > m_accOut
virtual bool write(DataType &value)
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
bool addInPort(const char *name, InPortBase &inport)
OutPort< TimedDoubleSeq > m_velOut
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
TimedDoubleSeq m_angle_in