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

Revision history [back]

click to hide/show revision 1
initial version
sqrt(pow((goal_pose.position.x - self.pose.pose[1].position.x), 2) + AttributeError: 'Pose' object has no attribute 'pose'

That is the error. pose has position as attribute, but not pose. Where did you get this line from? It is not in the example. The corresponding lie from example is

return sqrt(pow((goal_pose.x - self.pose.x), 2) +
                    pow((goal_pose.y - self.pose.y), 2))

where they make reference to a second level of pose.

Looking at definition of pose messages on http://docs.ros.org/api/geometry_msgs/html/msg/Pose.html you'll see only position and orientation in a pose.

A representation of pose in free space, composed of position and orientation. 
Point position
Quaternion orientation

sqrt(pow((goal_pose.position.x - self.pose.pose[1].position.x), 2) + AttributeError: 'Pose' object has no attribute 'pose'

'pose'

That is the error. pose has position as attribute, but not pose. Where did you get this line from? It is not in the example. The corresponding lie from example is

return sqrt(pow((goal_pose.x - self.pose.x), 2) +
                    pow((goal_pose.y - self.pose.y), 2))

where they do not make reference to a second level of pose.

Looking at definition of pose messages on http://docs.ros.org/api/geometry_msgs/html/msg/Pose.html you'll see only position and orientation in a pose.

A representation of pose in free space, composed of position and orientation. 
Point position
Quaternion orientation