Exemplo n.º 1
0
 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        
Exemplo n.º 2
0
 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        
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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')
Exemplo n.º 5
0
    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
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
    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)
Exemplo n.º 8
0
    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)
Exemplo n.º 9
0
    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)
Exemplo n.º 10
0
    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)
Exemplo n.º 11
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()
Exemplo n.º 12
0
    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
Exemplo n.º 13
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()
Exemplo n.º 14
0
    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
Exemplo n.º 15
0
    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
Exemplo n.º 16
0
    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