rp1.rossum
Class RsWheelSystem

java.lang.Object
  extended by rp1.rossum.RsComponent
      extended by rp1.rossum.RsBodyPart
          extended by rp1.rossum.RsActuator
              extended by rp1.rossum.RsWheelSystem
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
RsAckermanSteering, RsDifferentialSteering

public abstract class RsWheelSystem
extends RsActuator

This is the abstract base class for all locomotor classes. Eventually, implementations are planned for the following classes

A certain group of utility methods will be included with this group. Given the robot's current motion and a goal position (x,y) given in the robot's frame of reference coordinate system, these utilities provide a motion request to either get the robot to the x,y (getMotionRequest) or pivot it to face the goal point (getMotionRequestForPivot). Note that while RsWheelSystem implements these methods, some of the derived classes will override them. For instance, an Ackerman (automobile) drive can't perform a pivot. So it overrides getMotionRequestForPivot to always return a null.

Note that in the current version of RP1, a wheel system is non-interactive. This limitation is due to implementation problems to be resolved later. If the wheels are contained within the general chassis of the robot, this is not a problem. On some designs, where the wheels are large compared to the robot, it is common to place them in an "outboard" position. In such a case, collision issues are relevant... model these by creating a body shape with the same "footprint" as the wheels.

See Also:
Serialized Form

Constructor Summary
RsWheelSystem()
           
 
Method Summary
 void addDefaultCasterWheel(double x, double y, double wheelRadius, double wheelWidth)
          Provides a convenience function for adding a default caster wheel to the system.
 void addDefaultWheels(double wheelRadius, double wheelWidth)
           
 void addWheel(RsWheel w)
           
 void applyMotion(RsMotion motion)
           
 RsMotion computeMotion(RsMotion start, double startTime, RsMotionRequest request)
           
 void copyStateData(RsBodyPart dataSource)
           
 double getDriveWheelRadius()
           
 RsMotionRequest getMotionRequest(double x, double y, double speed)
          Given a goal position defined in x/y coordinates in the robots frame of reference, getMotionRequest computes a motion request that will cause the robot to move from its current position to the goal.
 RsMotionRequest getMotionRequestForPivot(double x, double y, double speed)
          Given a goal position defined in x/y coordinates in the robot's frame of reference, getMotionRequestForPivot computes a pivot maneuver that will cause the robot to face the goal.
 double getTrackWidth()
           
 double getWheelBase()
           
 RsWheel getWheelForID(int wheelID)
           
 RsWheel[] getWheels()
           
 void paint(java.awt.Graphics g, RsTransform gt)
           
 void resetStateData()
          resetStateData is usually called when a placement is established.
 void setFillColor(java.awt.Color fillColor)
          This method, which overrides that of the parent class, sets the fill color for all wheel objects that were added to the wheel system prior to its invocation.
 void setLineColor(java.awt.Color lineColor)
          This method, which overrides that of the parent class, sets the line color for all wheel objects that were added to the wheel system prior to its invocation.
 
Methods inherited from class rp1.rossum.RsActuator
getPartsArray
 
Methods inherited from class rp1.rossum.RsBodyPart
getFillColor, getHot, getID, getLineColor, getName, isASensor, searchForCollisions, setHot, setHotFillColor, setHotLineColor, setName
 
Methods inherited from class rp1.rossum.RsComponent
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RsWheelSystem

public RsWheelSystem()
Method Detail

addWheel

public void addWheel(RsWheel w)

addDefaultWheels

public void addDefaultWheels(double wheelRadius,
                             double wheelWidth)

getTrackWidth

public double getTrackWidth()

getWheelBase

public double getWheelBase()

getDriveWheelRadius

public double getDriveWheelRadius()

setFillColor

public void setFillColor(java.awt.Color fillColor)
This method, which overrides that of the parent class, sets the fill color for all wheel objects that were added to the wheel system prior to its invocation.

Overrides:
setFillColor in class RsBodyPart

setLineColor

public void setLineColor(java.awt.Color lineColor)
This method, which overrides that of the parent class, sets the line color for all wheel objects that were added to the wheel system prior to its invocation.

Overrides:
setLineColor in class RsBodyPart

paint

public void paint(java.awt.Graphics g,
                  RsTransform gt)
Overrides:
paint in class RsActuator

applyMotion

public void applyMotion(RsMotion motion)

computeMotion

public RsMotion computeMotion(RsMotion start,
                              double startTime,
                              RsMotionRequest request)

getMotionRequest

public RsMotionRequest getMotionRequest(double x,
                                        double y,
                                        double speed)
Given a goal position defined in x/y coordinates in the robots frame of reference, getMotionRequest computes a motion request that will cause the robot to move from its current position to the goal. If the goal is not directly in front or behind the robot, the path will follow the arc of a circle tangent to the robot's current orientation and intersecting both its current position and the goal position. Note that if a particular locomotion cannot satisfy the requirements of the request (for example, the application requests too tight a turn for an automobile-style steering system), this method returns a null.

Parameters:
x - x coordiante of goal in robot's frame of reference (meters)
y - y coordinate of goal in robot's frame of reference (meters)
speed - speed at which robot is requested to travel (meters/sec)

getMotionRequestForPivot

public RsMotionRequest getMotionRequestForPivot(double x,
                                                double y,
                                                double speed)
Given a goal position defined in x/y coordinates in the robot's frame of reference, getMotionRequestForPivot computes a pivot maneuver that will cause the robot to face the goal. Note that not all locomotion systems support pivot maneuvers. For those that do not, this method always returns a null.

Parameters:
x - x coordiante of goal in robot's frame of reference (meters)
y - y coordinate of goal in robot's frame of reference (meters)
speed - rotational speed at which robot is requested to pivot (radians/sec)

resetStateData

public void resetStateData()
Description copied from class: RsBodyPart
resetStateData is usually called when a placement is established. it is implemented as a do-nothing and overridden by derived classes according to their specific behaviors

Overrides:
resetStateData in class RsBodyPart

copyStateData

public void copyStateData(RsBodyPart dataSource)
Overrides:
copyStateData in class RsBodyPart

addDefaultCasterWheel

public void addDefaultCasterWheel(double x,
                                  double y,
                                  double wheelRadius,
                                  double wheelWidth)
Provides a convenience function for adding a default caster wheel to the system. There is nothing special about the design of this caster wheel, and this method is included simply as an example.


getWheelForID

public RsWheel getWheelForID(int wheelID)

getWheels

public RsWheel[] getWheels()