problem when publishing to /move_base/goal
When i run the following python code the robot will not move:
publisher = rospy.Publisher('/move_base/goal', MoveBaseActionGoal, queue_size=1,latch=True)
move_base_goal = MoveBaseGoal()
move_base_goal.target_pose.pose.position.x = 0.7
move_base_goal.target_pose.pose.orientation.w =1.0
move_base_goal.target_pose.header.frame_id = '/map'
goal = MoveBaseActionGoal()
goal.goal = move_base_goal
publisher.publish(goal)
But publishing directly to the topic from cmd is working
rostopic pub /move_base/goal move_base_msgs/MoveBaseActionGoal "header:
seq: 2
stamp:
secs: 5727
nsecs: 677000000
frame_id: ''
goal_id:
stamp:
secs: 0
nsecs: 0
id: ''
goal:
target_pose:
header:
seq: 2
stamp:
secs: 5727
nsecs: 677000000
frame_id: "map"
pose:
position:
x: 1.73762495518
y: -0.54209536314
z: 0.0
w: 1.0ion:
Can somone explain what i am doing wrong?
Can i see your full code please
@hiep127 please don't post a comment as an answer