|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object device.Device device.RobotDevice device.Position2d
public class Position2d
2D Position device of a robot.
Field Summary | |
---|---|
(package private) boolean |
isNewSpeed
|
(package private) Position |
pos
|
(package private) Position |
setOdometry
|
(package private) double |
speed
|
(package private) double |
turnrate
|
Fields inherited from class device.RobotDevice |
---|
device, deviceNode, logger |
Fields inherited from class device.Device |
---|
deviceList, host, id, index, isRunning, isThreaded, port, sleeptime, thread |
Constructor Summary | |
---|---|
Position2d(DeviceNode roboClient,
Device device)
Creates a Position2d object. |
Method Summary | |
---|---|
void |
disableMotor()
Disable the robots motors. |
void |
enableMotor()
Enable the robots motors. |
Position |
getPosition()
|
double |
getSpeed()
|
double |
getTurnrate()
|
void |
setPosition(Position pos)
|
void |
setSpeed(double speed)
Sets the motors planar speed. |
(package private) void |
setSpeed(double newSpeed,
double newTurnrate)
Sets the speed and turnrate immediately. |
void |
setTurnrate(double turnrate)
Sets the motors turnrate. |
void |
syncSpeed()
Forces to command the motors immediately. |
protected void |
update()
Updates the position device's settings at ~10 Hz Is only called by the run() method! |
Methods inherited from class device.RobotDevice |
---|
getDevice, getDeviceNode, getLogger, toString |
Methods inherited from class device.Device |
---|
equals, getDevice, getDeviceIterator, getDeviceList, getDeviceListArray, getHost, getId, getIndex, getPort, getSleepTime, getThreadName, isInList, isRunning, isSupported, isThreaded, matches, matchesList, run, runThreaded, setDeviceList, setHost, setName, setPort, setSleepTime, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Position pos
double speed
double turnrate
Position setOdometry
boolean isNewSpeed
Constructor Detail |
---|
public Position2d(DeviceNode roboClient, Device device)
roboClient
- The @see DeviceNode this device belongs to.device
- This device's information.Method Detail |
---|
protected void update()
update
in class Device
public Position getPosition()
public void setPosition(Position pos)
pos
- New robot @see Position for odometry device.public double getSpeed()
public void setSpeed(double speed)
speed
- New robot speed (m/s).void setSpeed(double newSpeed, double newTurnrate)
newSpeed
- The new speed.newTurnrate
- The new turnrate.public void syncSpeed()
public void setTurnrate(double turnrate)
turnrate
- New robot turnrate (rad/s).public double getTurnrate()
public void enableMotor()
public void disableMotor()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |