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

# Can I send a goal without quaternion? [closed]

Hello,

I'm pretty new to ROS, but I got a navigation stack working, now I want to send a goal without quaternion i.e. I don't care about the orientation of the robot, if he arrives on the coordinates I sent him to. Rotating the robot is somewhat time intensive and inaccurate. Is there an option to do this?

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Procópio close date 2016-04-28 03:52:35.515157

Sort by » oldest newest most voted

Just answering this question for future inquiries.

You can do so by calculating the angle between the current position of the robot and the goal. Then convert this angle to quaternion and give it to send goal function. This way the robot will reach the goal without additional rotating after it arrives. Here is how:

    angle_to_goal=math.atan2(self.targety-self.currentY,  self.targetx-self.currentX)

q_angle = tf.transformations.quaternion_from_euler(0, 0, angle_to_goal, axes='sxyz')

q = Quaternion(*q_angle)

self.goal = MoveBaseGoal()

self.goal.target_pose.pose = Pose(Point(self.targetx, self.targety, 0.000), q)

self.move_base.send_goal(self.goal)

more

You can create a new msg without quaternion, but you have to chage the code of nodes. Or you can send (0,0,0) (Roll, Pitch, Yaw) that in quaternion is (0,0,0,1)

more

But in this case, you send a specific orientation that the robot will try to reach.

( 2015-07-31 06:21:14 -0500 )edit

It doesn't seem like it's possible to NOT send a specific orientation, my current workaround is to setup the navigation stack with a really high goal yaw tolerance for the local planner. But that seems rather sloppy.

( 2015-07-31 06:46:26 -0500 )edit