ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The Path
message is not an array. You should use rosmsg to see the format of the message:
rosmsg info nav_msgs/Path
If your message variable is named Path, you need use code like this:
n = len(Path.poses)
x = Path.poses[i].pose.position.x
Another problem this code has is that it makes no sense to read only 1 field of the orientation. w
is meaningless on its own.