|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.robotics.Pose
public class Pose
Represents the location and heading(direction angle) of a robot.
This class includes methods for updating the Pose to track common robot movements
| Field Summary | |
|---|---|
protected float |
_heading
|
protected Point |
_location
|
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
float |
angleTo(Point destination)
Calculates the absolute angle to destination from the current location of the pose |
void |
arcUpdate(float distance,
float turnAngle)
Sets the pose locatin and heading to the currect values resulting from travel in a circular arc. |
float |
distanceTo(Point destination)
Get the distance to the destination |
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 |
moveUpdate(float distance)
Move the specified distance in the direction of current heading. |
void |
rotateUpdate(float angle)
Rotate the heading through the specified angle |
void |
setHeading(float heading)
|
void |
setLocation(Point p)
Set the location of the pose |
void |
translate(float dx,
float dy)
Change the x and y coordinates of the pose by adding dx and dy. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Point _location
protected float _heading
| Constructor Detail |
|---|
public Pose()
public Pose(float x,
float y,
float heading)
x - the X coordinatey - the Y coordinateheading - the heading| Method Detail |
|---|
public void rotateUpdate(float angle)
angle - public void moveUpdate(float distance)
distance - to move
public void translate(float dx,
float dy)
dx - change in x coordinatedy - change in y coordinate
public void arcUpdate(float distance,
float turnAngle)
distance - the dtistance traveledturnAngle - the angle turnedpublic float angleTo(Point destination)
destination -
public float distanceTo(Point destination)
destination -
public float getHeading()
public float getX()
public float getY()
public Point getLocation()
public void setLocation(Point p)
p - the new locationpublic void setHeading(float heading)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||