ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You need to loop through each adjacent pair of Poses in the path message. You can find the structure of this message described here.

for i in range(len(path_msg.poses) - 1):

  # get two geometry_msgs/Point messages of adjacent points
  position_a = path_msg.poses[i].pose.position
  position_b = path_msg.poses[i+1].pose.position

  # calcualte sum of distances here. . .

Hope this helps.