Publishing to action server Attribute Error

I’m trying to publish goal values to an action server via a client.I keep on getting attribute errors. This is the line giving me issues.

agoal = MoveBaseActionGoal()
agoal.goal.target_pose.header.frame_id = 'map'

here is the message format.

std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
actionlib_msgs/GoalID goal_id
  time stamp
  string id
move_base_msgs/MoveBaseGoal goal
  geometry_msgs/PoseStamped target_pose
    std_msgs/Header header
      uint32 seq
      time stamp
      string frame_id
    geometry_msgs/Pose pose
      geometry_msgs/Point position
        float64 x
        float64 y
        float64 z
      geometry_msgs/Quaternion orientation
        float64 x
        float64 y
        float64 z
        float64 w

What am i doing wrong?

I am instantiating the wrong class.
agoal = MoveBaseActionGoal()
should be
agoal = MoveBaseGoal()

3 Likes

I ran in to the same issue. If we publish on the topic, we must use the MoveBaseActionGoal message structure though. I am curious why there are two different messages and more importantly, why sending MoveBaseActionGoal via an action client does not work?

@zdjeffri
It’s so because that’s the way the ROS team has designed it. And they haven’t gotten someone to convince them to change it :wink:.

1 Like