wiki:AvangoDaemonModule

Module: avango-daemon

The module "avango-daemon" provides the functionality to access input devices.

Implementing the Daemon Side

To initialize the daemon, one or more Station objects with a station name must be created. This Station must then be assigned to a Device object.

dtrack = avango.daemon.DTrack()
dtrack.port = "5000"
dtrack.stations[1] = avango.daemon.Station("ve-dtrack-head1")
dtrack.stations[2] = avango.daemon.Station("ve-dtrack-head2")
dtrack.stations[3] = avango.daemon.Station("ve-dtrack-head3")

vrpn = avango.daemon.VRPNClient()
vrpn.station = avango.daemon.Station('vrpn-client')
vrpn.server = "Tracker0@localhost"
        
wiimote = avango.daemon.Wiimote()
wiimote.station = avango.daemon.Station("wiimote")
wiimote.device = "/dev/input/ve-wiimote"

tablet = avango.daemon.WacomTablet()
tablet.station = avango.daemon.Station("tablet")
tablet.device = "/dev/input/ve-wacom"

avango.daemon.run([dtrack, vrpn, wiimote, tablet])

Implementing the Application Side

The client must create only one DeviceService and assign it to a DeviceSensor or DeviceActuator. The name of the Station must also be assigned to the DeviceSensor or DeviceActuator. This is the name used on the daemon side to create the Station. A DeviceSensor represents the input part of a device, while a DeviceActuator represents the output part.

device_service = avango.daemon.DeviceService()

dtrack_sensor1 = avango.daemon.nodes.DeviceSensor(DeviceService = device_service, Station = "ve-dtrack-head1")
dtrack_sensor2 = avango.daemon.nodes.DeviceSensor(DeviceService = device_service, Station = "ve-dtrack-head2")
dtrack_sensor3 = avango.daemon.nodes.DeviceSensor(DeviceService = device_service, Station = "ve-dtrack-head3")

wiimote_sensor = avango.daemon.nodes.DeviceSensor(DeviceService = device_service, Station = "wiimote")
wiimote_actuator = avango.daemon.nodes.WiimoteActuator(DeviceService = device_service, Station = "wiimote")

tablet_sensor = avango.daemon.nodes.DeviceSensor(DeviceService = vrgeo.device.service, Station = "tablet")