lejos.robotics
Interface RotationPlatform

All Known Implementing Classes:
ExtendedPlatform, SimplePlatform

public interface RotationPlatform

A platform for rotating a sensor and elevating the angle.

Author:
BB

Method Summary
 int getAbsoluteDirection(Pose pose)
          Includes the direction of the pilot in the calculation of the real angle of the sensor (as opposed to the relative direction of the sensor) NOTE: There is no corresponding setAbsoluteDirection() method because the angle the Pilot would rotate to and the angle the sensor would rotate to would be ambiguous.
 int getDirection()
          Get the direction the sensor will face.
 int getMaximumDirection()
          Cables or other hindrances can restrict movement of the platform.
 int getMinimumDirection()
          Cables or other hindrances can restrict movement of the platform.
 int getRotationSpeed()
          Gets the speed the platform rotates, in degrees per second.
 float getXOffset()
           
 float getYOffset()
           
 float getZOffset()
           
 void scanLeft()
          Starts rotating counterclockwise (left).
 void scanRight()
          Starts rotating to the clockwise (right).
 void setDirection(int angle)
          Rotates the sensor to the desired angle.
 void setMaximumDirection(int maxAngle)
          Cables or other hindrances can restrict movement of the platform.
 void setMinimumDirection(int minAngle)
          Cables or other hindrances can restrict movement of the platform.
 void setRotationSpeed(int speed)
          Sets the speed the platform should rotate, in degrees per second.
 void setXOffset()
          The actual central axis of the sensor rotator will reside off center from the actual robot center.
 void setYOffset()
           
 void setZOffset()
           
 void stopRotation()
          Stops a rotation in motion from one of the rotate methods, like rotateLeft() or rotateUp().
 boolean zero()
          This method calibrates the direction and elevation to the zero angle position, which is pointing in the same direction as the robot and facing horizontal.
 

Method Detail

setDirection

void setDirection(int angle)
Rotates the sensor to the desired angle. The direction is relative to the robot. The method will not return until the rotator has achieved the target angle.

Parameters:
angle - The angle, in degrees, to rotate to. 0 to 360, increasing counter clockwise from 0, the starting position.

getDirection

int getDirection()
Get the direction the sensor will face. The direction is relative to the robot.

Returns:
the relative direction of the sensor in degrees (0 to 360, increasing counter clockwise from 0, the starting position)

getMaximumDirection

int getMaximumDirection()
Cables or other hindrances can restrict movement of the platform. This method indicates the maximum it can rotate left.

Returns:

getMinimumDirection

int getMinimumDirection()
Cables or other hindrances can restrict movement of the platform. This method indicates the maximum it can rotate right.

Returns:

setMaximumDirection

void setMaximumDirection(int maxAngle)
Cables or other hindrances can restrict movement of the platform. This method sets the maximum angle it can rotate left.

Parameters:
maxAngle -

setMinimumDirection

void setMinimumDirection(int minAngle)
Cables or other hindrances can restrict movement of the platform. This method sets the maximum angle it can rotate right.

Parameters:
minAngle -

getAbsoluteDirection

int getAbsoluteDirection(Pose pose)
Includes the direction of the pilot in the calculation of the real angle of the sensor (as opposed to the relative direction of the sensor) NOTE: There is no corresponding setAbsoluteDirection() method because the angle the Pilot would rotate to and the angle the sensor would rotate to would be ambiguous. e.g. to rotate the sensor 90 degrees, the Pilot could rotate 10 degrees and the sensor 80 degrees, or any number of combinations to get 90 degrees.

Parameters:
pilot -
Returns:

setRotationSpeed

void setRotationSpeed(int speed)
Sets the speed the platform should rotate, in degrees per second. The default speed is XX degrees/second.

Parameters:
speed -

getRotationSpeed

int getRotationSpeed()
Gets the speed the platform rotates, in degrees per second. The default speed is XX degrees/second.

Returns:

scanLeft

void scanLeft()
Starts rotating counterclockwise (left). Automatically stops when the angle matches or exceeds getMaximumDirection().


scanRight

void scanRight()
Starts rotating to the clockwise (right). Automatically stops when the angle matches or is less than getMinimumDirection().


stopRotation

void stopRotation()
Stops a rotation in motion from one of the rotate methods, like rotateLeft() or rotateUp().


zero

boolean zero()
This method calibrates the direction and elevation to the zero angle position, which is pointing in the same direction as the robot and facing horizontal. If the sensor platform uses a touch sensor, light sensor or some other sensor to calibrate the position, this can be used in conjunction with motor movements to set the position to the zero position, then reset the angles to zero. Otherwise this method relies on the user to set the sensor platform to the zero position manually by hand.

Returns:
true if calibration worked, false if it failed.

setXOffset

void setXOffset()
The actual central axis of the sensor rotator will reside off center from the actual robot center. So we could include methods to set the x offset, y offset and z offset from the center of robot (center = point between wheels).


setYOffset

void setYOffset()

setZOffset

void setZOffset()

getXOffset

float getXOffset()

getYOffset

float getYOffset()

getZOffset

float getZOffset()