# Publishing to action server Attribute Error

**URL:** <https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387>\
**Category:** ROS Navigation In 5 Days\
**Tags:** error, rospy, howto\
**Created:** [January 6, 2021, 8:41pm UTC](https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387 "2021-01-06T20:41:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryleymcc](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ryleymcc](https://get-help.theconstruct.ai/u/ryleymcc)\
**Post date:** [January 6, 2021, 8:41pm UTC](https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387/1 "2021-01-06T20:41:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ryleymcc](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/r/35a633/32.png) [@ryleymcc](https://get-help.theconstruct.ai/u/ryleymcc)\
**Post date:** [January 6, 2021, 9:27pm UTC](https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387/2 "2021-01-06T21:27:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zdjeffri](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/zdjeffri/32/2352_2.png) [@zdjeffri](https://get-help.theconstruct.ai/u/zdjeffri)\
**Post date:** [March 24, 2021, 6:28pm UTC](https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387/3 "2021-03-24T18:28:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/6966_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [March 25, 2021, 9:47am UTC](https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387/4 "2021-03-25T09:47:05Z")

</div>

@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 😉.

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/6966_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [March 29, 2021, 9:13am UTC](https://get-help.theconstruct.ai/t/publishing-to-action-server-attribute-error/7387/5 "2021-03-29T09:13:23Z")

</div>


