jp.digitalmuseum.mr.entity
クラス MindstormsNXT

java.lang.Object
  上位を拡張 jp.digitalmuseum.mr.entity.EntityImpl
      上位を拡張 jp.digitalmuseum.mr.entity.RobotAbstractImpl
          上位を拡張 jp.digitalmuseum.mr.entity.PhysicalRobotAbstractImpl
              上位を拡張 jp.digitalmuseum.mr.entity.MindstormsNXT
すべての実装されたインタフェース:
java.io.Serializable, Entity, PhysicalEntity, PhysicalRobot, Robot, EventProvider
直系の既知のサブクラス:
MindstormsNXTWithPen

public class MindstormsNXT
extends PhysicalRobotAbstractImpl

LEGO Mindstorms NXT

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

入れ子のクラスの概要
static class MindstormsNXT.MindstormsNXTDifferentialWheels
          Differential wheels of LEGO Mindstorms NXT.
static class MindstormsNXT.OutputState
          Container for holding the output state values.
 
フィールドの概要
static int A
           
static int ALL
           
static byte ANGLE
           
static byte ANGLESTEPSMODE
           
static int B
           
static byte BOOLEANMODE
           
static byte BOOT
           
static byte BRAKE
          Use run/brake instead of run/float in PWM
static int C
           
static byte CELSIUSMODE
           
static byte CLOSE
           
static byte CUSTOM
           
static byte DELETE
           
static byte DELETE_USER_FLASH
           
static byte DIRECT_COMMAND_NOREPLY
           
static byte DIRECT_COMMAND_REPLY
           
static byte FAHRENHEITMODE
           
static byte FIND_FIRST
           
static byte FIND_NEXT
           
static byte GET_BATTERY_LEVEL
           
static byte GET_CURRENT_PROGRAM_NAME
           
static byte GET_DEVICE_INFO
           
static byte GET_FIRMWARE_VERSION
           
static byte GET_INPUT_VALUES
           
static byte GET_OUTPUT_STATE
           
static byte HIGH_SPEED_BUFFER
           
static byte KEEP_ALIVE
           
static byte LIGHT_ACTIVE
           
static byte LIGHT_INACTIVE
           
static byte LOWSPEED
           
static byte LOWSPEED_9V
           
static byte LS_GET_STATUS
           
static byte LS_READ
           
static byte LS_WRITE
           
static byte MESSAGE_READ
           
static byte MESSAGE_WRITE
           
static byte MODEMASK
           
static byte MOTOR_RUN_STATE_ERROR
          Error
static byte MOTOR_RUN_STATE_IDLE
          Output will be idle
static byte MOTOR_RUN_STATE_RAMPDOWN
          Output will ramp-down
static byte MOTOR_RUN_STATE_RAMPUP
          Output will ramp-up
static byte MOTOR_RUN_STATE_RUNNING
          Output will be running
static byte MOTORON
          Turn on the specified motor
static byte NO_OF_SENSOR_TYPES
           
static byte NO_SENSOR
           
static byte OPEN_APPEND_DATA
           
static byte OPEN_READ
           
static byte OPEN_READ_LINEAR
           
static byte OPEN_WRITE
           
static byte OPEN_WRITE_DATA
           
static byte OPEN_WRITE_LINEAR
           
static byte PCTFULLSCALEMODE
           
static byte PERIODCOUNTERMODE
           
static byte PLAY_SOUND_FILE
           
static byte PLAY_TONE
           
static byte POLL
           
static byte POLL_BUFFER
           
static byte POLL_LENGTH
           
static byte RAWMODE
           
static byte READ
           
static byte REFLECTION
           
static byte REGULATED
          Turns on the regulation
static byte REGULATION_MODE_IDLE
          No regulation will be enabled
static byte REGULATION_MODE_MOTOR_SPEED
          Power control will be enabled on specified output
static byte REGULATION_MODE_MOTOR_SYNC
          Synchronization will be enabled (Needs enabled on two output)
static byte REPLY_COMMAND
           
static byte RESET_MOTOR_POSITION
           
static byte RESET_SCALED_INPUT_VALUE
           
static byte SET_BRICK_NAME
           
static byte SET_INPUT_MODE
           
static byte SET_OUTPUT_STATE
           
static byte SLOPEMASK
           
static byte SOUND_DB
           
