23 #define TIMESTEP 0.002 25 #define ANGLE_FILE "etc/angle.dat" 26 #define VEL_FILE "etc/vel.dat" 27 #define ACC_FILE "etc/acc.dat" 29 #define GAIN_FILE "etc/PDgain.dat" 32 const bool CONTROLLER_BRIDGE_DEBUG =
false;
40 "implementation_id",
"SamplePD",
41 "type_name",
"SamplePD",
42 "description",
"Sample PD component",
45 "category",
"Generic",
46 "activity_type",
"DataFlowComponent",
49 "lang_type",
"compile",
59 m_angleIn(
"angle", m_angle),
60 m_torqueOut(
"torque", m_torque),
66 if( CONTROLLER_BRIDGE_DEBUG )
68 std::cout <<
"SamplePD::SamplePD" << std::endl;
95 if( CONTROLLER_BRIDGE_DEBUG )
97 std::cout <<
"onInitialize" << std::endl;
112 for (
int i=0;
i<
DOF;
i++){
118 std::cerr <<
GAIN_FILE <<
" not found" << std::endl;
151 std::cout <<
"on Activated" << std::endl;
158 for(
int i=0;
i <
DOF; ++
i){
169 std::cout <<
"on Deactivated" << std::endl;
178 if( CONTROLLER_BRIDGE_DEBUG )
180 std::cout <<
"onExecute" << std::endl;
181 std::string localStr;
182 std::cin >> localStr;
191 for (
int i=0;
i<
DOF;
i++){
247 if(!
angle.is_open()){
248 std::cerr <<
ANGLE_FILE <<
" not opened" << std::endl;
253 std::cerr <<
VEL_FILE <<
" not opened" << std::endl;
259 if(
angle.is_open() ){
276 RTC::Create<SamplePD>,
277 RTC::Delete<SamplePD>);
png_infop png_charpp int png_charpp profile
InPort< TimedDoubleSeq > m_angleIn
DLL_EXPORT void SamplePDInit(RTC::Manager *manager)
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
bool addOutPort(const char *name, OutPortBase &outport)
OutPort< TimedDoubleSeq > m_torqueOut
ExecutionContextHandle_t UniqueId
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onInitialize()
SamplePD(RTC::Manager *manager)
virtual bool write(DataType &value)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
static const char * samplepd_spec[]
bool addInPort(const char *name, InPortBase &inport)
std::vector< double > qold
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)