00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef RMP_CONFIGURATION_COMMAND_H
00040 #define RMP_CONFIGURATION_COMMAND_H
00041
00042 #include <RmpUserDefinedFeedbackType.h>
00043
00044 namespace segway
00045 {
00050 enum RmpConfigurationCommandId
00051 {
00052 CONFIG_CMD_ID_NONE = 0,
00053 CONFIG_CMD_ID_SET_MAXIMUM_VELOCITY,
00054 CONFIG_CMD_ID_SET_MAXIMUM_ACCELERATION,
00055 CONFIG_CMD_ID_SET_MAXIMUM_DECELERATION,
00056 CONFIG_CMD_ID_SET_DTZ_DECEL_RATE,
00057 CONFIG_CMD_ID_SET_COASTDOAN_ACCEL,
00058 CONFIG_CMD_ID_SET_MAXIMUM_TURN_RATE,
00059 CONFIG_CMD_ID_SET_MAXIMUM_TURN_ACCEL,
00060 CONFIG_CMD_ID_SET_TIRE_DIAMETER,
00061 CONFIG_CMD_ID_SET_WHEEL_BASE_LENGTH,
00062 CONFIG_CMD_ID_SET_WHEEL_TRACK_WIDTH,
00063 CONFIG_CMD_ID_SET_TRANSMISSION_RATIO,
00064 CONFIG_CMD_ID_SET_INPUT_CONFIG_BITMAP,
00065 CONFIG_CMD_ID_SET_ETH_IP_ADDRESS,
00066 CONFIG_CMD_ID_SET_ETH_PORT_NUMBER,
00067 CONFIG_CMD_ID_SET_ETH_SUBNET_MASK,
00068 CONFIG_CMD_ID_SET_GATEWAY,
00069 CONFIG_CMD_ID_SET_USER_FB_1_BITMAP,
00070 CONFIG_CMD_ID_SET_USER_FB_2_BITMAP,
00071 CONFIG_CMD_ID_SET_USER_FB_3_BITMAP,
00072 CONFIG_CMD_ID_SET_USER_FB_4_BITMAP,
00073 CONFIG_CMD_ID_FORCE_CONFIG_FEEDBACK_BITMAPS = 30,
00074 CONFIG_CMD_ID_SET_AUDIO_COMMAND,
00075 CONFIG_CMD_ID_SET_OPERATIONAL_MODE,
00076 CONFIG_CMD_ID_SEND_SP_FAULT_LOG,
00077 CONFIG_CMD_ID_RESET_INTEGRATORS,
00078 CONFIG_CMD_ID_RESET_PARAMS_TO_DEFAULT
00079 };
00080
00085 enum RmpOperationalModeRequest
00086 {
00087 DISABLE_REQUEST = 1,
00088 POWERDOWN_REQUEST,
00089 DTZ_REQUEST,
00090 STANDBY_REQUEST,
00091 TRACTOR_REQUEST
00092 };
00093
00098 enum RmpAudioSong
00099 {
00100 MOTOR_AUDIO_PLAY_NO_SONG = 0,
00101 MOTOR_AUDIO_PLAY_POWER_ON_SONG,
00102 MOTOR_AUDIO_PLAY_POWER_OFF_SONG,
00103 MOTOR_AUDIO_PLAY_ALARM_SONG,
00104 MOTOR_AUDIO_PLAY_MODE_UP_SONG,
00105 MOTOR_AUDIO_PLAY_MODE_DOWN_SONG,
00106 MOTOR_AUDIO_PLAY_ENTER_ALARM_SONG,
00107 MOTOR_AUDIO_PLAY_EXIT_ALARM_SONG,
00108 MOTOR_AUDIO_PLAY_FINAL_SHUTDOWN_SONG,
00109 MOTOR_AUDIO_PLAY_CORRECT_ISSUE,
00110 MOTOR_AUDIO_PLAY_ISSUE_CORRECTED,
00111 MOTOR_AUDIO_PLAY_CORRECT_ISSUE_REPEATING,
00112 MOTOR_AUDIO_PLAY_BEGINNER_ACK,
00113 MOTOR_AUDIO_PLAY_EXPERT_ACK,
00114 MOTOR_AUDIO_ENTER_FOLLOW,
00115 MOTOR_AUDIO_TEST_SWEEP,
00116 MOTOR_AUDIO_SIMULATE_MOTOR_NOISE
00117 };
00118
00123 enum RmpResetIntegrator
00124 {
00125 RESET_LINEAR_POSITION = 0x00000001,
00126 RESET_RIGHT_FRONT_POSITION = 0x00000002,
00127 RESET_LEFT_FRONT_POSITION = 0x00000004,
00128 RESET_RIGHT_REAR_POSITION = 0x00000008,
00129 RESET_LEFT_REAR_POSITION = 0x00000010,
00130 RESET_ALL_POSITION_DATA = 0x0000001F
00131 };
00132
00133 class RmpConfigurationCommandSet;
00134
00139 template<typename T>
00140 struct RmpConfigurationCommand
00141 {
00142 friend class RmpConfigurationCommandSet;
00143
00144 public:
00148 const RmpConfigurationCommandId m_CommandId;
00149
00153 const T m_Min;
00154
00158 const T m_Max;
00159
00163 const UserDefinedFeedbackType m_FeedbackType;
00164
00165 private:
00178 RmpConfigurationCommand(RmpConfigurationCommandId commandId, T min, T max, UserDefinedFeedbackType feedbackType)
00179 : m_CommandId(commandId)
00180 , m_Min(min)
00181 , m_Max(max)
00182 , m_FeedbackType(feedbackType)
00183 {}
00184
00188 RmpConfigurationCommand();
00189
00193 RmpConfigurationCommand(const RmpConfigurationCommand&);
00194
00198 RmpConfigurationCommand& operator=(const RmpConfigurationCommand&);
00199
00203 ~RmpConfigurationCommand()
00204 {}
00205 };
00206
00211 class RmpConfigurationCommandSet
00212 {
00213 public:
00214 const static RmpConfigurationCommand<uint32_t> NONE;
00215 const static RmpConfigurationCommand<float> SET_MAXIMUM_VELOCITY;
00216 const static RmpConfigurationCommand<float> SET_MAXIMUM_ACCELERATION;
00217 const static RmpConfigurationCommand<float> SET_MAXIMUM_DECELERATION;
00218 const static RmpConfigurationCommand<float> SET_MAXIMUM_DTZ_DECEL_RATE;
00219 const static RmpConfigurationCommand<float> SET_COASTDOWN_ACCEL;
00220 const static RmpConfigurationCommand<float> SET_MAXIMUM_TURN_RATE;
00221 const static RmpConfigurationCommand<float> SET_MAXIMUM_TURN_ACCEL;
00222 const static RmpConfigurationCommand<float> SET_TIRE_DIAMETER;
00223 const static RmpConfigurationCommand<float> SET_WHEEL_BASE_LENGTH;
00224 const static RmpConfigurationCommand<float> SET_WHEEL_TRACK_WIDTH;
00225 const static RmpConfigurationCommand<float> SET_TRANSMISSION_RATIO;
00226 const static RmpConfigurationCommand<uint32_t> SET_INPUT_CONFIG_BITMAP;
00227 const static RmpConfigurationCommand<uint32_t> SET_ETH_IP_ADDRESS;
00228 const static RmpConfigurationCommand<uint32_t> SET_ETH_PORT_ADDRESS;
00229 const static RmpConfigurationCommand<uint32_t> SET_ETH_SUBNET_MASK;
00230 const static RmpConfigurationCommand<uint32_t> SET_ETH_GATEWAY;
00231 const static RmpConfigurationCommand<uint32_t> SET_USER_FB_1_BITMAP;
00232 const static RmpConfigurationCommand<uint32_t> SET_USER_FB_2_BITMAP;
00233 const static RmpConfigurationCommand<uint32_t> SET_USER_FB_3_BITMAP;
00234 const static RmpConfigurationCommand<uint32_t> SET_USER_FB_4_BITMAP;
00235 const static RmpConfigurationCommand<uint32_t> FORCE_CONFIG_FEEDBACK_BITMAPS;
00236 const static RmpConfigurationCommand<uint32_t> SET_AUDIO_COMMAND;
00237 const static RmpConfigurationCommand<uint32_t> SET_OPERATIONAL_MODE;
00238 const static RmpConfigurationCommand<uint32_t> SEND_SP_FAULT_LOG;
00239 const static RmpConfigurationCommand<uint32_t> RESET_INTEGRATORS;
00240 const static RmpConfigurationCommand<uint32_t> RESET_PARAMS_TO_DEFAULT;
00241 };
00242
00243 }
00244
00245 #endif // RMP_CONFIGURATION_COMMAND_H