I would like to realize the following task:
- Using fiducial_follow.launch, I would like magni robot to follow me.
- Save the trajectory of motion
- Execute the saved trajectory alone
Regarding the task mentioned above I mount the camera forward. I’ve started fiducial_follow.launch application for testing. The magni robot follows me quit well. It’s a little bit difficult after turning on the right or on the left direction. I have to be more careful.
For saving the trajectory of motion I have to save the consecutive positions of the robot during the movement. Therefore I created the following application for testing. It simply reads the new positions of the robot:
from nav_msgs.msg import Odometry
x = pose_message.pose.pose.position.x
y = pose_message.pose.pose.position.y
global x, y
while not rospy.is_shutdown():
print 'X, Y: ', x, y
if name == ‘main’:
rospy.init_node('follow', anonymous=True) position_topic = '/odom' pose_subscriber = rospy.Subscriber(position_topic, Odometry, poseCallback) time.sleep(2) pose_subscribe() rospy.spin()
After testing I saw that the visualization of the new positions along X and Y axes is very slow. My goal is during the follow me procedure, the new positions to be saved fast and correct. How to improve this task? Could you please advise me!