static byte SOUND_DBA
           
static byte START_PROGRAM
           
static byte STOP_PROGRAM
           
static byte STOP_SOUND_PLAYBACK
           
static byte SWITCH
           
static byte SYSTEM_COMMAND_NOREPLY
           
static byte SYSTEM_COMMAND_REPLY
           
static byte TACHO_FOREVER
           
static byte TEMPERATURE
           
static byte TRANSITIONCNTMODE
           
static byte WRITE
           
 
コンストラクタの概要
MindstormsNXT()
           
MindstormsNXT(Connector connector)
           
MindstormsNXT(Connector connector, java.lang.String name)
           
MindstormsNXT(java.lang.String connectionString)
           
MindstormsNXT(java.lang.String connectionString, java.lang.String name)
           
 
メソッドの概要
 void dispose()
          Called when disposing this Entity.
protected  boolean drive(int port, byte power, int mode)
           
protected static boolean drive(int port, byte power, int mode, Connector connector)
           
 MindstormsNXT.OutputState getOutputState(int port)
           
static MindstormsNXT.OutputState getOutputState(int port, Connector connector)
          Retrieves the current output state for a port.
static void getOutputState(int port, Connector connector, MindstormsNXT.OutputState outputState)
          Retrieves the current output state for a port.
 void getOutputStateOut(int port, MindstormsNXT.OutputState outputState)
           
protected  java.util.List<ResourceAbstractImpl> getResources()
          This method must be implemented by child classes.
Caution: Do not call this method outside this class.
 java.awt.Shape getShape()
           
protected  void initialize()
           
protected static byte[] read(Connector connector)
           
 boolean sendAck()
           
static boolean sendAck(Connector connector)
           
protected  boolean setOutputState(int port, byte power, int mode, int regulationMode, int turnRatio, int runState, int tachoLimit)
           
protected static boolean setOutputState(int port, byte power, int mode, int regulationMode, int turnRatio, int runState, int tachoLimit, Connector connector)
           
protected static boolean write(byte[] buf, Connector connector)
           
 
クラス jp.digitalmuseum.mr.entity.PhysicalRobotAbstractImpl から継承されたメソッド
connect, disconnect, getConfigurationComponent, getConnector, isConnected, setConnector
 
クラス jp.digitalmuseum.mr.entity.RobotAbstractImpl から継承されたメソッド
freeResource, freeResources, getAssignedTask, getAssignedTasks, getAvailableExclusiveResourceTypes, getResourceComponent, getResourceComponents, getResourceComponents, getResourceTypes, getTypeName, requestResource, requestResources, setTypeName
 
クラス jp.digitalmuseum.mr.entity.EntityImpl から継承されたメソッド
addEventListener, distributeEvent, getName, isDisposed, removeEventListener, setName, toString
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース jp.digitalmuseum.mr.entity.Robot から継承されたメソッド
freeResource, freeResources, getAssignedTask, getAssignedTasks, getAvailableExclusiveResourceTypes, getResourceComponent, getResourceComponents, getResourceComponents, getResourceTypes, getTypeName, requestResource, requestResources
 
インタフェース jp.digitalmuseum.mr.entity.Entity から継承されたメソッド
getName, isDisposed, setName
 
インタフェース jp.digitalmuseum.mr.message.EventProvider から継承されたメソッド
addEventListener, removeEventListener
 

フィールドの詳細

A

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

B

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

C

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

ALL

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

TACHO_FOREVER

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

DIRECT_COMMAND_REPLY

public static byte DIRECT_COMMAND_REPLY

SYSTEM_COMMAND_REPLY

public static byte SYSTEM_COMMAND_REPLY

REPLY_COMMAND

public static byte REPLY_COMMAND

DIRECT_COMMAND_NOREPLY

public static byte DIRECT_COMMAND_NOREPLY

SYSTEM_COMMAND_NOREPLY

public static byte SYSTEM_COMMAND_NOREPLY

OPEN_READ

public static byte OPEN_READ

OPEN_WRITE

public static byte OPEN_WRITE

READ

public static byte READ

WRITE

public static byte WRITE

CLOSE

public static byte CLOSE

DELETE

public static byte DELETE

FIND_FIRST

public static byte FIND_FIRST

FIND_NEXT

public static byte FIND_NEXT

