def __init__(self, config, eventHub, vehicle): self._name = config['name'] SimDevice.__init__(self) device.IDepthSensor.__init__(self, eventHub, self._name) simDevice = vehicle.getDevice('SimulationDevice') self.robot = simDevice.robot
def __init__(self, config, eventHub, vehicle): self._name = config['name'] simDevice = vehicle.getDevice('SimulationDevice') SimPayloadSet.__init__(self, eventHub, self._name, count = 2, scene = simDevice.scene, robot = simDevice.robot, payload = 'grabber')
def __init__(self, config, eventHub, vehicle): self._name = config['name'] SimDevice.__init__(self) device.IThruster.__init__(self, eventHub, self._name) simDevice = vehicle.getDevice('SimulationDevice') robot = simDevice.robot self._simThruster = getattr(robot.parts, config['simName']) self._enabled = True
def __init__(self, config, eventHub, vehicle): self._name = config['name'] SimDevice.__init__(self) device.IPositionSensor.__init__(self, eventHub, self._name) simDevice = vehicle.getDevice('SimulationDevice') self.robot = simDevice.robot self.initialPos = math.Vector2(self.robot._main_part._node.position.x, -self.robot._main_part._node.position.y)
def __init__(self, config, eventHub, vehicle): self._name = config['name'] SimDevice.__init__(self) device.IVelocitySensor.__init__(self, eventHub, self._name) simDevice = vehicle.getDevice('SimulationDevice') self.robot = simDevice.robot # This will keep track of the current velocity self.oldPos = math.Vector2(self.robot._main_part._node.position.x, -self.robot._main_part._node.position.y) self.velocity = math.Vector2(0, 0)
def __init__(self, config, deps): ext.core.Subsystem.__init__(self, config.get('name', 'Simulation'), deps) # Grab the vehicle sim = ext.core.Subsystem.getSubsystemOfType(Simulation, deps, nonNone = True) vehicle = ext.core.Subsystem.getSubsystemOfType(IVehicle, deps, nonNone = True) self._robot = vehicle.getDevice('SimulationDevice').robot # Grab the pinger object self._pingers = sim.scene.getObjectsByInterface(IPinger) assert len(self._pingers) <= 2 self._setup()
def __init__(self, config, eventHub, vehicle): self._name = config['name'] SimDevice.__init__(self) device.IDevice.__init__(self, eventHub, self._name) simDevice = vehicle.getDevice('SimulationDevice') self.robot = simDevice.robot self._scene = simDevice.scene # Settings self._dropMarkers = config.get('markers', True) self._markerInterval = config.get('markerInterval', 1) # State variables self._markers = [] self._markerCount = 0 self._timeSinceLastMarker = self._markerInterval
def __init__(self, config, deps): ext.core.Subsystem.__init__(self, config.get('name', 'Simulation'), deps) # Grab the vehicle sim = ext.core.Subsystem.getSubsystemOfType(Simulation, deps, nonNone=True) vehicle = ext.core.Subsystem.getSubsystemOfType(IVehicle, deps, nonNone=True) self._robot = vehicle.getDevice('SimulationDevice').robot # Grab the pinger object self._pingers = sim.scene.getObjectsByInterface(IPinger) assert len(self._pingers) <= 2 self._setup()
def _lookupByName(self, publisher, deps): # Subscribe to the queued event hub if no publisher is specified if publisher is None: return self._qeventHub # If the publisher is a device, different operations are performed if publisher.startswith("Vehicle.Device."): deviceName = publisher[len("Vehicle.Device.") :] vehicle = core.Subsystem.getSubsystemOfType(ext.vehicle.IVehicle, deps) device = vehicle.getDevice(deviceName) return device else: # Normal operations for any other publisher systemName = publisher.split(".")[0] for d in deps: depName = d.getPublisherName().split(".")[-1] if depName == systemName: return d
def _lookupByName(self, publisher, deps): # Subscribe to the queued event hub if no publisher is specified if publisher is None: return self._qeventHub # If the publisher is a device, different operations are performed if publisher.startswith('Vehicle.Device.'): deviceName = publisher[len('Vehicle.Device.'):] vehicle = core.Subsystem.getSubsystemOfType( ext.vehicle.IVehicle, deps) device = vehicle.getDevice(deviceName) return device else: # Normal operations for any other publisher systemName = publisher.split('.')[0] for d in deps: depName = d.getPublisherName().split('.')[-1] if depName == systemName: return d