Compare commits
No commits in common. "91f52f8a0af23625f84c4370bb220e0db8aeabba" and "be16913507ffde5e81e669182522572d8cac6cac" have entirely different histories.
91f52f8a0a
...
be16913507
@ -1,26 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
import rospy
|
|
||||||
from turtlesim.srv import *
|
|
||||||
from geometry_msgs.msg import PoseStamped
|
|
||||||
|
|
||||||
|
|
||||||
def callback(data):
|
|
||||||
teleport_turtle(data.pose.position.x/2+6,data.pose.position.y/2+6,0)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def turtle_follower():
|
|
||||||
rospy.wait_for_service('turtle1/teleport_absolute')
|
|
||||||
rospy.Subscriber("mavros/local_position/pose", PoseStamped, callback)
|
|
||||||
rospy.spin()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
rospy.wait_for_service('turtle1/teleport_absolute')
|
|
||||||
try:
|
|
||||||
teleport_turtle = rospy.ServiceProxy('turtle1/teleport_absolute',TeleportAbsolute)
|
|
||||||
rospy.init_node('turtle_follower',anonymous=True)
|
|
||||||
|
|
||||||
except rospy.ServiceException as e:
|
|
||||||
print("Service call failed: %s"%e)
|
|
||||||
turtle_follower()
|
|
Loading…
Reference in New Issue
Block a user