GET_FIRMWARE_VERSION

public static byte GET_FIRMWARE_VERSION

OPEN_WRITE_LINEAR

public static byte OPEN_WRITE_LINEAR

OPEN_READ_LINEAR

public static byte OPEN_READ_LINEAR

OPEN_WRITE_DATA

public static byte OPEN_WRITE_DATA

OPEN_APPEND_DATA

public static byte OPEN_APPEND_DATA

BOOT

public static byte BOOT

SET_BRICK_NAME

public static byte SET_BRICK_NAME

GET_DEVICE_INFO

public static byte GET_DEVICE_INFO

DELETE_USER_FLASH

public static byte DELETE_USER_FLASH

POLL_LENGTH

public static byte POLL_LENGTH

POLL

public static byte POLL

POLL_BUFFER

public static byte POLL_BUFFER

HIGH_SPEED_BUFFER

public static byte HIGH_SPEED_BUFFER

START_PROGRAM

public static byte START_PROGRAM

STOP_PROGRAM

public static byte STOP_PROGRAM

PLAY_SOUND_FILE

public static byte PLAY_SOUND_FILE

PLAY_TONE

public static byte PLAY_TONE

SET_OUTPUT_STATE

public static byte SET_OUTPUT_STATE

SET_INPUT_MODE

public static byte SET_INPUT_MODE

GET_OUTPUT_STATE

public static byte GET_OUTPUT_STATE

GET_INPUT_VALUES

public static byte GET_INPUT_VALUES

RESET_SCALED_INPUT_VALUE

public static byte RESET_SCALED_INPUT_VALUE

MESSAGE_WRITE

public static byte MESSAGE_WRITE

RESET_MOTOR_POSITION

public static byte RESET_MOTOR_POSITION

GET_BATTERY_LEVEL

public static byte GET_BATTERY_LEVEL

STOP_SOUND_PLAYBACK

public static byte STOP_SOUND_PLAYBACK

KEEP_ALIVE

public static byte KEEP_ALIVE

LS_GET_STATUS

public static byte LS_GET_STATUS

LS_WRITE

public static byte LS_WRITE

LS_READ

public static byte LS_READ

GET_CURRENT_PROGRAM_NAME

public static byte GET_CURRENT_PROGRAM_NAME

MESSAGE_READ

public static byte MESSAGE_READ

MOTORON

public static byte MOTORON
Turn on the specified motor


BRAKE

public static byte BRAKE
Use run/brake instead of run/float in PWM


REGULATED

public static byte REGULATED
Turns on the regulation


REGULATION_MODE_IDLE

public static byte REGULATION_MODE_IDLE
No regulation will be enabled


REGULATION_MODE_MOTOR_SPEED

public static byte REGULATION_MODE_MOTOR_SPEED
Power control will be enabled on specified output


REGULATION_MODE_MOTOR_SYNC

public static byte REGULATION_MODE_MOTOR_SYNC
Synchronization will be enabled (Needs enabled on two output)


MOTOR_RUN_STATE_ERROR

public static byte MOTOR_RUN_STATE_ERROR
Error


MOTOR_RUN_STATE_IDLE

public static byte MOTOR_RUN_STATE_IDLE
Output will be idle


MOTOR_RUN_STATE_RAMPUP

public static byte MOTOR_RUN_STATE_RAMPUP
Output will ramp-up


MOTOR_RUN_STATE_RUNNING

public static byte MOTOR_RUN_STATE_RUNNING
Output will be running


MOTOR_RUN_STATE_RAMPDOWN

public static byte MOTOR_RUN_STATE_RAMPDOWN
Output will ramp-down


NO_SENSOR

public static byte NO_SENSOR

SWITCH

public static byte SWITCH

TEMPERATURE

public static byte TEMPERATURE

REFLECTION

public static byte REFLECTION

ANGLE

public static byte ANGLE

LIGHT_ACTIVE

public static byte LIGHT_ACTIVE

LIGHT_INACTIVE

public static byte LIGHT_INACTIVE

SOUND_DB

public static byte SOUND_DB

SOUND_DBA

public static byte SOUND_DBA

CUSTOM

public static byte CUSTOM

LOWSPEED

public static byte LOWSPEED

LOWSPEED_9V

public static byte LOWSPEED_9V

NO_OF_SENSOR_TYPES

