Question: # ! / usr / bin / python 3 import rospy import math import tf 2 _ ros import geometry _ msgs . msg if

#!/usr/bin/python3 import rospy import math import tf2_ros import geometry_msgs.msg
if __name__=='__main__':
rospy.init_node('tf2_look_at_hand')
tfBuffer = tf2_ros.Buffer()
listener = tf2_ros.TransformListener(tfBuffer)
rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
try:
trans = tfBuffer.lookup_transform('Head', 'LFinger23_link', rospy.Time()) except (tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException):
rate.sleep()
continue
print("trans: x: %f y: %f z: %f", trans.transform.translation.x, trans.transform.translation.y, trans.transform.translation.z)
rate.sleep()
Please use the code above to answer the following:
Write a node that uses the head/eyes to gesture toward the hand
Write another node that keeps the head pointed at the hand
Write a final node that look in the direction that the hand is pointing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!