コード例 #1
0
ファイル: show_time.py プロジェクト: kuindersma/drake
    def remove_subscriber(self):
        if (self._subscriber is None):
            return

        lcmUtils.removeSubscriber(self._subscriber)
        self._subscriber = None
        vis.updateText('', 'text')
コード例 #2
0
ファイル: footstepsdriver.py プロジェクト: tkoolen/director
    def changeSubscriptionBDI(self, newBDIChannel="POSE_BDI"):
        # used to monitor a different pose e.g. POSE_BODY_LOGGED in playback
        self.bdiChannel = newBDIChannel
        lcmUtils.removeSubscriber ( self.bdiSubcribe )

        self.bdiSubcribe = lcmUtils.addSubscriber( self.bdiChannel , pose_t, self.onPoseBDI)
        self.bdiSubcribe.setSpeedLimit(60)
コード例 #3
0
ファイル: show_time.py プロジェクト: zapplelove/drake
    def remove_subscriber(self):
        if (self._subscriber is None):
            return

        lcmUtils.removeSubscriber(self._subscriber)
        self._subscriber = None
        updateText('', 'Simulation time [s]')
コード例 #4
0
ファイル: show_time.py プロジェクト: ethanweber/atlas-drake
    def remove_subscriber(self):
        if (self._subscriber is None):
            return

        lcmUtils.removeSubscriber(self._subscriber)
        self._subscriber = None
        vis.updateText('', 'text')
コード例 #5
0
ファイル: show_frames.py プロジェクト: DiitsGp/drake
    def _remove_subscriber(self):
        if (self._subscriber is None):
            return

        lcmUtils.removeSubscriber(self._subscriber)
        om.removeFromObjectModel(om.findObjectByName(self._folder_name))
        self._subscriber = None
コード例 #6
0
ファイル: show_frames.py プロジェクト: zhuhaijun753/drake
    def _remove_subscriber(self):
        if (self._subscriber is None):
            return

        lcmUtils.removeSubscriber(self._subscriber)
        om.removeFromObjectModel(om.findObjectByName(self._folder_name))
        self._subscriber = None
コード例 #7
0
    def changeSubscriptionAlt(self, newAltChannel="POSE_BODY_ALT"):
        # used to monitor a different pose e.g. POSE_BODY_LOGGED in playback
        self.altChannel = newAltChannel
        lcmUtils.removeSubscriber ( self.altSubscribe )

        self.altSubscribe = lcmUtils.addSubscriber( self.altChannel , pose_t, self.onPoseAlt)
        self.altSubscribe.setSpeedLimit(60)
    def remove_subscriber(self):
        if self._subs is None:
            return

        for sub in self._subs:
            lcmUtils.removeSubscriber(sub)
        self._subs = None
        print(self._name + " subscribers removed.")
コード例 #9
0
ファイル: contact_viz.py プロジェクト: DiitsGp/drake
    def remove_subscriber(self):
        if self._sub is None:
            return

        lcmUtils.removeSubscriber(self._sub)
        self._sub = None
        om.removeFromObjectModel(om.findObjectByName(self._folder_name))
        print self._name + " subscriber removed."
コード例 #10
0
    def remove_subscriber(self):
        if self._sub is None:
            return

        lcmUtils.removeSubscriber(self._sub)
        self._sub = None
        om.removeFromObjectModel(om.findObjectByName(self._folder_name))
        print(self._name + ' subscriber removed.')
コード例 #11
0
    def removeSubscriber(self):
        if self.subscriber is not None:
            lcmUtils.removeSubscriber(self.subscriber)
            self.subscriber = None

        if self.desc_subscriber is not None:
            lcmUtils.removeSubscriber(self.desc_subscriber)
            self.desc_subscriber = None
