20 nxtrtc_spec = [
"implementation_id",
"NXTRTC",
21 "type_name",
"NXTRTC",
22 "description",
"NXT sample component",
25 "category",
"example",
26 "activity_type",
"DataFlowComponent",
29 "lang_type",
"SCRIPT",
30 "conf.default.map",
"A,B",
51 self._nxtbrick.setMotors(vel_)
56 OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
67 self.
_d_vel = RTC.TimedFloatSeq(RTC.Time(0,0),[])
70 self.
_d_pos = RTC.TimedFloatSeq(RTC.Time(0,0),[])
73 self.
_d_sens = RTC.TimedFloatSeq(RTC.Time(0,0),[])
83 print "Connecting to NXT brick ...." 85 print "Connection established." 87 print "NXTBrick connection failed." 96 self._nxtbrick.close()
100 self._nxtbrick.resetPosition()
107 self._nxtbrick.resetPosition()
114 sensor_ = self._nxtbrick.getSensors()
116 self._d_sens.data = [sensor_[3]]
118 self._sensOut.write()
121 position_ = self._nxtbrick.getMotors()
133 manager.registerFactory(profile,
142 comp = manager.createComponent(
"NXTRTC")
147 mgr = OpenRTM_aist.Manager.init(len(sys.argv), sys.argv)
149 mgr.setModuleInitProc(MyModuleInit)
150 mgr.activateManager()
153 if __name__ ==
"__main__":
def NXTRTC_callbackInit(manager)
def bindParameter(self, param_name, var, def_val, trans=None)
template <typename vartype>=""> bool bindParameter(const char* param_name, VarType& var...
The Properties class represents a persistent set of properties.
def onActivated(self, ec_id)
def addOutPort(self, name, outport)
def addInPort(self, name, inport)
def __call__(self, pData)
def __init__(self, manager)
DataFlowComponentBase class.
def onExecute(self, ec_id)
def onDeactivated(self, ec_id)
def __init__(self, nxtbrick_, map_)
def MyModuleInit(manager)