public static byte NO_OF_SENSOR_TYPES

RAWMODE

public static byte RAWMODE

BOOLEANMODE

public static byte BOOLEANMODE

TRANSITIONCNTMODE

public static byte TRANSITIONCNTMODE

PERIODCOUNTERMODE

public static byte PERIODCOUNTERMODE

PCTFULLSCALEMODE

public static byte PCTFULLSCALEMODE

CELSIUSMODE

public static byte CELSIUSMODE

FAHRENHEITMODE

public static byte FAHRENHEITMODE

ANGLESTEPSMODE

public static byte ANGLESTEPSMODE

SLOPEMASK

public static byte SLOPEMASK

MODEMASK

public static byte MODEMASK
コンストラクタの詳細

MindstormsNXT

public MindstormsNXT()

MindstormsNXT

public MindstormsNXT(java.lang.String connectionString)

MindstormsNXT

public MindstormsNXT(java.lang.String connectionString,
                     java.lang.String name)

MindstormsNXT

public MindstormsNXT(Connector connector)

MindstormsNXT

public MindstormsNXT(Connector connector,
                     java.lang.String name)
メソッドの詳細

initialize

protected void initialize()
オーバーライド:
クラス RobotAbstractImpl 内の initialize

dispose

public void dispose()
インタフェース Entity の記述:
Called when disposing this Entity.

定義:
インタフェース Entity 内の dispose
オーバーライド:
クラス PhysicalRobotAbstractImpl 内の dispose
関連項目:
Entity.dispose()

getResources

protected java.util.List<ResourceAbstractImpl> getResources()
クラス RobotAbstractImpl の記述:
This method must be implemented by child classes.
Caution: Do not call this method outside this class.

オーバーライド:
クラス RobotAbstractImpl 内の getResources
戻り値:
Returns a set of all resources.

getShape

public java.awt.Shape getShape()
定義:
インタフェース Entity 内の getShape
定義:
インタフェース PhysicalEntity 内の getShape
オーバーライド:
クラス EntityImpl 内の getShape
戻り値:
Returns shape of this entity.
関連項目:
Entity.getShape()

drive

protected boolean drive(int port,
                        byte power,
                        int mode)

drive

protected static boolean drive(int port,
                               byte power,
                               int mode,
                               Connector connector)

setOutputState

protected boolean setOutputState(int port,
                                 byte power,
                                 int mode,
                                 int regulationMode,
                                 int turnRatio,
                                 int runState,
                                 int tachoLimit)
関連項目:
setOutputState(int, byte, int, int, int, int, int, Connector)

setOutputState

protected static boolean setOutputState(int port,
                                        byte power,
                                        int mode,
                                        int regulationMode,
                                        int turnRatio,
                                        int runState,
                                        int tachoLimit,
                                        Connector connector)
パラメータ:
port - - Output port (0 - 2 or 0xFF for all three)
power - - Set point for power. (-100 to 100)
mode - - Setting the modes MOTORON, BRAKE, and/or REGULATED. This parameter is a bitfield, so to put it in brake mode and regulated, use BRAKEMODE + REGULATED
regulationMode - - see NXTProtocol for enumerations
turnRatio - - Need two motors? (-100 to 100)
runState - - see NXTProtocol for enumerations
tachoLimit - - Number of degrees(?) to rotate before stopping.

getOutputState

public MindstormsNXT.OutputState getOutputState(int port)
関連項目:
getOutputState(int, Connector)

getOutputStateOut

public void getOutputStateOut(int port,
                              MindstormsNXT.OutputState outputState)
関連項目:
getOutputState(int, Connector, OutputState)

getOutputState

public static MindstormsNXT.OutputState getOutputState(int port,
                                                       Connector connector)
Retrieves the current output state for a port.

パラメータ:
port - - 0 to 3
戻り値:
OutputState - returns a container object for output state variables.

getOutputState

public static void getOutputState(int port,
                                  Connector connector,
                                  MindstormsNXT.OutputState outputState)
Retrieves the current output state for a port.

パラメータ:
port - 0 to 3
outputState - a container object for output state variables.

sendAck

public boolean sendAck()

sendAck

public static boolean sendAck(Connector connector)

write

protected static boolean write(byte[] buf,
                               Connector connector)

read

protected static byte[] read(Connector connector)


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