public class Pose extends java.lang.Object implements Transmittable
Modifier and Type | Field and Description |
---|---|
protected float |
_heading |
protected Point |
_location |
protected static java.lang.String |
format |
Constructor and Description |
---|
Pose()
allocate a new Pose at the origin, heading = 0:the direction the positive X axis
|
Pose(float x,
float y,
float heading)
Allocate a new pose at location (x,y) with specified heading in degrees.
|
Modifier and Type | Method and Description |
---|---|
float |
angleTo(Point destination)
Returns the angle with respect to the X axis to |
void |
arcUpdate(float distance,
float turnAngle)
Sets the pose location and heading to the correct values resulting from travel
in a circular arc.
|
float |
distanceTo(Point destination)
Return the distance to the destination
|
void |
dumpObject(java.io.DataOutputStream dos) |
float |
getHeading()
returns the heading (direction angle) of the Pose
|
Point |
getLocation()
Get the location as a Point
|
float |
getX()
Get the X coordinate
|
float |
getY()
Get the Y coordinate
|
void |
loadObject(java.io.DataInputStream dis) |
void |
moveUpdate(float distance)
Move the specified distance in the direction of current heading.
|
Point |
pointAt(float distance,
float bearing)
Returns the point at
distance from the location of this pose,
in the direction bearing relative to the X axis. |
float |
relativeBearing(Point destination)
Returns the angle to
destination relative to the pose heading; |
void |
rotateUpdate(float angle)
Rotate the heading through the specified angle
|
void |
setHeading(float heading) |
void |
setLocation(float x,
float y)
Sets the location of this pose to a new point at x,y;
|
void |
setLocation(Point p)
Set the location of the pose
|
java.lang.String |
toString()
return string contains x,y and heading
|
void |
translate(float dx,
float dy)
Change the x and y coordinates of the pose by adding dx and dy.
|
protected Point _location
protected float _heading
protected static java.lang.String format
public Pose()
public Pose(float x, float y, float heading)
x
- the X coordinatey
- the Y coordinateheading
- the headingpublic void rotateUpdate(float angle)
angle
- public void moveUpdate(float distance)
distance
- to movepublic void translate(float dx, float dy)
dx
- change in x coordinatedy
- change in y coordinatepublic void arcUpdate(float distance, float turnAngle)
distance
- the distance traveledturnAngle
- the angle turnedpublic float angleTo(Point destination)
destination
- public float relativeBearing(Point destination)
destination
relative to the pose heading;destination
- the target pointpublic float distanceTo(Point destination)
destination
- public Point pointAt(float distance, float bearing)
distance
from the location of this pose,
in the direction bearing
relative to the X axis.distance
- the distance to the pointbearing
- the true bearing of the pointpublic float getHeading()
public float getX()
public float getY()
public Point getLocation()
public void setLocation(Point p)
p
- the new locationpublic void setLocation(float x, float y)
x
- y
- public void setHeading(float heading)
public java.lang.String toString()
toString
in class java.lang.Object
public void dumpObject(java.io.DataOutputStream dos) throws java.io.IOException
dumpObject
in interface Transmittable
java.io.IOException
public void loadObject(java.io.DataInputStream dis) throws java.io.IOException
loadObject
in interface Transmittable
java.io.IOException