def __init__(self,name):
	M3Component.__init__(self,name,type='m3tactile_pps22_ec')
	self.status=mec.M3TactilePPS22EcStatus()
	self.command=mec.M3TactilePPS22EcCommand()
	self.param=mec.M3TactilePPS22EcParam()
	self.taxels=nu.zeros(22,nu.Float32)
	self.read_config()
Esempio n. 2
0
    def __init__(self, name, type='m3dynamatics'):
        M3Component.__init__(self, name, type=type)
        self.status = mrt.M3DynamaticsStatus()
        self.command = mrt.M3DynamaticsCommand()
        self.param = mrt.M3DynamaticsParam()

        for i in range(3):
            self.param.payload_com.append(0)
        for i in range(6):
            self.param.payload_inertia.append(0)

        self.read_config()

        self.T80 = nu.zeros([4, 4],
                            nu.float32)  #Transform from end to base frame
        self.T08 = nu.zeros([4, 4],
                            nu.float32)  #Transform from base to end frame
        self.G = nu.zeros(self.ndof + 1, nu.float32)  #Gravity vector on joints
        self.C = nu.zeros(self.ndof + 1,
                          nu.float32)  #Coriolis vector on joints
        self.J = nu.zeros(
            [6, self.ndof],
            nu.float32)  #Jacobian from joint torques to end torques
        self.Jt = nu.zeros([self.ndof, 6],
                           nu.float32)  #Transform end wrench to joint torques.
        self.end_twist = nu.zeros(6, nu.float32)
        self.end_pos = nu.zeros(3, nu.float32)
        self.end_rot = nu.zeros([3, 3], nu.float32)
Esempio n. 3
0
 def __init__(self, name):
     M3Component.__init__(self, name, type='m3loadx6')
     self.status = mrt.M3LoadX6Status()
     self.command = mrt.M3LoadX6Command()
     self.param = mrt.M3LoadX6Param()
     self.wrench = nu.zeros(6, float)
     self.read_config()
Esempio n. 4
0
 def __init__(self,name):
     M3Component.__init__(self,name,type='m3robot_monitor')
     
     self.status=mrm.M3RobotMonitorStatus()
     self.command=mrm.M3RobotMonitorCommand()
     self.param=mrm.M3RobotMonitorParam()
     self.read_config()
Esempio n. 5
0
    def __init__(self, name, ndof, ctype):
        M3Component.__init__(self, name, ctype)
        self.read_config()
        self.status = mab.M3JointArrayStatus()
        self.command = mab.M3JointArrayCommand()
        self.param = mab.M3JointArrayParam()
        if ndof is None:
            ndof = self.config['ndof']
        self.ndof = ndof
        self.vias = []
        self.via_idx = 0
        # Grow the protocol buffer messages to correct size
        # NOTE: should really support mixed sizes but...
        for i in range(self.ndof):
            self.command.pwm_desired.append(0)
            self.command.tq_desired.append(0)
            self.command.q_desired.append(0)
            self.command.qdot_desired.append(0)
            self.command.q_stiffness.append(0)
            self.command.q_slew_rate.append(0)
            self.command.smoothing_mode.append(msm.SMOOTHING_MODE_OFF)
            self.command.ctrl_mode.append(mam.JOINT_ARRAY_MODE_OFF)

        self.motor_temp = nu.zeros(self.ndof, float)
        self.amp_temp = nu.zeros(self.ndof, float)
        self.torque = nu.zeros(self.ndof, float)
        self.torquedot = nu.zeros(self.ndof, float)
        self.current = nu.zeros(self.ndof, float)
        self.theta = nu.zeros(self.ndof, float)
        self.thetadot = nu.zeros(self.ndof, float)
        self.thetadotdot = nu.zeros(self.ndof, float)

        self.max_slew_rates = self.__get_max_slew_rates_from_config()
Esempio n. 6
0
 def __init__(self, name):
     M3Component.__init__(self, name, type='m3tactile_pps22_ec')
     self.status = mec.M3TactilePPS22EcStatus()
     self.command = mec.M3TactilePPS22EcCommand()
     self.param = mec.M3TactilePPS22EcParam()
     self.taxels = nu.zeros(22, nu.Float32)
     self.read_config()
