16 "implementation_id",
"ModifiedServo",
17 "type_name",
"ModifiedServo",
18 "description",
"ModifiedServo component",
21 "category",
"example",
22 "activity_type",
"SPORADIC",
23 "kind",
"DataFlowComponent",
26 "lang_type",
"compile",
35 m_tauRefIn(
"tauRef", m_tauRef),
36 m_qRefIn(
"qRef", m_qRef),
38 m_torqueModeIn(
"torqueMode", m_torqueMode),
39 m_tauOut(
"tau", m_tau),
40 m_pgainsIn(
"pgainsSet", m_pgains),
41 m_dgainsIn(
"dgainsSet", m_dgains),
42 m_pgainsOut(
"pgainsGet", m_pgains),
43 m_dgainsOut(
"dgainsGet", m_dgains),
86 std::cout <<
m_profile.instance_name <<
": onInitialize() " << std::endl;
98 std::string nameServer = rtcManager.
getConfig()[
"corba.nameservers"];
99 int comPos = nameServer.find(
",");
102 comPos = nameServer.length();
105 nameServer = nameServer.substr(0, comPos);
110 CosNaming::NamingContext::_duplicate(
naming.getRootContext())))
111 std::cerr <<
"[" <<
m_profile.instance_name <<
"] failed to load model " 112 <<
"[" << prop[
"model"] <<
"]" << std::endl;
138 std::cout <<
m_profile.instance_name <<
": on Activated" << std::endl;
160 for (
size_t i = 0;
i <
dof;
i++) {
173 std::cout <<
m_profile.instance_name <<
": on Deactivated" << std::endl;
200 for (
size_t i = 0;
i <
dof;
i++) {
204 double q =
m_q.data[
i];
270 if (
gain.is_open()) {
277 for (
unsigned int i = 0;
i <
dof;
i++) {
282 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] is too short" << std::endl;
287 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] is too short" << std::endl;
292 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] successfully read" << std::endl;
295 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] could not be opened" << std::endl;
305 RTC::Create<ModifiedServo>,
306 RTC::Delete<ModifiedServo>);
ComponentProfile m_profile
png_infop png_charpp int png_charpp profile
InPort< TimedDoubleSeq > m_dgainsIn
bool stringTo(To &val, const char *str)
InPort< TimedDoubleSeq > m_qRefIn
coil::Properties & getProperties()
static Manager & instance()
bool addOutPort(const char *name, OutPortBase &outport)
boost::shared_ptr< Body > BodyPtr
virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id)
static const char * modifiedservo_spec[]
virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id)
coil::Properties & getConfig()
ExecutionContextHandle_t UniqueId
virtual RTC::ReturnCode_t onInitialize()
int loadBodyFromModelLoader(::World *world, const char *name, const char *url, CosNaming::NamingContext_var cxt)
OutPort< TimedDoubleSeq > m_tauOut
OutPort< TimedDoubleSeq > m_pgainsOut
TimedBooleanSeq m_torqueMode
OutPort< TimedDoubleSeq > m_dgainsOut
virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id)
void ModifiedServoInit(RTC::Manager *manager)
InPort< TimedBooleanSeq > m_torqueModeIn
virtual bool write(DataType &value)
InPort< TimedDoubleSeq > m_qIn
ModifiedServo(RTC::Manager *manager)
InPort< TimedDoubleSeq > m_tauRefIn
InPort< TimedDoubleSeq > m_pgainsIn
bool addInPort(const char *name, InPortBase &inport)
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)