rp1.rossum
Class RsDifferentialSteering

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

public class RsDifferentialSteering
extends RsWheelSystem

An actuator class representing differential steering locomotion systems. The differential steering system is similar to that used for wheel chairs. This class presents a very high level of such a system, ignoring the mechanical details of the steering apparatus and focussing on its general effects.

Steering and Coordinate Systems

Differential steering treats a pair of the robot drive wheels spaced equal distances from the center of the robot. Thus the origin is placed at the center of the drive wheel axle. If desired, representations of caster wheels (used in the real world to provide support for a robot platform) may be added at arbitrary locations.

Since:
0.60
See Also:
Serialized Form

Constructor Summary
RsDifferentialSteering(double trackWidth, double driveWheelRadius)
          Creates and initializes an object representing an differential steering system.
 
Method Summary
 void addDefaultWheels(double wheelRadius, double wheelWidth)
          For depiction purposes, add a pair of wheels located on the ends of an axle at the center of the robot body.
 RsEncoder[] addEncodersToDefaultWheels(int nIntervals)
          Adds encoders to the drive wheels in the differential steering apparatus.
 RsActuatorControlRequest getControlRequestForWheelRotation(double leftRotationalVelocity, double rightRotationalVelocity)
           
 RsMotionRequest getMotionRequestUsingWheelRotationalVelocities(double rotLeft, double rotRight, double duration)
           
 RsMotionRequest getMotionRequestUsingWheelVelocities(double velocityLeft, double velocityRight, double duration)
           
 
Methods inherited from class rp1.rossum.RsWheelSystem
addDefaultCasterWheel, addWheel, applyMotion, computeMotion, copyStateData, getDriveWheelRadius, getMotionRequest, getMotionRequestForPivot, getTrackWidth, getWheelBase, getWheelForID, getWheels, paint, resetStateData, setFillColor, setLineColor
 
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

RsDifferentialSteering

public RsDifferentialSteering(double trackWidth,
                              double driveWheelRadius)
Creates and initializes an object representing an differential steering system.

Parameters:
trackWidth - the width of the wheel system, measured wheel center-to-center
driveWheelRadius - the radius of the drive wheels (used for converting rotational velocities)
Method Detail

addDefaultWheels

public void addDefaultWheels(double wheelRadius,
                             double wheelWidth)
For depiction purposes, add a pair of wheels located on the ends of an axle at the center of the robot body. It is recommended, but not required, that the depicted wheel radius agree with the driveWheelRadius supplied in the constructor. Note that at this time the wheels supplied in this implementation are non-interactive. That will change in future versions of this class.

Overrides:
addDefaultWheels in class RsWheelSystem
Parameters:
wheelRadius - radius of the depicted wheels
wheelWidth - width of the tire to be depicted

addEncodersToDefaultWheels

public RsEncoder[] addEncodersToDefaultWheels(int nIntervals)
Adds encoders to the drive wheels in the differential steering apparatus. If successful, an array of two encoders is returned, index 0 for the left wheel, index 1 for the right. Note that the encoders are installed so that they always return a positive value for forward motion and a negative value for reverse motion.

Parameters:
nIntervals - The number of intervals for the encoder

getMotionRequestUsingWheelVelocities

public RsMotionRequest getMotionRequestUsingWheelVelocities(double velocityLeft,
                                                            double velocityRight,
                                                            double duration)

getMotionRequestUsingWheelRotationalVelocities

public RsMotionRequest getMotionRequestUsingWheelRotationalVelocities(double rotLeft,
                                                                      double rotRight,
                                                                      double duration)

getControlRequestForWheelRotation

public RsActuatorControlRequest getControlRequestForWheelRotation(double leftRotationalVelocity,
                                                                  double rightRotationalVelocity)