Go to the documentation of this file.
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",
57 :
RTC::DataFlowComponentBase(manager),
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() ){
275 manager->registerFactory(
profile,
276 RTC::Create<SamplePD>,
277 RTC::Delete<SamplePD>);
DLL_EXPORT void SamplePDInit(RTC::Manager *manager)
InPort< TimedDoubleSeq > m_angleIn
png_infop png_charpp int png_charpp profile
virtual RTC::ReturnCode_t onInitialize()
OutPort< TimedDoubleSeq > m_torqueOut
SamplePD(RTC::Manager *manager)
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
std::vector< double > qold
static const char * samplepd_spec[]
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
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