ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you are sure of the quaternion values. You can simply publish using geometry_msgs/PoseStamped. Sample:
publisher = nh.advertise<move_base_msgs::MoveBaseActionGoal>("move_base/goal", 5);
geometry_msgs::PoseStamped GoalPose;
move_base_msgs::MoveBaseActionGoal Goal_Pose;
GoalPose.pose.position.x = <current pose x>;
GoalPose.pose.position.y = <current pose y>;
GoalPose.pose.position.z = <current pose z>;
GoalPose.pose.orientation.x = <desired orientation x>;
GoalPose.pose.orientation.y = <desired orientation y>;
GoalPose.pose.orientation.z = <desired orientation z>;
GoalPose.pose.orientation.w = <desired orientation w>;
Goal_Pose.header.seq = GoalPose.header.seq = 1;
GoalPose.header.stamp = 1;
Goal_Pose.header.frame_id = GoalPose.header.frame_id = "/map";
Goal_Pose.goal.target_pose = GoalPose;
publisher.publish(Goal_Pose);
I used the above on a TurtleBot and it worked perfectly!