Giter VIP home page Giter VIP logo

python_natnet's People

Contributors

mje-nz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python_natnet's Issues

Disabling debug statements?

How do you disable the printed debug statements? I'm getting a server echo print statement every second or so that would be great to turn off.

And how does one disable the printed server evaluation at the beginning if you don't want to see the printout?

Thanks!

multicast assertion

Hello, running the code I get the following error:

  File "/usr/local/lib/python3.5/dist-packages/natnet-0.1.0-py3.5.egg/natnet/comms.py", line 399, in _simple_connect
    assert server_info.connection_info.multicast
AssertionError

Is that assertion necessary ? Motive allows to broadcast data in either multicast or unicast mode.
For example, multicast messages are not allowed within my company and thus filtered by the router. I would thus need to use unicast communication.

Thank you

How to run these example?

Hello, I am very interested in this project, but how to run these examples?According to your instructions, I'm failed.

OSError: [Errno 22] Invalid argument

I am getting an OSError when running the example. It evidently can see the server, but can't open the socket?

python3 natnet-client-demo.py --server 192.168.0.100
Connecting to 192.168.0.100
Getting server info
Server application: Motive
Server version: Version(major=2, minor=2, build=0, revision=0)
Traceback (most recent call last):
  File "natnet-client-demo.py", line 97, in <module>
    main()
  File "natnet-client-demo.py", line 90, in main
    app = ClientApp.connect('fake' if args.fake else args.server, args.rate, args.quiet)
  File "natnet-client-demo.py", line 35, in connect
    client = natnet.Client.connect(server_name)
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 418, in connect
    return cls._simple_connect(server, logger, timeout)
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 401, in _simple_connect
    return cls._setup_client(conn, server_info, logger)
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 344, in _setup_client
    conn.bind_data_socket(server_info.connection_info.multicast_address,
  File "/home/swarmtestbed/lvctestbed/ros2_ws/src/python_natnet/src/natnet/comms.py", line 60, in bind_data_socket
    self._data_socket.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
OSError: [Errno 22] Invalid argument

Motive 2.2.0 Support

Hi, unfortunately I am having issues using this library with the newer Motive Tracker Software (2.2.0).
The connection can be established without issue but a new model_type cannot be handled by this library:

Getting data descriptions
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\protocol\ModelDefinitionsMessage.py", line 60, in deserialize
    impl = self._implementation_types[model_type]
KeyError: 5

resulting in a ValueError: Unknown model definition type.

I do notice that this library appears to be unmaintained, but as this is so much easier to use I really hope this can be easily fixed, maybe even by myself.

Any input on this would be highly appreciated!

The full log is pasted below:

Connecting to 10.100.25.27
Getting server info
Server application: Motive
Server version: Version(major=2, minor=2, build=0, revision=0)
Synchronizing clocks
First echo: RTT 1.43ms, server time 742.2
Echo     6: RTT 1.02ms (min 1.00ms), server time 742.2s, dt  0.012s, correction  0.259ms, drift  21.993ms/s, new skew:  0.000ms/s
Echo    50: RTT 1.07ms (min 1.00ms), server time 742.3s, dt  0.067s, correction  0.078ms, drift   1.166ms/s, new skew:  0.000ms/s
Echo    76: RTT 1.00ms (min 1.00ms), server time 742.3s, dt  0.042s, correction -0.113ms, drift  -2.726ms/s, new skew:  0.000ms/s
Getting data descriptions
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\protocol\ModelDefinitionsMessage.py", line 60, in deserialize
    impl = self._implementation_types[model_type]
KeyError: 5

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\user\Documents\Python Scripts\optitrack\main.py", line 27, in <module>
    client = natnet.Client.connect(server_name)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\comms.py", line 418, in connect   
    return cls._simple_connect(server, logger, timeout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\comms.py", line 401, in _simple_connect
    return cls._setup_client(conn, server_info, logger)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\comms.py", line 354, in _setup_client
    model_definitions_message, _ = conn.wait_for_message_with_id(protocol.MessageId.ModelDef)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\comms.py", line 155, in wait_for_message_with_id
    return protocol.deserialize_payload(message_id, payload), received_time
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\protocol\common.py", line 271, in 
deserialize_payload
    return _registry.deserialize_payload(*args, **kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\protocol\common.py", line 221, in 
deserialize_payload
    message = message_type.deserialize(payload_data, version)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\protocol\ModelDefinitionsMessage.py", line 231, in deserialize
    models.append(_registry.deserialize(data, version))
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\natnet-0.1.0-py3.10.egg\natnet\protocol\ModelDefinitionsMessage.py", line 62, in deserialize
    raise ValueError('Unknown model definition type {}'.format(model_type))
ValueError: Unknown model definition type ```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.