25 #define TIMESTEP 0.002 27 #define GAIN_FILE "etc/PDgain.dat" 31 const bool CONTROLLER_BRIDGE_DEBUG =
false;
39 "implementation_id",
"SampleLF",
40 "type_name",
"SampleLF",
41 "description",
"Sample LF component",
44 "category",
"Generic",
45 "activity_type",
"DataFlowComponent",
48 "lang_type",
"compile",
58 m_angleIn(
"angle", m_angle),
59 m_torqueInL(
"r_torque_out",m_torqueL),
60 m_torqueInR(
"l_torque_out",m_torqueR),
61 m_torqueOut(
"torque", m_torque),
68 if( CONTROLLER_BRIDGE_DEBUG )
70 std::cout <<
"SampleLF::SampleLF" << std::endl;
96 if( CONTROLLER_BRIDGE_DEBUG )
98 std::cout <<
"onInitialize" << std::endl;
115 for (
int i=0;
i<
DOF;
i++){
121 std::cerr <<
GAIN_FILE <<
" not opened" << std::endl;
156 std::cout <<
"on Activated" << std::endl;
166 for(
int i=0;
i <
DOF; ++
i){
177 std::cout <<
"on Deactivated" << std::endl;
186 if( CONTROLLER_BRIDGE_DEBUG )
188 std::cout <<
"SampleLF::onExecute" << std::endl;
204 double q_ref, dq_ref;
205 double threshold = 30.0;
304 angle1.open(
"etc/LFangle1.dat");
306 std::cerr <<
"etc/LFangle1.dat not opened" << std::endl;
309 angle2.open(
"etc/LFangle2.dat");
311 std::cerr <<
"etc/LFangle2.dat not opened" << std::endl;
314 vel1.open(
"etc/LFvel1.dat");
315 if (!
vel1.is_open()){
316 std::cerr <<
"etc/LFvel1.dat not opened" << std::endl;
319 vel2.open(
"etc/LFvel2.dat");
320 if (!
vel2.is_open()){
321 std::cerr <<
"etc/LFvel2.dat not opened" << std::endl;
335 if(
vel1.is_open() ){
339 if(
vel2.is_open() ){
354 RTC::Create<SampleLF>,
355 RTC::Delete<SampleLF>);
png_infop png_charpp int png_charpp profile
SampleLF(RTC::Manager *manager)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
std::vector< double > qold
static const char * samplepd_spec[]
DLL_EXPORT void SampleLFInit(RTC::Manager *manager)
bool addOutPort(const char *name, OutPortBase &outport)
InPort< TimedDoubleSeq > m_angleIn
ExecutionContextHandle_t UniqueId
InPort< TimedDoubleSeq > m_torqueInL
OutPort< TimedDoubleSeq > m_torqueOut
InPort< TimedDoubleSeq > m_torqueInR
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
virtual bool write(DataType &value)
std::vector< double > qref_old
bool addInPort(const char *name, InPortBase &inport)
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
virtual RTC::ReturnCode_t onInitialize()