vrpn: Bindings to VRPN.

[ library, mit, network, program ] [ Propose Tags ] [ Report a vulnerability ]

See <https://github.com/vrpn/vrpn/wiki> for information on VRPN. This has been tested using VRPN 07.30 on Linux.

If the VRPN libraries are static and this package is used from Template Haskell, then the package needs to be configured with the QuatStatic flag.


[Skip to Readme]

Modules

  • Network
    • Network.VRPN

Flags

Automatic Flags
NameDescriptionDefault
quatstatic

Explicitly link with static library libquat.a, which is required when using this package with Template Haskell.

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.2.0.0, 0.2.1.0, 0.2.1.3, 0.2.1.4, 0.3.0.0
Dependencies base (>=4.8 && <5) [details]
License MIT
Copyright (c) 2015-19 Brian W Bush
Author Brian W Bush <code@functionally.io>
Maintainer Brian W Bush <code@functionally.io>
Category Network
Home page https://bitbucket.org/functionally/vrpn
Bug tracker https://bwbush.atlassian.net/projects/HVRPN/issues/
Source repo head: git clone https://bitbucket.org/functionally/vrpn.git
Uploaded by BrianBush at 2019-02-20T14:30:23Z
Distributions NixOS:0.3.0.0
Reverse Dependencies 1 direct, 1 indirect [details]
Executables test-vrpn
Downloads 3121 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2019-02-20 [all 3 reports]

Readme for vrpn-0.3.0.0

[back to package description]

Bindings for VRPN

This package contains bindings to VRPN, <https://github.com/vrpn/vrpn/wiki> and is loosely modeled on the code in <https://github.com/vrpn/vrpn/blob/master/client_src/vrpn_print_devices.C>. This has been tested using VRPN 07.30 on Linux. It requires the VRPN C++ header files.

Please report issues at <https://bwbush.atlassian.net/projects/HVRPN/issues/>.

Skeletal example illustrating the use of VRPN bindings

data ButtonType = LeftButton | RightButton
  deriving (Enum, Eq, Show)

main :: IO ()
main =
  do
    putStrLn "Press the left button to exit."
    done <- newEmptyMVar
    let
      -- A remote button that signals completion when the left button is released.
      button :: Device Int ButtonType Double
      button =
        Button "spacenav0@localhost"
          $ Just
          $ \time button state ->
            do
              print (time, button, state)
              if button == LeftButton && not state
                then void $ tryPutMVar done ()
                else return ()
      -- An analog device.
      analog :: Device Int Int Int Double
      analog = Analog "spacenav0@localhost"
        $ Just
        $ curry print
    -- Open the remote devices.
    devices <- sequence [openDevice button, openDevice analog]
    -- Loop until a signal to complete is received.
    mainLoops (not <$> isEmptyMVar done) 10 devices
    -- Close the remote devices.
    mapM_ closeDevice devices