Question about one sentence
I got this sentence from the ros tutorial. It's located at helloworld\follow_the_route.py line 43:
# Navigation
rospy.loginfo("Go to %s pose", name[:-4])
success = navigator.goto(obj['position'], obj['quaternion'])
if not success:
rospy.loginfo("Failed to reach %s pose", name[:-4])
continue
rospy.loginfo("Reached %s pose", name[:-4])
I can't understand the sentence,
rospy.loginfo("Go to %s pose", name[:-4])
What is name[:-4]
?
I think name is enough to represent a string. what is [:-4]
? What is the syntax here?