Пример #1
0
  def __init__(self, endpoint, modules):
	QWidget.__init__(self)
	self.ui = Ui_JointMotorDlg()
	self.ui.setupUi(self)
	self.t = 0.
	self.ic = Ice.initialize(sys.argv)
	self.mods = modules
	self.prx = self.ic.stringToProxy(endpoint)
	self.proxy = self.mods['RoboCompJointMotor'].JointMotorPrx.checkedCast(self.prx)
	self.show;
	
	#Init spinboxes values
	map = self.proxy.getAllMotorState()
	self.ui.sbNeck.setValue(map['neck'].pos)
	self.ui.sbLeftPan.setValue(map['leftPan'].pos)
	self.ui.sbRightPan.setValue(map['rightPan'].pos)
	self.ui.sbTilt.setValue(map['tilt'].pos)
	
	self.connect( self.ui.sbNeck , SIGNAL('valueChanged(double)'), self.ChangeNeck );
	self.connect( self.ui.sbTilt , SIGNAL('valueChanged(double)'), self.ChangeTilt );
	self.connect( self.ui.sbLeftPan , SIGNAL('valueChanged(double)'), self.ChangeLeftPan );
	self.connect( self.ui.sbRightPan , SIGNAL('valueChanged(double)'), self.ChangeRightPan );
	#self.connect( self.ui.pbSaccadic, SIGNAL('clicked()'), self.doSaccadic );
	
	self.job()
Пример #2
0
  def __init__(self, endpoint, modules):
	QWidget.__init__(self)
	self.ui = Ui_JointMotorDlg()
	self.ui.setupUi(self)
	self.t = 0.
	self.ic = Ice.initialize(sys.argv)
	self.mods = modules
	self.prx = self.ic.stringToProxy(endpoint)
	self.proxy = self.mods['RoboCompJointMotor'].JointMotorPrx.checkedCast(self.prx)
	self.show;
	
	#Init spinboxes values
	map = self.proxy.getAllMotorState()
	self.ui.sbNeck.setValue(map['neck'].pos)
	self.ui.sbLeftPan.setValue(map['leftPan'].pos)
	self.ui.sbRightPan.setValue(map['rightPan'].pos)
	self.ui.sbTilt.setValue(map['tilt'].pos)
	
	self.connect( self.ui.sbNeck , SIGNAL('valueChanged(double)'), self.ChangeNeck );
	self.connect( self.ui.sbTilt , SIGNAL('valueChanged(double)'), self.ChangeTilt );
	self.connect( self.ui.sbLeftPan , SIGNAL('valueChanged(double)'), self.ChangeLeftPan );
	self.connect( self.ui.sbRightPan , SIGNAL('valueChanged(double)'), self.ChangeRightPan );
	#self.connect( self.ui.pbSaccadic, SIGNAL('clicked()'), self.doSaccadic );
	
	self.job()
Пример #3
0
class C(QWidget):
  def __init__(self, endpoint, modules):
	QWidget.__init__(self)
	self.ui = Ui_JointMotorDlg()
	self.ui.setupUi(self)
	self.t = 0.
	self.ic = Ice.initialize(sys.argv)
	self.mods = modules
	self.prx = self.ic.stringToProxy(endpoint)
	self.proxy = self.mods['RoboCompJointMotor'].JointMotorPrx.checkedCast(self.prx)
	self.show;
	
	#Init spinboxes values
	map = self.proxy.getAllMotorState()
	self.ui.sbNeck.setValue(map['neck'].pos)
	self.ui.sbLeftPan.setValue(map['leftPan'].pos)
	self.ui.sbRightPan.setValue(map['rightPan'].pos)
	self.ui.sbTilt.setValue(map['tilt'].pos)
	
	self.connect( self.ui.sbNeck , SIGNAL('valueChanged(double)'), self.ChangeNeck );
	self.connect( self.ui.sbTilt , SIGNAL('valueChanged(double)'), self.ChangeTilt );
	self.connect( self.ui.sbLeftPan , SIGNAL('valueChanged(double)'), self.ChangeLeftPan );
	self.connect( self.ui.sbRightPan , SIGNAL('valueChanged(double)'), self.ChangeRightPan );
	#self.connect( self.ui.pbSaccadic, SIGNAL('clicked()'), self.doSaccadic );
	
	self.job()
	
  def job(self):
	#map = self.proxy.getMotorStateMap(['Neck', 'LeftPan', 'RightPan', 'Tilt']);
	map = self.proxy.getAllMotorState()
	self.ui.lcdNeck.display(map['neck'].pos)
	self.ui.lcdLeftPan.display(map['leftPan'].pos)
	self.ui.lcdRightPan.display(map['rightPan'].pos)
	self.ui.lcdTilt.display(map['tilt'].pos)
	#mState = self.proxy.getMotorState("Neck")
	#mState = self.proxy.getMotorState("LeftPan")
	#self.ui.lcdLeftPan.display(mState.pos);
	#mState = self.proxy.getMotorState("RightPan")
	#self.ui.lcdRightPan.display(mState.pos);
	#mState = self.proxy.getMotorState("Tilt")
	#self.ui.lcdTilt.display(mState.pos);
	##return ['signal', [ mState.pos, 200 ] ]

 
  def ChangeNeck(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "neck"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition( g );
	except Ice.Exception:
	  traceback.print_exc()
	  
  def ChangeTilt(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "tilt"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition( g );
	except Ice.Exception:
	  traceback.print_exc()
	  
  def ChangeLeftPan(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "leftPan"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition( g )
	except Ice.Exception:
	  traceback.print_exc()
	  
  def ChangeRightPan(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "rightPan"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition(g )
	except  Ice.Exception:
	  traceback.print_exc()
Пример #4
0
class C(QWidget):
  def __init__(self, endpoint, modules):
	QWidget.__init__(self)
	self.ui = Ui_JointMotorDlg()
	self.ui.setupUi(self)
	self.t = 0.
	self.ic = Ice.initialize(sys.argv)
	self.mods = modules
	self.prx = self.ic.stringToProxy(endpoint)
	self.proxy = self.mods['RoboCompJointMotor'].JointMotorPrx.checkedCast(self.prx)
	self.show;
	
	#Init spinboxes values
	map = self.proxy.getAllMotorState()
	self.ui.sbNeck.setValue(map['neck'].pos)
	self.ui.sbLeftPan.setValue(map['leftPan'].pos)
	self.ui.sbRightPan.setValue(map['rightPan'].pos)
	self.ui.sbTilt.setValue(map['tilt'].pos)
	
	self.connect( self.ui.sbNeck , SIGNAL('valueChanged(double)'), self.ChangeNeck );
	self.connect( self.ui.sbTilt , SIGNAL('valueChanged(double)'), self.ChangeTilt );
	self.connect( self.ui.sbLeftPan , SIGNAL('valueChanged(double)'), self.ChangeLeftPan );
	self.connect( self.ui.sbRightPan , SIGNAL('valueChanged(double)'), self.ChangeRightPan );
	#self.connect( self.ui.pbSaccadic, SIGNAL('clicked()'), self.doSaccadic );
	
	self.job()
	
  def job(self):
	#map = self.proxy.getMotorStateMap(['Neck', 'LeftPan', 'RightPan', 'Tilt']);
	map = self.proxy.getAllMotorState()
	self.ui.lcdNeck.display(map['neck'].pos)
	self.ui.lcdLeftPan.display(map['leftPan'].pos)
	self.ui.lcdRightPan.display(map['rightPan'].pos)
	self.ui.lcdTilt.display(map['tilt'].pos)
	#mState = self.proxy.getMotorState("Neck")
	#mState = self.proxy.getMotorState("LeftPan")
	#self.ui.lcdLeftPan.display(mState.pos);
	#mState = self.proxy.getMotorState("RightPan")
	#self.ui.lcdRightPan.display(mState.pos);
	#mState = self.proxy.getMotorState("Tilt")
	#self.ui.lcdTilt.display(mState.pos);
	##return ['signal', [ mState.pos, 200 ] ]

 
  def ChangeNeck(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "neck"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition( g );
	except Ice.Exception:
	  traceback.print_exc()
	  
  def ChangeTilt(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "tilt"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition( g );
	except Ice.Exception:
	  traceback.print_exc()
	  
  def ChangeLeftPan(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "leftPan"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition( g )
	except Ice.Exception:
	  traceback.print_exc()
	  
  def ChangeRightPan(self, value):
	try:
	  g = self.mods['RoboCompJointMotor'].MotorGoalPosition();
	  g.name = "rightPan"
	  g.position = value
	  g.maxSpeed = 1.5
	  self.proxy.setPosition(g )
	except  Ice.Exception:
	  traceback.print_exc()