Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Remote Requests/Commands #2

Open
Gnarlywhale opened this issue Mar 13, 2018 · 2 comments
Open

Remote Remote Requests/Commands #2

Gnarlywhale opened this issue Mar 13, 2018 · 2 comments

Comments

@Gnarlywhale
Copy link

I've poked around the code a bit and there doesn't seem to be an implementation of sending remote requests/commands as listed on the natnet docs (c# example):
https://v20.wiki.optitrack.com/index.php?title=NatNet:_Remote_Requests/Commands#ErrorCode

Is this at all possible?

If not I'm happy to get started implementing it if you could point me in the right direction on where to get started making changes.

@mje-nz
Copy link
Owner

mje-nz commented Mar 13, 2018

Hey, thanks for the request. I haven't implemented those as I've never needed them, but it shouldn't be too tricky.

First, get set up with some other application that allows you to send them (e.g. probably WinFormsSample from the NatNet SDK), capture some network traffic with Wireshark or similar, find the request packet and the response packet (they should start with 0x02 0x00 and 0x03 0x00), and dump them to files (as I have for each packet type in test_data/).

Then you can implement a RequestMessage and ResponseMessage class in the protocol module (like the other message classes), using your dumped packets as test data for unit testing.

At that point you should be able to test your code against Motive by sending a command with Connection.send_message and blocking until you get a response with Connection.wait_for_message_with_id.

From there it would just be a matter of adding a send_command method to Client and a handling responses in Client.run_once.

Out of interest, what do you want to use requests or commmands for?

@Gnarlywhale
Copy link
Author

Thanks for the pointers, hopefully I'll have some time in the next couple of weeks to get started with a proper implementation.

I'm currently running motive along side an eye tracking system and lab streaming layer for synchronization. I wrote a basic python tool to control each system simultaneously, rather than having to manually trigger and update everything (start/stop recording, update save names, etc). Up to now I was able to get by with hijacking control of the GUIs themselves using pywinauto, but it wasn't worth it to update this method to working with motive 2.0 (we were using 1.9 previously and the UI changed a lot), and we'll soon be adding in more data streams, so I figured I'd do it properly this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants