jp.digitalmuseum.mr.entity
クラス Roomba.RoombaDriver

java.lang.Object
  上位を拡張 jp.digitalmuseum.mr.entity.ResourceAbstractImpl
      上位を拡張 jp.digitalmuseum.mr.entity.PhysicalResourceAbstractImpl
          上位を拡張 jp.digitalmuseum.mr.resource.DifferentialWheelsAbstractImpl
              上位を拡張 jp.digitalmuseum.mr.entity.Roomba.RoombaDriver
すべての実装されたインタフェース:
java.io.Serializable, ExclusiveResource, Resource, DifferentialWheels, DifferentialWheelsController, Wheels, WheelsController
含まれているクラス:
Roomba

public static class Roomba.RoombaDriver
extends DifferentialWheelsAbstractImpl

Differential wheels of Roomba.

作成者:
Jun KATO
関連項目:
Roomba, 直列化された形式

入れ子のクラスの概要
static class Roomba.RoombaDriver.Note
          Note consisting Song
Note Number (31 – 127) The pitch of the musical note Roomba will play, according to the MIDI note numbering scheme.
static class Roomba.RoombaDriver.Song
          Roomba song consisted of 16 Notes at maximum.
 
インタフェース jp.digitalmuseum.mr.resource.Wheels から継承された入れ子のクラス/インタフェース
Wheels.Spin, Wheels.WheelsStatus
 
フィールドの概要
static int DEFAULT_ROTATION_SPEED
           
static int DEFAULT_SPEED
           
static int MAXIMUM_VELOCITY
           
static int R_BAUD
           
static int R_Buttons
          Actuator commands / Buttons
static int R_CLEAN
          Cleaning commands / Clean
static int R_CONTROL
          identical to the Safe command.
static int R_DIGITLED
          Actuator commands / Digit LEDs ASCII
static int R_DIGITLEDRAW
          Actuator commands / Digit LEDs Raw
static int R_DRIVE
          Actuator commands / Drive
static int R_DRIVEDIRECT
          Actuator commands / Drive Direct
static int R_DRIVEPWM
          Actuator commands / Drive Pulse Width Modulation
static int R_FULL
          Mode commands / Full
static int R_LEDS
          Actuator commands / LEDs
static int R_MAX
          Cleaning commands / Max
static int R_MOTORS
          Actuator commands / Motors
static int R_MOTORSPWM
          Actuator commands / Motors
static int R_PAUSERESUMESTREAM
          Input commands / Pause/Resume stream
static int R_PLAY
          Actuator commands / Play
static int R_POWER
          Cleaning commands / Power off
static int R_QUERYLIST
          Input commands / Query list
static int R_SAFE
          Mode commands / Safe
static int R_SCHEDULE
          Cleaning commands / Schedule
static int R_SCHEDULELEDS
          Actuator commands / Scheduling LEDs
static int R_SEEKDOCK
          Cleaning commands / Seek Dock
static int R_SENSORS
          Input commands / Sensors
static int R_SETDAYTIME
          Cleaning commands / Set Day/Time
static int R_SONG
          Actuator commands / Song
static int R_SPOT
          Cleaning commands / Spot
static int R_START
           
static int R_STREAM
          Input commands / Stream
 
コンストラクタの概要
Roomba.RoombaDriver(Connector connector)
           
Roomba.RoombaDriver(Roomba roomba)
           
 
メソッドの概要
 void baud(byte baudCode)
          This command sets the baud rate in bits per second (bps) at which OI commands and data are sent according to the baud code sent in the data byte.
 void clean()
          This command starts the default cleaning mode.
 void control()
           
protected  boolean doDrive(int leftPower, int rightPower)
           
protected  boolean doStopWheels()
           
 void drive_(int velocity, int radius)
          This command controls Roomba’s drive wheels.
 void driveDirect(int leftVelocity, int rightVelocity)
          This command lets you control the forward and backward motion of Roomba’s drive wheels independently.
 void full()
          This command gives you complete control over Roomba by putting the OI into Full mode, and turning off the cliff, wheel-drop and internal charger safety features.
 int getRecommendedRotationSpeed()
          Get the recommended value for rotation speed.
 int getRecommendedSpeed()
          Get the recommended value for default speed.
 void lightDigitLED(char c0, char c1, char c2, char c3)
          This command controls the four 7 segment displays on the Roomba 560 and 570 using ASCII character codes.
 void lightLED(boolean home, boolean spot, boolean checkRobot, boolean debris, int cleanOrPowerColor, int cleanOrPowerIntensity)
          This command controls the LEDs common to all models of Roomba 500.
 void max()
          This command starts the Max cleaning mode.
 void motors(boolean vacuum)
          With side brush and main brush motors on, control vacuum motor.
 void motors(boolean vacuum, boolean sideBrush, boolean mainBrush)
           
 void motors(boolean vacuum, boolean sideBrush, boolean sideBrushClockwise, boolean mainBrush, boolean mainBrushOutward)
          This command lets you control the forward and backward motion of Roomba’s main brush, side brush, and vacuum independently.
protected  void onFree()
          Called when disposing this resource.
Caution: This method should not be called outside this class.
 void play(int index)
          This command lets you select a song to play from the songs added to Roomba using the Song command.
 void playSong(Roomba.RoombaDriver.Song song)
          Register a song to Roomba with index 0 and play it immediately.
 void power()
          This command powers down Roomba.
 void safe()
          This command puts the OI into Safe mode, enabling user control of Roomba.
 void seekDock()
          This command sends Roomba to the dock.
 void song(int index, Roomba.RoombaDriver.Song song)
          This command lets you specify up to four songs to the OI that you can play at a later time.
 void song(Roomba.RoombaDriver.Song song)
          Register a song to Roomba with index 0.
 void spot()
          This command starts the Spot cleaning mode.
 void start()
          This command starts the OI.
 
クラス jp.digitalmuseum.mr.resource.DifferentialWheelsAbstractImpl から継承されたメソッド
curve, curveLeft, curveRight, drive, getLeftWheelPower, getRightWheelPower, getRotationSpeed, getSpeed, getStatus, goBackward, goForward, initialize, setRotationSpeed, setSpeed, setStatus, spin, spinLeft, spinRight, stopWheels
 
クラス jp.digitalmuseum.mr.entity.PhysicalResourceAbstractImpl から継承されたメソッド
getConnector, setConnector
 
クラス jp.digitalmuseum.mr.entity.ResourceAbstractImpl から継承されたメソッド
getConfigurationComponent, getReaders, getRobot, getWriter, isWritable, toString
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース jp.digitalmuseum.mr.entity.ExclusiveResource から継承されたメソッド
getWriter, isWritable
 
インタフェース jp.digitalmuseum.mr.entity.Resource から継承されたメソッド
getConfigurationComponent, getReaders, getRobot
 

フィールドの詳細

MAXIMUM_VELOCITY

public static final int MAXIMUM_VELOCITY
関連項目:
定数フィールド値

DEFAULT_SPEED

public static final int DEFAULT_SPEED
関連項目:
定数フィールド値

DEFAULT_ROTATION_SPEED

public static final int DEFAULT_ROTATION_SPEED
関連項目:
定数フィールド値

R_START

public static final int R_START
関連項目:
定数フィールド値

R_BAUD

public static final int R_BAUD
関連項目:
定数フィールド値

R_CONTROL

public static final int R_CONTROL
identical to the Safe command.

関連項目:
R_SAFE, 定数フィールド値

R_SAFE

public static final int R_SAFE
Mode commands / Safe

関連項目:
定数フィールド値

R_FULL

public static final int R_FULL
Mode commands / Full

関連項目:
定数フィールド値

R_CLEAN

public static final int R_CLEAN
Cleaning commands / Clean

関連項目:
定数フィールド値

R_MAX

public static final int R_MAX
Cleaning commands / Max

関連項目:
定数フィールド値

R_SPOT

public static final int R_SPOT
Cleaning commands / Spot

関連項目:
定数フィールド値

R_SEEKDOCK

public static final int R_SEEKDOCK
Cleaning commands / Seek Dock

関連項目:
定数フィールド値

R_SCHEDULE

public static final int R_SCHEDULE
Cleaning commands / Schedule

関連項目:
定数フィールド値

R_SETDAYTIME

public static final int R_SETDAYTIME
Cleaning commands / Set Day/Time

関連項目:
定数フィールド値

R_POWER

public static final int R_POWER
Cleaning commands / Power off

関連項目:
定数フィールド値

R_DRIVE

public static final int R_DRIVE
Actuator commands / Drive

関連項目:
定数フィールド値

R_DRIVEDIRECT

public static final int R_DRIVEDIRECT
Actuator commands / Drive Direct

関連項目:
定数フィールド値

R_DRIVEPWM

public static final int R_DRIVEPWM
Actuator commands / Drive Pulse Width Modulation

関連項目:
定数フィールド値

R_MOTORS

public static final int R_MOTORS
Actuator commands / Motors

関連項目:
定数フィールド値

R_MOTORSPWM

public static final int R_MOTORSPWM
Actuator commands / Motors

関連項目:
R_DRIVEPWM, 定数フィールド値

R_LEDS

public static final int R_LEDS
Actuator commands / LEDs

関連項目:
定数フィールド値

R_SCHEDULELEDS

public static final int R_SCHEDULELEDS
Actuator commands / Scheduling LEDs

関連項目:
定数フィールド値

R_DIGITLEDRAW

public static final int R_DIGITLEDRAW
Actuator commands / Digit LEDs Raw

関連項目:
定数フィールド値

R_DIGITLED

public static final int R_DIGITLED
Actuator commands / Digit LEDs ASCII

関連項目:
定数フィールド値

R_Buttons

public static final int R_Buttons
Actuator commands / Buttons

関連項目:
定数フィールド値

R_SONG

public static final int R_SONG
Actuator commands / Song

関連項目:
定数フィールド値

R_PLAY

public static final int R_PLAY
Actuator commands / Play

関連項目:
定数フィールド値

R_SENSORS

public static final int R_SENSORS
Input commands / Sensors

関連項目:
定数フィールド値

R_QUERYLIST

public static final int R_QUERYLIST
Input commands / Query list

関連項目:
定数フィールド値

R_STREAM

public static final int R_STREAM
Input commands / Stream

関連項目:
定数フィールド値

R_PAUSERESUMESTREAM

public static final int R_PAUSERESUMESTREAM
Input commands / Pause/Resume stream

関連項目:
定数フィールド値
コンストラクタの詳細

Roomba.RoombaDriver

public Roomba.RoombaDriver(Connector connector)

Roomba.RoombaDriver

public Roomba.RoombaDriver(Roomba roomba)
メソッドの詳細

onFree

protected void onFree()
クラス ResourceAbstractImpl の記述:
Called when disposing this resource.
Caution: This method should not be called outside this class.

オーバーライド:
クラス DifferentialWheelsAbstractImpl 内の onFree
関連項目:
ResourceAbstractImpl.free(Object)

getRecommendedSpeed

public int getRecommendedSpeed()
インタフェース DifferentialWheels の記述:
Get the recommended value for default speed.


getRecommendedRotationSpeed

public int getRecommendedRotationSpeed()
インタフェース DifferentialWheels の記述:
Get the recommended value for rotation speed.


start

public void start()
This command starts the OI. You must always send the Start command before sending any other commands to the OI.


baud

public void baud(byte baudCode)
This command sets the baud rate in bits per second (bps) at which OI commands and data are sent according to the baud code sent in the data byte. The default baud rate at power up is 115200 bps, but the starting baud rate can be changed to 19200 by holding down the Clean button while powering on Roomba until you hear a sequence of descending tones. Once the baud rate is changed, it persists until Roomba is power cycled by pressing the power button or removing the battery, or when the battery voltage falls below the minimum required for processor operation. You must wait 100ms after sending this command before sending additional commands at the new baud rate.
Baud CodeBaud Rate in BPS
0300
1600
21200
32400
44800
59600
614400
719200
828800
938400
1057600
11115200


control

public void control()
関連項目:
safe()

safe

public void safe()
This command puts the OI into Safe mode, enabling user control of Roomba. It turns off all LEDs. The OI can be in Passive, Safe, or Full mode to accept this command. If a safety condition occurs (see above) Roomba reverts automatically to Passive mode.


full

public void full()
This command gives you complete control over Roomba by putting the OI into Full mode, and turning off the cliff, wheel-drop and internal charger safety features. That is, in Full mode, Roomba executes any command that you send it, even if the internal charger is plugged in, or command triggers a cliff or wheel drop condition.


clean

public void clean()
This command starts the default cleaning mode.


max

public void max()
This command starts the Max cleaning mode.


spot

public void spot()
This command starts the Spot cleaning mode.


seekDock

public void seekDock()
This command sends Roomba to the dock.


power

public void power()
This command powers down Roomba.


drive_

public void drive_(int velocity,
                   int radius)
This command controls Roomba’s drive wheels. It takes four data bytes, interpreted as two 16-bit signed values using two’s complement. The first two bytes specify the average velocity of the drive wheels in millimeters per second (mm/s), with the high byte being sent first. The next two bytes specify the radius in millimeters at which Roomba will turn. The longer radii make Roomba drive straighter, while the shorter radii make Roomba turn more. The radius is measured from the center of the turning circle to the center of Roomba. A Drive command with a positive velocity and a positive radius makes Roomba drive forward while turning toward the left. A negative radius makes Roomba turn toward the right. Special cases for the radius make Roomba turn in place or drive straight, as specified below. A negative velocity makes Roomba drive backward.

パラメータ:
velocity -
radius -

driveDirect

public void driveDirect(int leftVelocity,
                        int rightVelocity)
This command lets you control the forward and backward motion of Roomba’s drive wheels independently. It takes four data bytes, which are interpreted as two 16-bit signed values using two’s complement. The first two bytes specify the velocity of the right wheel in millimeters per second (mm/s), with the high byte sent first. The next two bytes specify the velocity of the left wheel, in the same format. A positive velocity makes that wheel drive forward, while a negative velocity makes it drive backward.

パラメータ:
leftVelocity -
rightVelocity -

motors

public void motors(boolean vacuum)
With side brush and main brush motors on, control vacuum motor.

パラメータ:
vacuum -
関連項目:
motors(boolean, boolean, boolean)

motors

public void motors(boolean vacuum,
                   boolean sideBrush,
                   boolean mainBrush)

motors

public void motors(boolean vacuum,
                   boolean sideBrush,
                   boolean sideBrushClockwise,
                   boolean mainBrush,
                   boolean mainBrushOutward)
This command lets you control the forward and backward motion of Roomba’s main brush, side brush, and vacuum independently. Motor velocity cannot be controlled with this command, all motors will run at maximum speed when enabled. The main brush and side brush can be run in either direction. The vacuum only runs forward.

パラメータ:
vacuum -
sideBrush -
sideBrushClockwise - Clockwise or counter-clockwise
mainBrush -
mainBrushOutward - Outward or inward

lightLED

public void lightLED(boolean home,
                     boolean spot,
                     boolean checkRobot,
                     boolean debris,
                     int cleanOrPowerColor,
                     int cleanOrPowerIntensity)
This command controls the LEDs common to all models of Roomba 500. The Clean/Power LED is specified by two data bytes: one for the color and the other for the intensity.

パラメータ:
home -
spot -
checkRobot -
debris -
cleanOrPowerColor - 0-255 (green to red)
cleanOrPowerIntensity - 0-255

lightDigitLED

public void lightDigitLED(char c0,
                          char c1,
                          char c2,
                          char c3)
This command controls the four 7 segment displays on the Roomba 560 and 570 using ASCII character codes. Because a 7 segment display is not sufficient to display alphabetic characters properly, all characters are an approximation, and not all ASCII codes are implemented.


song

public void song(Roomba.RoombaDriver.Song song)
Register a song to Roomba with index 0.

関連項目:
song(int, Song)

playSong

public void playSong(Roomba.RoombaDriver.Song song)
Register a song to Roomba with index 0 and play it immediately.

関連項目:
song(int, Song)

song

public void song(int index,
                 Roomba.RoombaDriver.Song song)
This command lets you specify up to four songs to the OI that you can play at a later time. Each song is associated with a song number. The Play command uses the song number to identify your song selection. Each song can contain up to sixteen notes. Each note is associated with a note number that uses MIDI note definitions and a duration that is specified in fractions of a second. The number of data bytes varies, depending on the length of the song specified. A one note song is specified by four data bytes. For each additional note within a song, add two data bytes.

パラメータ:
index - 0-4
song -
関連項目:
Roomba.RoombaDriver.Song

play

public void play(int index)
This command lets you select a song to play from the songs added to Roomba using the Song command. You must add one or more songs to Roomba using the Song command in order for the Play command to work.

パラメータ:
index - 0-4

doStopWheels

protected boolean doStopWheels()
定義:
クラス DifferentialWheelsAbstractImpl 内の doStopWheels

doDrive

protected boolean doDrive(int leftPower,
                          int rightPower)
定義:
クラス DifferentialWheelsAbstractImpl 内の doDrive


Copyright by Jun KATO (arc@dmz) at http://mr.digitalmuseum.jp/