Esempio n. 7
0
    def __init__(self,name,ndof,ctype):
        M3Component.__init__(self,name,ctype)
	self.read_config()
        self.status=mab.M3JointArrayStatus()
        self.command=mab.M3JointArrayCommand()
        self.param=mab.M3JointArrayParam()
	if ndof is None:
	    ndof=self.config['ndof']
        self.ndof=ndof
        self.vias=[]
        self.via_idx=0
        # Grow the protocol buffer messages to correct size
        # NOTE: should really support mixed sizes but...
        for i in range(self.ndof):
            self.command.pwm_desired.append(0)
            self.command.tq_desired.append(0)
            self.command.q_desired.append(0)
            self.command.qdot_desired.append(0)
            self.command.q_stiffness.append(0)
	    self.command.q_slew_rate.append(0)
	    self.command.smoothing_mode.append(msm.SMOOTHING_MODE_OFF)
            self.command.ctrl_mode.append(mam.JOINT_ARRAY_MODE_OFF)
        
        self.motor_temp=nu.zeros(self.ndof,float)
        self.amp_temp=nu.zeros(self.ndof,float)
        self.torque=nu.zeros(self.ndof,float)
        self.torquedot=nu.zeros(self.ndof,float)	
        self.current=nu.zeros(self.ndof,float)
        self.theta=nu.zeros(self.ndof,float)
        self.thetadot=nu.zeros(self.ndof,float)
        self.thetadotdot=nu.zeros(self.ndof,float)
	
	self.max_slew_rates=self.__get_max_slew_rates_from_config()
Esempio n. 8
0
    def __init__(self,name):
	M3Component.__init__(self,name,type='m3loadx6')
	self.status=mrt.M3LoadX6Status()
	self.command=mrt.M3LoadX6Command()
	self.param=mrt.M3LoadX6Param()
	self.wrench=nu.zeros(6,float)
	self.read_config()	
	def __init__(self,name,type='m3head_s2csp_ctrl'):
		M3Component.__init__(self,name,type=type)
		self.status=hpb.M3HeadS2CSPCtrlStatus()
		self.command=hpb.M3HeadS2CSPCtrlCommand()
		self.param=hpb.M3HeadS2CSPCtrlParam()
		self.read_config()
		for i in range(3):
			self.command.target.append(0)
			self.status.xe.append(0)
Esempio n. 10
0
 def __init__(self, name, type='m3head_s2csp_ctrl'):
     M3Component.__init__(self, name, type=type)
     self.status = hpb.M3HeadS2CSPCtrlStatus()
     self.command = hpb.M3HeadS2CSPCtrlCommand()
     self.param = hpb.M3HeadS2CSPCtrlParam()
     self.read_config()
     for i in range(3):
         self.command.target.append(0)
         self.status.xe.append(0)
Esempio n. 11
0
    def __init__(self, name):
        M3Component.__init__(self, name, type='m3ledx2xn_ec')
        self.status = mec.M3LedX2XNEcStatus()
        self.command = mec.M3LedX2XNEcCommand()
        self.param = mec.M3LedX2XNEcParam()
        self.read_config()
        self.slew = {'branch_a': [], 'branch_b': []}
        self.nled = {
            'branch_a': self.config['param']['n_branch_a'],
            'branch_b': self.config['param']['n_branch_b']
        }
        self.phase = {'branch_a': [], 'branch_b': []}
        for i in range(self.nled['branch_a']):
            self.command.branch_a.r.append(0)
            self.command.branch_a.g.append(0)
            self.command.branch_a.b.append(0)
            self.slew['branch_a'].append(
                [m3t.M3Slew(), m3t.M3Slew(),
                 m3t.M3Slew()])
            self.phase['branch_a'].append(math.pi * i / (math.pi * 2))
        for i in range(self.nled['branch_b']):
            self.command.branch_b.r.append(0)
            self.command.branch_b.g.append(0)
            self.command.branch_b.b.append(0)
            self.slew['branch_b'].append(
                [m3t.M3Slew(), m3t.M3Slew(),
                 m3t.M3Slew()])
            self.phase['branch_b'].append(math.pi * i / (math.pi * 2))

        self.circ_slew = {'branch_a': [], 'branch_b': []}
        for i in range(6):
            for b in ['branch_a', 'branch_b']:
                self.circ_slew[b].append(m3t.M3Slew())

        self.command_branch = {
            'branch_a': self.command.branch_a,
            'branch_b': self.command.branch_b
        }
        self.mode = {
            'branch_a': mode_ledx2xn_off,
            'branch_b': mode_ledx2xn_off
        }
        self.rgb = {
            'branch_a': [[0, 0, 0]] * self.nled['branch_a'],
            'branch_b': [[0, 0, 0]] * self.nled['branch_b']
        }
        self.slew_rate = {'branch_a': 0, 'branch_b': 0}
        self.circ_rate = {'branch_a': 0, 'branch_b': 0}
        self.circ_slew_rate = {'branch_a': 0, 'branch_b': 0}
        self.circ_rgb_1 = {'branch_a': None, 'branch_b': None}
        self.circ_rgb_2 = {'branch_a': None, 'branch_b': None}
        self.step = {'branch_a': 0, 'branch_b': 0}
        self.disable_leds()