コード例 #12
0
ファイル: show_point_cloud.py プロジェクト: thduynguyen/drake
 def _remove_subscriber(self):
     if (self._subscriber is None):
         return
     lcmUtils.removeSubscriber(self._subscriber)
     for child in self._children:
         child.remove_folder()
     self._children.clear()
     self._subscriber = None
     om.removeFromObjectModel(self._get_folder())
コード例 #13
0
ファイル: show_frame.py プロジェクト: zapplelove/drake
 def _remove_subscriber(self):
     if (self._subscriber is None):
         return
     lcmUtils.removeSubscriber(self._subscriber)
     for frame_channel in self._frame_channels:
         frame_channel.remove_folder()
     self._frame_channels.clear()
     self._subscriber = None
     om.removeFromObjectModel(self._get_folder())
コード例 #14
0
ファイル: lcmoctomap.py プロジェクト: tkoolen/director
 def setEnabled(self, enabled):
     if enabled and not self.subscriber:
         #self.subscriber = lcmUtils.addSubscriber('LCMGL.*', callback=self.onMessage)
         self.subscriber = lcmUtils.addSubscriber('OCTOMAP', callback=self.onMessage)
         self.subscriber = lcmUtils.addSubscriber('OCTOMAP_REF', callback=self.onMessage)
         self.subscriber = lcmUtils.addSubscriber('OCTOMAP_IN', callback=self.onMessage)
     elif not enabled and self.subscriber:
         lcmUtils.removeSubscriber(self.subscriber)
         self.subscriber = None
コード例 #15
0
ファイル: show_frame.py プロジェクト: RobotLocomotion/drake
 def _remove_subscriber(self):
     if (self._subscriber is None):
         return
     lcmUtils.removeSubscriber(self._subscriber)
     for frame_channel in self._frame_channels:
         frame_channel.remove_folder()
     self._frame_channels.clear()
     self._subscriber = None
     om.removeFromObjectModel(self._get_folder())
コード例 #16
0
 def setEnabled(self, enabled):
     if enabled and not self.subscriber:
         #self.subscriber = lcmUtils.addSubscriber('LCMGL.*', callback=self.onMessage)
         self.subscriber = lcmUtils.addSubscriber('OCTOMAP', callback=self.onMessage)
         self.subscriber = lcmUtils.addSubscriber('OCTOMAP_REF', callback=self.onMessage)
         self.subscriber = lcmUtils.addSubscriber('OCTOMAP_IN', callback=self.onMessage)
     elif not enabled and self.subscriber:
         lcmUtils.removeSubscriber(self.subscriber)
         self.subscriber = None
コード例 #17
0
 def setEnabled(self, enabled):
     if enabled and not self.subscriber0:
         self.subscriber0 = lcmUtils.addSubscriber('OBJECT_COLLECTION', callback=self.on_obj_collection_data)
         self.subscriber1 = lcmUtils.addSubscriber('LINK_COLLECTION', callback=self.on_link_collection_data)
         self.subscriber2 = lcmUtils.addSubscriber('POINTS_COLLECTION', callback=self.on_points_collection_data)
         self.subscriber3 = lcmUtils.addSubscriber('RESET_COLLECTIONS', callback=self.on_reset_collections_data)
         self.subscriber0.setNotifyAllMessagesEnabled(True)
         self.subscriber1.setNotifyAllMessagesEnabled(True)
         self.subscriber2.setNotifyAllMessagesEnabled(True)
         self.subscriber3.setNotifyAllMessagesEnabled(True)
     elif not enabled and self.subscriber0:
         lcmUtils.removeSubscriber(self.subscriber0)
         lcmUtils.removeSubscriber(self.subscriber1)
         lcmUtils.removeSubscriber(self.subscriber2)
         lcmUtils.removeSubscriber(self.subscriber3)
         self.subscriber0 = None
         self.subscriber1 = None
         self.subscriber2 = None
         self.subscriber3 = None
コード例 #18
0
ファイル: startup.py プロジェクト: openhumanoids/director
 def stop(self):
     for sub in self.subs:
         lcmUtils.removeSubscriber(sub)
コード例 #19
0
 def _removeSubscriber(self):
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None
コード例 #20
0
ファイル: viconvisualizer.py プロジェクト: patmarion/director
 def removeSubscriber(self):
     if not self.subscriber:
         return
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None
コード例 #21
0
 def _removeSubscribers(self):
     for sub in self.subscribers:
         lcmUtils.removeSubscriber(sub)
     self.subscribers = []
コード例 #22
0
ファイル: startup.py プロジェクト: openhumanoids/director
 def __del__(self):
     lcmUtils.removeSubscriber(self.sub)
コード例 #23
0
 def stop(self):
     for sub in self.subs:
         lcmUtils.removeSubscriber(sub)
コード例 #24
0
 def removeLCMUpdater(self):
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None
コード例 #25
0
 def _removeSubscriber(self):
     assert self.subscriber is not None
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None
コード例 #26
0
ファイル: jointcontrol.py プロジェクト: tkoolen/director
 def removeLCMUpdater(self):
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None
コード例 #27
0
 def __del__(self):
     if self.sub:
         lcmUtils.removeSubscriber(self.sub)
コード例 #28
0
 def _removeSubscriber(self):
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None
コード例 #29
0
ファイル: VisualizationGUI.py プロジェクト: nazir-ust/dairlib
    def state_handler(self, msg):
        '''
        Function for handling main lcm channel

        msg: the returning LCM message
        '''
        # start listenning to messages once the JSON file has been read
        if (self.ready == True):
            # TODO (for Michael): bind our more robust decoding mechanisms to python
            self.msg = msg
            self.plant.SetPositions(self.context, self.msg.position)
            self.plant.SetVelocities(self.context, self.msg.velocity)

            # iterate through each shape to draw it
            for name in self.shapes:
                self.handle_checkBox(name)
                currShape = self.shapes[name]

                # define next_loc according to each shape/object to be drawn
                next_loc = None
                if (currShape.category == "kinematic"):
                    # Use Drake's CalcPointsPositions to determine where that point is
                    # in the world
                    pt_world = self.plant.CalcPointsPositions(
                        self.context,
                        self.plant.GetFrameByName(currShape.frame),
                        currShape.point, self.plant.world_frame())
                    next_loc = pt_world.transpose()[0]

                elif (currShape.category == "com"):
                    next_loc = self.plant.CalcCenterOfMassPosition(
                        context=self.context)

                elif (currShape.category == "lcm"):
                    # in the case of an lcm message do not do anything as this is
                    # handled by the abstract handler
                    continue

                self.drawShape(currShape, next_loc, self.msg)

            # handle flags for clearing line histories
            if (self.clear == True):
                for shape in self.shapes.values():
                    if (shape.type == "line"):
                        om.removeFromObjectModel(shape.object)
                        shape.object = None
                        shape.points = deque()
                self.clear = False

            # handle flags for deleting objects
            if (self.delete == True):
                for shape in self.shapes.values():
                    om.removeFromObjectModel(shape.object)

                self.delete = False

                # delete checkboxes from GUI
                for i in reversed(range(self.checkBoxArea.count())):
                    self.checkBoxArea.itemAt(i).widget().deleteLater()

                # delete "reset" and "clear history" buttons
                self.resetBtn.deleteLater()
                self.clearBtn.deleteLater()

                # remove all lcm channels except for the state one
                for subscription in self.subscriptions:
                    lcmUtils.removeSubscriber(subscription)

                self.resetGUI()
コード例 #30
0
 def _removeSubscribers(self):
     for sub in self.subscribers:
         lcmUtils.removeSubscriber(sub)
     self.subscribers = []
コード例 #31
0
 def removeSubscriber(self):
     if not self.subscriber:
         return
     lcmUtils.removeSubscriber(self.subscriber)
     self.subscriber = None