vrpn

package
v0.0.0-...-8718ff9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2015 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package vrpn provides a wrapper around a simple vrpn server.

All types in this package wrap around the required vrpn_wrapper.dll. It is important to know that objects are created in the C++ side, and will not be automatically garbage collected, even if the go objects are.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analog

type Analog struct {
	// contains filtered or unexported fields
}

Analog is an analog device on the vrpn server.

func (*Analog) Mainloop

func (a *Analog) Mainloop()

Mainloop must be called after providing an update to the device and before the connection's mainloop is called.

func (*Analog) Update

func (a *Analog) Update(data []float64)

Updates the values on the analog device. If there are fewer values in the slice than channels, only the lower channels are updated; extra channels are ignored.

type Button

type Button struct {
	// contains filtered or unexported fields
}

Button is an button device on the vrpn server.

func (*Button) Mainloop

func (b *Button) Mainloop()

Mainloop must be called after providing an update to the device and before the connection's mainloop is called.

func (*Button) Update

func (b *Button) Update(data []bool)

Updates the values on the button device. If there are fewer values in the slice than channels, only the lower channels are updated; extra channels are ignored.

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection represents a vrpn server.

func NewConnection

func NewConnection(port int) *Connection

Creates a new vrpn server at the given port number.

func (*Connection) Mainloop

func (c *Connection) Mainloop()

Mainloop must be called each loop after each device's main loop in order to ensure that vrpn does all it's nessisary transmissions and bookkeeping.

func (*Connection) NewAnalog

func (c *Connection) NewAnalog(name string, channels int) *Analog

Creates a new analog device with the given device name, and the number of channels which the device transmits.

func (*Connection) NewButton

func (c *Connection) NewButton(name string, channels int) *Button

Creates a new button device with the given device name, and the number of channels which the device transmits.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL