Recent Changes - Search:

edit SideBar

ROS /

ScarabsPoseDatatype

Introduction

Scarab publishes its current position and subscribes to waypoints formatted according to the ROS geometry_msgs/Pose datatype. This is of the form:

{
    position:
      {x: .., y:.., z:..}
    orientation:
      {w:.., x:.., y:.., z..}
}

Any pose data you send to the /goal topic, must be formatted according as above. The HFN package in the Scarab will then interpret it as documented below.

Position

There are Cartesian x, y, z coordinates. z should always be set to 0, since Scarab is just a humble ground robot.

Orientation

This is in quaternion form. A quaternion takes a rotation axis in a unit vector form, vx, vy, vz, a rotation angle, theta, and represents it as:
(w, x, y, z) = (cos(0.5*theta), vx'sin(0.5'theta), vy'sin(0.5'theta), vz*sin(0.5theta))

Note that (vx, vy, vz) must be a unit vector.

Since Scarab is just a humble ground robot, its orientation vector always has x and y set to 0.

This means its rotation axis, in cartesian form, is
(vx, vy, vz) = (0, 0, 1).

When publishing an orientation to Scarab, if you want it to face an angle theta from the x-axis just set the quartenion orientation to:
(w, x, y, z) = (cos(0.5*theta), 0, 0, sin(0.5*theta)

These are a few examples, with theta being desired rotation from x-axis in radians, and (w, x, y, z) being the quartenion orientation:

theta0pi/6pi/4pi/3pi/2pi
w10.970.920.870.710
x000000
y000000
z00.260.380.50.711

If you publish the a quaternion orientation of:
(w, x, y, z) = (0.707, 0, 0, 1),
this is faulty data because you are setting the rotation angle:
theta = pi/2,
and the rotational unit vector to:
(vx, vy, vz) = (0, 0, 0, 1/0.707).
This does not make a unit vector.

Scarab will ignore the w expression, assume vz= 1, and derive the angle theta from the z expression:
sin(0.5*theta) = 1\\ theta = pi
Thus it will interpret the faulty data as:
(w, x, y, z) = (0, 0, 0, 1),

See Also

Edit - History - Print - Recent Changes - Search
Page last modified on April 13, 2017, at 03:38 PM