-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_pose_handler.py
More file actions
executable file
·41 lines (31 loc) · 1004 Bytes
/
test_pose_handler.py
File metadata and controls
executable file
·41 lines (31 loc) · 1004 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
37
38
39
40
41
#!/usr/bin/env python
"""Test displaying the robot's current pose.
Before using this, run:
roslaunch subtle_launch static-sim.launch
roslaunch controller run.launch
"""
import time
import threading
import sys
import rospy
from controller_handlers.pose import poseHandler
def display_pose(pose_handler):
"""Print the current pose periodically."""
print "",
while not rospy.is_shutdown():
pose = pose_handler.getPose()
location = pose_handler.get_location()
print "\rLocation: {}, Pose: {}".format(location, pose),
sys.stdout.flush()
time.sleep(1.0)
def main():
"""Get rooms from the user and send the robot there."""
print "Initializing pose handler..."
pose_handler = poseHandler(None, None, True)
# Sleep to make sure the node has settled
time.sleep(3.0)
# Kick off display thread and spin
threading.Thread(target=display_pose, args=(pose_handler,)).start()
rospy.spin()
if __name__ == "__main__":
main()