Esempio n. 12
0
 def __init__(self, name):
     M3Component.__init__(self, name, type='m3ledx2_ec')
     self.status = mec.M3LedX2EcStatus()
     self.command = mec.M3LedX2EcCommand()
     self.param = mec.M3LedX2EcParam()
     self.read_config()
     self.slew_aa_r = m3t.M3Slew()
     self.slew_aa_g = m3t.M3Slew()
     self.slew_aa_b = m3t.M3Slew()
     self.slew_ab_r = m3t.M3Slew()
     self.slew_ab_g = m3t.M3Slew()
     self.slew_ab_b = m3t.M3Slew()
     self.slew_ba_r = m3t.M3Slew()
     self.slew_ba_g = m3t.M3Slew()
     self.slew_ba_b = m3t.M3Slew()
     self.slew_bb_r = m3t.M3Slew()
     self.slew_bb_g = m3t.M3Slew()
     self.slew_bb_b = m3t.M3Slew()
Esempio n. 13
0
    def __init__(self,name):
	M3Component.__init__(self,name,type='m3ledx2_ec')
	self.status=mec.M3LedX2EcStatus()
	self.command=mec.M3LedX2EcCommand()
	self.param=mec.M3LedX2EcParam()
	self.read_config()
	self.slew_aa_r=m3t.M3Slew()
	self.slew_aa_g=m3t.M3Slew()
	self.slew_aa_b=m3t.M3Slew()
	self.slew_ab_r=m3t.M3Slew()
	self.slew_ab_g=m3t.M3Slew()
	self.slew_ab_b=m3t.M3Slew()
	self.slew_ba_r=m3t.M3Slew()
	self.slew_ba_g=m3t.M3Slew()
	self.slew_ba_b=m3t.M3Slew()
	self.slew_bb_r=m3t.M3Slew()
	self.slew_bb_g=m3t.M3Slew()
	self.slew_bb_b=m3t.M3Slew()
    def __init__(self, name, type):
        M3Component.__init__(self, name, type)

        # TODO: Figure this out from config.
        self.num_casters = 4

        self.command = mob.MekaOmnibaseControlCommand()
        self.status  = mob.MekaOmnibaseControlStatus()
        self.param   = mob.MekaOmnibaseControlParam()

        self.read_config()

        for i in range(3):
            self.command.xd_des.append(0.0)
        for i in range(self.num_casters):
            self.command.betad_des.append(0.0)
            self.command.phid_des.append(0.0)
            self.command.tqr.append(0.0)

        self.command.ctrl_mode = mob.MEKA_OMNIBASE_CONTROL_OFF
Esempio n. 15
0
    def __init__(self,name):
	M3Component.__init__(self,name,type='m3led_matrix_ec')
	self.status=mec.M3LedMatrixEcStatus()
	self.command=mec.M3LedMatrixEcCommand()
	self.param=mec.M3LedMatrixEcParam()
	self.read_config()
	self.num_row=self.config['num_rows']
	self.num_col=self.config['num_cols']
	self.ra=0
	if self.config['invert_image']:
	    self.ra=self.num_row-1

	for i in range(self.num_row):
	    self.command.row.add()
	    for j in range(self.num_col):
		self.command.row[i].column.add()
	#Setup animations
	self.seq_id=0
	self.animations={}
	self.anim_name=None
Esempio n. 16
0
    def __init__(self, name, type="m3dynamatics"):
        M3Component.__init__(self, name, type=type)
        self.status = mrt.M3DynamaticsStatus()
        self.command = mrt.M3DynamaticsCommand()
        self.param = mrt.M3DynamaticsParam()

        for i in range(3):
            self.param.payload_com.append(0)
        for i in range(6):
            self.param.payload_inertia.append(0)

        self.read_config()

        self.T80 = nu.zeros([4, 4], nu.float32)  # Transform from end to base frame
        self.T08 = nu.zeros([4, 4], nu.float32)  # Transform from base to end frame
        self.G = nu.zeros(self.ndof + 1, nu.float32)  # Gravity vector on joints
        self.C = nu.zeros(self.ndof + 1, nu.float32)  # Coriolis vector on joints
        self.J = nu.zeros([6, self.ndof], nu.float32)  # Jacobian from joint torques to end torques
        self.Jt = nu.zeros([self.ndof, 6], nu.float32)  # Transform end wrench to joint torques.
        self.end_twist = nu.zeros(6, nu.float32)
        self.end_pos = nu.zeros(3, nu.float32)
        self.end_rot = nu.zeros([3, 3], nu.float32)
Esempio n. 17
0
 def __init__(self,name):
     M3Component.__init__(self,name,type='m3ledx2xn_ec')
     self.status=mec.M3LedX2XNEcStatus()
     self.command=mec.M3LedX2XNEcCommand()
     self.param=mec.M3LedX2XNEcParam()
     self.read_config()
     self.slew={'branch_a':[],'branch_b':[]}
     self.nled={'branch_a':self.config['param']['n_branch_a'],'branch_b':self.config['param']['n_branch_b']}
     self.phase={'branch_a':[],'branch_b':[]}
     for i in range(self.nled['branch_a']):
         self.command.branch_a.r.append(0)
         self.command.branch_a.g.append(0)
         self.command.branch_a.b.append(0)
         self.slew['branch_a'].append([m3t.M3Slew(),m3t.M3Slew(),m3t.M3Slew()])
         self.phase['branch_a'].append(math.pi*i/(math.pi*2))
     for i in range(self.nled['branch_b']):
         self.command.branch_b.r.append(0)
         self.command.branch_b.g.append(0)
         self.command.branch_b.b.append(0)
         self.slew['branch_b'].append([m3t.M3Slew(),m3t.M3Slew(),m3t.M3Slew()])
         self.phase['branch_b'].append(math.pi*i/(math.pi*2))
         
     self.circ_slew={'branch_a':[],'branch_b':[]}
     for i in range(6):
         for b in ['branch_a','branch_b']:
             self.circ_slew[b].append(m3t.M3Slew())
             
     self.command_branch={'branch_a':self.command.branch_a,'branch_b':self.command.branch_b}
     self.mode={'branch_a':mode_ledx2xn_off,'branch_b':mode_ledx2xn_off}
     self.rgb={'branch_a':[[0,0,0]]*self.nled['branch_a'],'branch_b':[[0,0,0]]*self.nled['branch_b']}
     self.slew_rate={'branch_a':0,'branch_b':0}
     self.circ_rate={'branch_a':0,'branch_b':0}
     self.circ_slew_rate={'branch_a':0,'branch_b':0}
     self.circ_rgb_1={'branch_a':None,'branch_b':None}
     self.circ_rgb_2={'branch_a':None,'branch_b':None}
     self.step={'branch_a':0,'branch_b':0}
     self.disable_leds()
Esempio n. 18
0
    def __init__(self,name,type):
	M3Component.__init__(self,name,type)
Esempio n. 19
0
 def __init__(self,name):
     M3Component.__init__(self,name,type='m3pwr_ec')
     self.status=mec.M3PwrEcStatus()
     self.command=mec.M3PwrEcCommand()
     self.param=mec.M3PwrEcParam()
     self.read_config()
Esempio n. 20
0
 def __init__(self, name, type='m3actuator'):
     M3Component.__init__(self, name, type=type)
     self.status = m3.actuator_pb2.M3ActuatorStatus()
     self.command = m3.actuator_pb2.M3ActuatorCommand()
     self.param = m3.actuator_pb2.M3ActuatorParam()
     self.read_config()
Esempio n. 21
0
 def __init__(self,name,type='m3loadx1'):
     M3Component.__init__(self,name,type=type)
     self.status=m3.loadx1_pb2.M3LoadX1Status()
     self.command=m3.loadx1_pb2.M3LoadX1Command()
     self.param=m3.loadx1_pb2.M3LoadX1Param()
     self.read_config()
Esempio n. 22
0
 def __init__(self, name, type):
     M3Component.__init__(self, name, type)
Esempio n. 23
0
 def __init__(self,name):
     M3Component.__init__(self,name,type='m3haptic_demo')
     self.status=mrt.M3HapticDemoStatus()
     self.command=mrt.M3HapticDemoCommand()
     self.param=mrt.M3HapticDemoParam()
     self.read_config()
Esempio n. 24
0
 def __init__(self, name):
     M3Component.__init__(self, name, type='m3haptic_demo')
     self.status = mrt.M3HapticDemoStatus()
     self.command = mrt.M3HapticDemoCommand()
     self.param = mrt.M3HapticDemoParam()
     self.read_config()
Esempio n. 25
0
    def __init__(self,name,ctype='m3async_io'):
        M3Component.__init__(self,name,type=ctype)
	self.read_config()
        self.status=mab.M3AsyncIOStatus()
        self.command=mab.M3AsyncIOCommand()
        self.param=mab.M3AsyncIOParam()
Esempio n. 26
0
 def __init__(self,name,type='m3joint'):
     M3Component.__init__(self,name,type=type)
     self.status=jpb.M3JointStatus()
     self.command=jpb.M3JointCommand()
     self.param=jpb.M3JointParam()
     self.read_config()
Esempio n. 27
0
 def __init__(self, name, type="m3actuator"):
     M3Component.__init__(self, name, type=type)
     self.status = m3.actuator_pb2.M3ActuatorStatus()
     self.command = m3.actuator_pb2.M3ActuatorCommand()
     self.param = m3.actuator_pb2.M3ActuatorParam()
     self.read_config()
Esempio n. 28
0
 def __init__(self, name, type="m3joint"):
     M3Component.__init__(self, name, type=type)
     self.status = jpb.M3JointStatus()
     self.command = jpb.M3JointCommand()
     self.param = jpb.M3JointParam()
     self.read_config()
Esempio n. 29
0
 def __init__(self, name, ctype='m3async_io'):
     M3Component.__init__(self, name, type=ctype)
     self.read_config()
     self.status = mab.M3AsyncIOStatus()
     self.command = mab.M3AsyncIOCommand()
     self.param = mab.M3AsyncIOParam()
Esempio n. 30
0
 def __init__(self,name):
     M3Component.__init__(self,name,type='m3pwr')
     self.status=mrt.M3PwrStatus()
     self.command=mrt.M3PwrCommand()
     self.param=mrt.M3PwrParam()
     self.read_config()
Esempio n. 31
0
 def __init__(self,name,type='m3actuator_ec'):
     M3Component.__init__(self,name,type=type)
     self.status=mec.M3ActuatorEcStatus()
     self.command=mec.M3ActuatorEcCommand()
     self.param=mec.M3ActuatorEcParam()
     self.read_config()
Esempio n. 32
0
 def __init__(self, name, type='m3actuator_ec'):
     M3Component.__init__(self, name, type=type)
     self.status = mec.M3ActuatorEcStatus()
     self.command = mec.M3ActuatorEcCommand()
     self.param = mec.M3ActuatorEcParam()
     self.read_config()
Esempio n. 33
0
 def __init__(self, name, type='m3loadx1'):
     M3Component.__init__(self, name, type=type)
     self.status = m3.loadx1_pb2.M3LoadX1Status()
     self.command = m3.loadx1_pb2.M3LoadX1Command()
     self.param = m3.loadx1_pb2.M3LoadX1Param()
     self.read_config()
 def __init__(self,name,controller_type):
     M3Component.__init__(self,name,controller_type)
     self.status = m3_ci.M3ControllerStatus()
     self.command = m3_ci.M3ControllerCommand()
     self.param = m3_ci.M3ControllerParam()
Esempio n. 35
0
 def __init__(self,name,type='m3loadx1_ec'):
     M3Component.__init__(self,name,type=type)
     self.status=mec.M3LoadX1EcStatus()
     self.command=mec.M3LoadX1EcCommand()
     self.param=mec.M3LoadX1EcParam()
     self.read_config()
Esempio n. 36
0
	def __init__(self,name,type='m3ctrl_simple'):
		M3Component.__init__(self,name,type=type)
		self.status		= m3.ctrl_simple_pb2.M3CtrlSimpleStatus()
		self.command	= m3.ctrl_simple_pb2.M3CtrlSimpleCommand()
		self.param		= m3.ctrl_simple_pb2.M3CtrlSimpleParam()
		self.read_config()
Esempio n. 37
0
 def __init__(self, name):
     M3Component.__init__(self, name, type='m3pwr')
     self.status = mrt.M3PwrStatus()
     self.command = mrt.M3PwrCommand()
     self.param = mrt.M3PwrParam()
     self.read_config()
Esempio n. 38
0
 def __init__(self, name, type='m3ctrl_simple'):
     M3Component.__init__(self, name, type=type)
     self.status = m3.ctrl_simple_pb2.M3CtrlSimpleStatus()
     self.command = m3.ctrl_simple_pb2.M3CtrlSimpleCommand()
     self.param = m3.ctrl_simple_pb2.M3CtrlSimpleParam()
     self.read_config()