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),
78 std::cout <<
m_profile.instance_name <<
": onInitialize() " << std::endl;
90 std::string nameServer = rtcManager.
getConfig()[
"corba.nameservers"];
91 int comPos = nameServer.find(
",");
94 comPos = nameServer.length();
97 nameServer = nameServer.substr(0, comPos);
102 CosNaming::NamingContext::_duplicate(
naming.getRootContext())))
103 std::cerr <<
"[" <<
m_profile.instance_name <<
"] failed to load model " 104 <<
"[" << prop[
"model"] <<
"]" << std::endl;
130 std::cout <<
m_profile.instance_name <<
": on Activated" << std::endl;
149 for (
size_t i = 0;
i <
dof;
i++) {
160 std::cout <<
m_profile.instance_name <<
": on Deactivated" << std::endl;
181 for (
size_t i = 0;
i <
dof;
i++) {
183 double q =
m_q.data[
i];
247 if (
gain.is_open()) {
254 for (
unsigned int i = 0;
i <
dof;
i++) {
259 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] is too short" << std::endl;
264 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] is too short" << std::endl;
269 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] successfully read" << std::endl;
272 std::cout <<
"[" <<
m_profile.instance_name <<
"] Gain file [" <<
gain_fname <<
"] could not be opened" << std::endl;
282 RTC::Create<ModifiedServo>,
283 RTC::Delete<ModifiedServo>);
ComponentProfile m_profile
png_infop png_charpp int png_charpp profile
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
TimedBooleanSeq m_torqueMode
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
bool addInPort(const char *name, InPortBase &inport)
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)