-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathroport_optitrack_client.py
More file actions
executable file
·36 lines (28 loc) · 959 Bytes
/
roport_optitrack_client.py
File metadata and controls
executable file
·36 lines (28 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python
import rospy
from rotools.optitrack.linux.client import OptiTrackClient
from rotools.utility.common import (
get_param,
pretty_print_configs,
is_ip_valid,
is_port_valid,
)
if __name__ == "__main__":
try:
rospy.init_node("roport_optitrack_client", anonymous=True)
configs = {
"ip": get_param("ip"),
"port": get_param("port"),
"odom_topic": get_param("odom_topic"),
"pose_topic": get_param("pose_topic"),
"rate": get_param("rate", 100.0),
"transform": get_param("base_to_markers_transform"),
}
if not is_ip_valid(configs["ip"]) or not is_port_valid(configs["port"]):
exit(-1)
pretty_print_configs(configs)
client = OptiTrackClient(configs)
rospy.loginfo("RoPort OptiTrack Client ready.")
rospy.spin()
except rospy.ROSInterruptException as e:
print(e)