def remove_subscriber(self): if (self._subscriber is None): return lcmUtils.removeSubscriber(self._subscriber) self._subscriber = None vis.updateText('', 'text')
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)
def remove_subscriber(self): if (self._subscriber is None): return lcmUtils.removeSubscriber(self._subscriber) self._subscriber = None updateText('', 'Simulation time [s]')
def _remove_subscriber(self): if (self._subscriber is None): return lcmUtils.removeSubscriber(self._subscriber) om.removeFromObjectModel(om.findObjectByName(self._folder_name)) self._subscriber = None
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.")
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."
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.')
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
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())
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())
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
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
def stop(self): for sub in self.subs: lcmUtils.removeSubscriber(sub)
def _removeSubscriber(self): lcmUtils.removeSubscriber(self.subscriber) self.subscriber = None
def removeSubscriber(self): if not self.subscriber: return lcmUtils.removeSubscriber(self.subscriber) self.subscriber = None
def _removeSubscribers(self): for sub in self.subscribers: lcmUtils.removeSubscriber(sub) self.subscribers = []
def __del__(self): lcmUtils.removeSubscriber(self.sub)
def removeLCMUpdater(self): lcmUtils.removeSubscriber(self.subscriber) self.subscriber = None
def _removeSubscriber(self): assert self.subscriber is not None lcmUtils.removeSubscriber(self.subscriber) self.subscriber = None
def __del__(self): if self.sub: lcmUtils.removeSubscriber(self.sub)
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()