Skip to content

How do send control commands? #9

@tasbolat1

Description

@tasbolat1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions