Esempio n. 1
0
 def __init__(self):
     self._treeWidget = None
     self._propertiesPanel = None
     self._objects = {}
     self._blockSignals = False
     self.actions = []
     self.callbacks = callbacks.CallbackRegistry([self.ACTION_SELECTED])
Esempio n. 2
0
    def __init__(self):

        self.callbacks = callbacks.CallbackRegistry([
            self.PROPERTY_CHANGED_SIGNAL, self.PROPERTY_ADDED_SIGNAL,
            self.PROPERTY_ATTRIBUTE_CHANGED_SIGNAL
        ])

        self._properties = OrderedDict()
        self._attributes = {}
        self._alternateNames = {}
Esempio n. 3
0
    def __init__(self, channel):
        self.collection = OrderedDict()
        self.collectionId = newUUID()
        self.sentCommands = set()
        self.sentRequest = None
        self.channel = channel

        self.callbacks = callbacks.CallbackRegistry([self.DESCRIPTION_UPDATED_SIGNAL,
                                                     self.DESCRIPTION_REMOVED_SIGNAL])

        self.sub = lcmUtils.addSubscriber(self.channel, messageClass=lcmdrc.affordance_collection_t, callback=self._onCommandMessage)
        self.sub.setNotifyAllMessagesEnabled(True)
        self._modified()
Esempio n. 4
0
    def __init__(self, name, icon=Icons.Robot, properties=None):

        #print 'init called on:', self
        self._tree = None
        self.callbacks = callbacks.CallbackRegistry([self.REMOVED_FROM_OBJECT_MODEL])
        self.properties = properties or PropertySet()
        self.properties.connectPropertyChanged(self._onPropertyChanged)
        self.properties.connectPropertyAdded(self._onPropertyAdded)
        self.properties.connectPropertyAttributeChanged(self._onPropertyAttributeChanged)

        self.addProperty('Icon', icon, attributes=PropertyAttributes(hidden=True))
        self.addProperty('Deletable', True, attributes=PropertyAttributes(hidden=True))
        self.addProperty('Name', name, attributes=PropertyAttributes(hidden=True))
Esempio n. 5
0
 def __init__(self):
     self.tasks = []
     self.generators = []
     self.timer = TimerCallback(targetFps=10)
     self.timer.callback = self.callbackLoop
     self.callbacks = callbacks.CallbackRegistry([self.QUEUE_STARTED_SIGNAL,
                                                  self.QUEUE_STOPPED_SIGNAL,
                                                  self.TASK_STARTED_SIGNAL,
                                                  self.TASK_ENDED_SIGNAL,
                                                  self.TASK_PAUSED_SIGNAL,
                                                  self.TASK_FAILED_SIGNAL,
                                                  self.TASK_EXCEPTION_SIGNAL])
     self.currentTask = None
     self.isRunning = False
Esempio n. 6
0
 def __init__(self, ikPlanner):
     lcmUtils.addSubscriber('CANDIDATE_MANIP_PLAN', lcmdrc.robot_plan_w_keyframes_t, self.onManipPlan)
     lcmUtils.addSubscriber('CANDIDATE_ROBOT_PLAN_WITH_SUPPORTS',lcmdrc.robot_plan_with_supports_t, self.onManipPlan)
     self.lastManipPlan = None
     self.committedPlans = []
     self.callbacks = callbacks.CallbackRegistry([self.PLAN_RECEIVED,
                                                  self.PLAN_COMMITTED,
                                                  self.USE_SUPPORTS])
     self.ikPlanner = ikPlanner
     self.publishPlansWithSupports = False
     self.plansWithSupportsAreQuasistatic = True
     self.leftFootSupportEnabled  = True
     self.rightFootSupportEnabled = True
     self.leftHandSupportEnabled  = False
     self.rightHandSupportEnabled = False
     self.pelvisSupportEnabled  = False
Esempio n. 7
0
    def __init__(self,
                 imageView,
                 obj=None,
                 callback=None,
                 numberOfPoints=1,
                 drawLines=True):

        self.imageView = imageView
        self.view = imageView.view
        self.obj = obj
        self.drawLines = drawLines
        self.annotationObj = None
        self.annotationFunc = callback
        self.numberOfPoints = numberOfPoints
        self.showCursor = False
        self.cursorObj = None
        self.callbacks = callbacks.CallbackRegistry([self.DOUBLE_CLICK_EVENT])
        self.clear()
Esempio n. 8
0
    def __init__(self, robotURDF, fixedPointFile, leftFootLink, rightFootLink,
                 pelvisLink):

        self.comm = None
        self.outputConsole = None
        self.ready = False
        self.restarted = False
        self.robotURDF = robotURDF
        self.fixedPointFile = fixedPointFile
        self.leftFootLink = leftFootLink
        self.rightFootLink = rightFootLink
        self.pelvisLink = pelvisLink

        self.seedName = 'q_nom'
        self.nominalName = 'q_nom'
        self.infoFunc = None

        self.callbacks = callbacks.CallbackRegistry([self.STARTUP_COMPLETED])
Esempio n. 9
0
    def __init__(self):
        self.timer = TimerCallback(targetFps=10)
        self.timer.callback = self.tick
        self.stop = self.timer.stop
        self.reader = None
        self.initReader()

        self.inputs = {
            'slider': [0, 8, True],
            'dial': [16, 8, True],
            'r_button': [64, 8, False],
            'm_button': [48, 8, False],
            's_button': [32, 8, False],
            'track_left': [58, 1, False],
            'track_right': [59, 1, False],
            'cycle': [46, 1, False],
            'marker_set': [60, 1, False],
            'marker_left': [61, 1, False],
            'marker_right': [62, 1, False],
            'rewind': [43, 1, False],
            'fastforward': [44, 1, False],
            'stop': [42, 1, False],
            'play': [41, 1, False],
            'record': [45, 1, False],
        }

        signalNames = []

        for inputName, inputDescription in self.inputs.iteritems():
            channelStart, numChannels, isContinuous = inputDescription

            for i in xrange(numChannels):

                channelId = '' if numChannels == 1 else '_%d' % i
                if isContinuous:
                    signalNames.append('%s%s_value_changed' %
                                       (inputName, channelId))
                else:
                    signalNames.append('%s%s_pressed' % (inputName, channelId))
                    signalNames.append('%s%s_released' %
                                       (inputName, channelId))

        self.callbacks = callbacks.CallbackRegistry(signalNames)