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

How do send control commands? #9

Open
tasbolat1 opened this issue Sep 23, 2019 · 0 comments
Open

How do send control commands? #9

tasbolat1 opened this issue Sep 23, 2019 · 0 comments

Comments

@tasbolat1
Copy link

tasbolat1 commented Sep 23, 2019

Hey guys,
thanks for the package. It works very nice under ROS kinetic. Now, I have one problem: I cannot send control commands to the server (Motive) to start the data recording. My code is as follows:
`
#!/usr/bin/env python
import rospy, os

import socket
import optirx as rx

from optitrack.utils import get_ip_address, read_parameter

if name == 'main':

# Connect to the optitrack system
rospy.init_node("recorder")
iface = read_parameter('~iface', 'wlp3s0')
version = (2, 10, 0, 0)  # the latest SDK version
optitrack = rx.mkcmdsock(ip_address=get_ip_address(iface), port=1512)
#optitrack = rx.mkcmdsock(ip_address="192.168.0.77", port=5050)

header_b = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>"
start_string = "<CaptureStart><TimeCode VALUE=\"12 13 14 15 0 0 1 1\"/><Name VALUE=\"RemoteTriggerTest_take01\"/><Notes VALUE=""/><Description VALUE=""/><DatabasePath VALUE=\"C:Users\\tracking\\Downloads\"/><PacketID VALUE=\"0\"/><ProcessID VALUE=\"" +str(os.getpid()) +"\"/></CaptureStart>"
print(len(header_b+start_string))
print(optitrack.sendto(header_b+start_string, ("192.168.0.77", 1512)))

print('Successfully connected to optitrack')

`

From the server's side, I can receive the data if I open random server with random port number (checked). But when the data is sent to motive's server, no reaction. Can you guys advise on this?

Best,
Tasbolat

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

1 participant