001package com.ctre.phoenix.motorcontrol; 002 003import com.ctre.phoenix.ErrorCode; 004import com.ctre.phoenix.ParamEnum; 005import com.ctre.phoenix.motion.MotionProfileStatus; 006import com.ctre.phoenix.motion.TrajectoryPoint; 007import com.ctre.phoenix.motorcontrol.can.BaseTalon; 008import com.ctre.phoenix.sensors.CANCoder; 009 010/** 011 * Interface for motor controllers 012 */ 013public interface IMotorController 014 extends com.ctre.phoenix.signals.IOutputSignal, com.ctre.phoenix.signals.IInvertable, IFollower { 015 // ------ Set output routines. ----------// 016 /** 017 * Sets the appropriate output on the talon, depending on the mode. 018 * @param Mode The output mode to apply. 019 * In PercentOutput, the output is between -1.0 and 1.0, with 0.0 as stopped. 020 * In Current mode, output value is in amperes. 021 * In Velocity mode, output value is in position change / 100ms. 022 * In Position mode, output value is in encoder ticks or an analog value, 023 * depending on the sensor. 024 * In Follower mode, the output value is the integer device ID of the talon to 025 * duplicate. 026 * 027 * @param demand The setpoint value, as described above. 028 * 029 * 030 * Standard Driving Example: 031 * _talonLeft.set(ControlMode.PercentOutput, leftJoy); 032 * _talonRght.set(ControlMode.PercentOutput, rghtJoy); 033 */ 034 public void set(ControlMode Mode, double demand); 035 036 /** 037 * @param Mode Sets the appropriate output on the talon, depending on the mode. 038 * @param demand0 The output value to apply. 039 * such as advanced feed forward and/or auxiliary close-looping in firmware. 040 * In PercentOutput, the output is between -1.0 and 1.0, with 0.0 as stopped. 041 * In Current mode, output value is in amperes. 042 * In Velocity mode, output value is in position change / 100ms. 043 * In Position mode, output value is in encoder ticks or an analog value, 044 * depending on the sensor. See 045 * In Follower mode, the output value is the integer device ID of the talon to 046 * duplicate. 047 * 048 * @param demand1Type The demand type for demand1. 049 * Neutral: Ignore demand1 and apply no change to the demand0 output. 050 * AuxPID: Use demand1 to set the target for the auxiliary PID 1. 051 * ArbitraryFeedForward: Use demand1 as an arbitrary additive value to the 052 * demand0 output. In PercentOutput the demand0 output is the motor output, 053 * and in closed-loop modes the demand0 output is the output of PID0. 054 * @param demand1 Supplmental output value. Units match the set mode. 055 * 056 * 057 * Arcade Drive Example: 058 * _talonLeft.set(ControlMode.PercentOutput, joyForward, DemandType.ArbitraryFeedForward, +joyTurn); 059 * _talonRght.set(ControlMode.PercentOutput, joyForward, DemandType.ArbitraryFeedForward, -joyTurn); 060 * 061 * Drive Straight Example: 062 * Note: Selected Sensor Configuration is necessary for both PID0 and PID1. 063 * _talonLeft.follow(_talonRght, FollwerType.AuxOutput1); 064 * _talonRght.set(ControlMode.PercentOutput, joyForward, DemandType.AuxPID, desiredRobotHeading); 065 * 066 * Drive Straight to a Distance Example: 067 * Note: Other configurations (sensor selection, PID gains, etc.) need to be set. 068 * _talonLeft.follow(_talonRght, FollwerType.AuxOutput1); 069 * _talonRght.set(ControlMode.MotionMagic, targetDistance, DemandType.AuxPID, desiredRobotHeading); 070 */ 071 public void set(ControlMode Mode, double demand0, DemandType demand1Type, double demand1); 072 073 /** 074 * Neutral the motor output by setting control mode to disabled. 075 */ 076 public void neutralOutput(); 077 078 /** 079 * Sets the mode of operation during neutral throttle output. 080 * 081 * @param neutralMode 082 * The desired mode of operation when the Controller output 083 * throttle is neutral (ie brake/coast) 084 **/ 085 public void setNeutralMode(NeutralMode neutralMode); 086 087 // ------ Invert behavior ----------// 088 /** 089 * Sets the phase of the sensor. Use when controller forward/reverse output 090 * doesn't correlate to appropriate forward/reverse reading of sensor. 091 * Pick a value so that positive PercentOutput yields a positive change in sensor. 092 * After setting this, user can freely call SetInverted() with any value. 093 * 094 * @param PhaseSensor 095 * Indicates whether to invert the phase of the sensor. 096 */ 097 public void setSensorPhase(boolean PhaseSensor); 098 099 /** 100 * Inverts the hbridge output of the motor controller. 101 * 102 * This does not impact sensor phase and should not be used to correct sensor polarity. 103 * 104 * This will invert the hbridge output but NOT the LEDs. 105 * This ensures.... 106 * - Green LEDs always represents positive request from robot-controller/closed-looping mode. 107 * - Green LEDs correlates to forward limit switch. 108 * - Green LEDs correlates to forward soft limit. 109 * 110 * @param invert 111 * Invert state to set. 112 */ 113 public void setInverted(boolean invert); 114 115 /** 116 * Inverts the hbridge output of the motor controller in relation to the master if present 117 * 118 * This does not impact sensor phase and should not be used to correct sensor polarity. 119 * 120 * This will allow you to either: 121 * - Not invert the motor 122 * - Invert the motor 123 * - Always follow the master regardless of master's inversion 124 * - Always oppose the master regardless of master's inversion 125 * 126 * @param invertType 127 * Invert state to set. 128 */ 129 public void setInverted(InvertType invertType); 130 131 /** 132 * @return invert setting of motor output. 133 */ 134 public boolean getInverted(); 135 136 // ----- general output shaping ------------------// 137 /** 138 * Configures the open-loop ramp rate of throttle output. 139 * 140 * @param secondsFromNeutralToFull 141 * Minimum desired time to go from neutral to full throttle. A 142 * value of '0' will disable the ramp. 143 * @param timeoutMs 144 * Timeout value in ms. If nonzero, function will wait for 145 * config success and report an error if it times out. 146 * If zero, no blocking or checking is performed. 147 * @return Error Code generated by function. 0 indicates no error. 148 */ 149 public ErrorCode configOpenloopRamp(double secondsFromNeutralToFull, int timeoutMs); 150 151 /** 152 * Configures the closed-loop ramp rate of throttle output. 153 * 154 * @param secondsFromNeutralToFull 155 * Minimum desired time to go from neutral to full throttle. A 156 * value of '0' will disable the ramp. 157 * @param timeoutMs 158 * Timeout value in ms. If nonzero, function will wait for 159 * config success and report an error if it times out. 160 * If zero, no blocking or checking is performed. 161 * @return Error Code generated by function. 0 indicates no error. 162 */ 163 public ErrorCode configClosedloopRamp(double secondsFromNeutralToFull, int timeoutMs); 164 165 /** 166 * Configures the forward peak output percentage. 167 * 168 * @param percentOut 169 * Desired peak output percentage. [0,1] 170 * @param timeoutMs 171 * Timeout value in ms. If nonzero, function will wait for 172 * config success and report an error if it times out. 173 * If zero, no blocking or checking is performed. 174 * @return Error Code generated by function. 0 indicates no error. 175 */ 176 public ErrorCode configPeakOutputForward(double percentOut, int timeoutMs); 177 178 /** 179 * Configures the reverse peak output percentage. 180 * 181 * @param percentOut 182 * Desired peak output percentage. 183 * @param timeoutMs 184 * Timeout value in ms. If nonzero, function will wait for 185 * config success and report an error if it times out. 186 * If zero, no blocking or checking is performed. 187 * @return Error Code generated by function. 0 indicates no error. 188 */ 189 public ErrorCode configPeakOutputReverse(double percentOut, int timeoutMs); 190 191 /** 192 * Configures the forward nominal output percentage. 193 * 194 * @param percentOut 195 * Nominal (minimum) percent output. [0,+1] 196 * @param timeoutMs 197 * Timeout value in ms. If nonzero, function will wait for 198 * config success and report an error if it times out. 199 * If zero, no blocking or checking is performed. 200 * @return Error Code generated by function. 0 indicates no error. 201 */ 202 public ErrorCode configNominalOutputForward(double percentOut, int timeoutMs); 203 204 /** 205 * Configures the reverse nominal output percentage. 206 * 207 * @param percentOut 208 * Nominal (minimum) percent output. [-1,0] 209 * @param timeoutMs 210 * Timeout value in ms. If nonzero, function will wait for 211 * config success and report an error if it times out. 212 * If zero, no blocking or checking is performed. 213 * @return Error Code generated by function. 0 indicates no error. 214 */ 215 public ErrorCode configNominalOutputReverse(double percentOut, int timeoutMs); 216 217 /** 218 * Configures the output deadband percentage. 219 * 220 * @param percentDeadband 221 * Desired deadband percentage. Minimum is 0.1%, Maximum is 25%. 222 * Pass 0.04 for 4% (factory default). 223 * @param timeoutMs 224 * Timeout value in ms. If nonzero, function will wait for 225 * config success and report an error if it times out. 226 * If zero, no blocking or checking is performed. 227 * @return Error Code generated by function. 0 indicates no error. 228 */ 229 public ErrorCode configNeutralDeadband(double percentDeadband, int timeoutMs); 230 231 // ------ Voltage Compensation ----------// 232 /** 233 * Configures the Voltage Compensation saturation voltage. 234 * 235 * @param voltage 236 * This is the max voltage to apply to the hbridge when voltage 237 * compensation is enabled. For example, if 10 (volts) is specified 238 * and a TalonSRX is commanded to 0.5 (PercentOutput, closed-loop, etc) 239 * then the TalonSRX will attempt to apply a duty-cycle to produce 5V. 240 * @param timeoutMs 241 * Timeout value in ms. If nonzero, function will wait for 242 * config success and report an error if it times out. 243 * If zero, no blocking or checking is performed. 244 * @return Error Code generated by function. 0 indicates no error. 245 */ 246 public ErrorCode configVoltageCompSaturation(double voltage, int timeoutMs); 247 248 /** 249 * Configures the voltage measurement filter. 250 * 251 * @param filterWindowSamples 252 * Number of samples in the rolling average of voltage 253 * measurement. 254 * @param timeoutMs 255 * Timeout value in ms. If nonzero, function will wait for 256 * config success and report an error if it times out. 257 * If zero, no blocking or checking is performed. 258 * @return Error Code generated by function. 0 indicates no error. 259 */ 260 public ErrorCode configVoltageMeasurementFilter(int filterWindowSamples, int timeoutMs); 261 262 /** 263 * Enables voltage compensation. If enabled, voltage compensation works in 264 * all control modes. 265 * 266 * Be sure to configure the saturation voltage before enabling this. 267 * 268 * @param enable 269 * Enable state of voltage compensation. 270 **/ 271 public void enableVoltageCompensation(boolean enable); 272 273 // ------ General Status ----------// 274 275 /** 276 * Gets the bus voltage seen by the device. 277 * 278 * @return The bus voltage value (in volts). 279 */ 280 public double getBusVoltage() ; 281 282 /** 283 * Gets the output percentage of the motor controller. 284 * 285 * @return Output of the motor controller (in percent). 286 */ 287 public double getMotorOutputPercent() ; 288 289 /** 290 * @return applied voltage to motor in volts. 291 */ 292 public double getMotorOutputVoltage() ; 293 294 /** 295 * Gets the temperature of the motor controller. 296 * 297 * @return Temperature of the motor controller (in 'C) 298 */ 299 public double getTemperature() ; 300 301 // ------ sensor selection ----------// 302 /** 303 * Select the remote feedback device for the motor controller. 304 * Most CTRE CAN motor controllers will support remote sensors over CAN. 305 * 306 * @param feedbackDevice 307 * Remote Feedback Device to select. 308 * @param pidIdx 309 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 310 * @param timeoutMs 311 * Timeout value in ms. If nonzero, function will wait for 312 * config success and report an error if it times out. 313 * If zero, no blocking or checking is performed. 314 * @return Error Code generated by function. 0 indicates no error. 315 */ 316 public ErrorCode configSelectedFeedbackSensor(RemoteFeedbackDevice feedbackDevice, int pidIdx, int timeoutMs); 317 318 /** 319 * The Feedback Coefficient is a scalar applied to the value of the 320 * feedback sensor. Useful when you need to scale your sensor values 321 * within the closed-loop calculations. Default value is 1. 322 * 323 * Selected Feedback Sensor register in firmware is the decoded sensor value 324 * multiplied by the Feedback Coefficient. 325 * 326 * @param coefficient 327 * Feedback Coefficient value. Maximum value of 1. 328 * Resolution is 1/(2^16). Cannot be 0. 329 * @param pidIdx 330 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 331 * @param timeoutMs 332 * Timeout value in ms. If nonzero, function will wait for 333 * config success and report an error if it times out. 334 * If zero, no blocking or checking is performed. 335 * @return Error Code generated by function. 0 indicates no error. 336 */ 337 public ErrorCode configSelectedFeedbackCoefficient(double coefficient, int pidIdx, int timeoutMs); 338 339 /** 340 * Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1. 341 * After binding a remote device and signal to Remote Sensor X, you may select Remote Sensor X 342 * as a PID source for closed-loop features. 343 * 344 * @param deviceID 345 * The device ID of the remote sensor device. 346 * @param remoteSensorSource 347 * The remote sensor device and signal type to bind. 348 * @param remoteOrdinal 349 * 0 for configuring Remote Sensor 0, 350 * 1 for configuring Remote Sensor 1 351 * @param timeoutMs 352 * Timeout value in ms. If nonzero, function will wait for 353 * config success and report an error if it times out. 354 * If zero, no blocking or checking is performed. 355 * @return Error Code generated by function. 0 indicates no error. 356 */ 357 public ErrorCode configRemoteFeedbackFilter(int deviceID, RemoteSensorSource remoteSensorSource, int remoteOrdinal, 358 int timeoutMs); 359 360 /** 361 * Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1. 362 * After binding a remote device and signal to Remote Sensor X, you may select Remote Sensor X 363 * as a PID source for closed-loop features. 364 * 365 * @param canCoderRef 366 * CANCoder device reference to use. 367 * @param remoteOrdinal 368 * 0 for configuring Remote Sensor 0, 369 * 1 for configuring Remote Sensor 1 370 * @param timeoutMs 371 * Timeout value in ms. If nonzero, function will wait for 372 * config success and report an error if it times out. 373 * If zero, no blocking or checking is performed. 374 * @return Error Code generated by function. 0 indicates no error. 375 */ 376 public ErrorCode configRemoteFeedbackFilter(CANCoder canCoderRef, int remoteOrdinal, 377 int timeoutMs); 378 379 /** 380 * Select what remote device and signal to assign to Remote Sensor 0 or Remote Sensor 1. 381 * After binding a remote device and signal to Remote Sensor X, you may select Remote Sensor X 382 * as a PID source for closed-loop features. 383 * 384 * @param talonRef 385 * Talon device reference to use. 386 * @param remoteOrdinal 387 * 0 for configuring Remote Sensor 0, 388 * 1 for configuring Remote Sensor 1 389 * @param timeoutMs 390 * Timeout value in ms. If nonzero, function will wait for 391 * config success and report an error if it times out. 392 * If zero, no blocking or checking is performed. 393 * @return Error Code generated by function. 0 indicates no error. 394 */ 395 public ErrorCode configRemoteFeedbackFilter(BaseTalon talonRef, int remoteOrdinal, 396 int timeoutMs); 397 398 /** 399 * Select what sensor term should be bound to switch feedback device. 400 * Sensor Sum = Sensor Sum Term 0 - Sensor Sum Term 1 401 * Sensor Difference = Sensor Diff Term 0 - Sensor Diff Term 1 402 * The four terms are specified with this routine. Then Sensor Sum/Difference 403 * can be selected for closed-looping. 404 * 405 * @param sensorTerm Which sensor term to bind to a feedback source. 406 * @param feedbackDevice The sensor signal to attach to sensorTerm. 407 * @param timeoutMs 408 * Timeout value in ms. If nonzero, function will wait for 409 * config success and report an error if it times out. 410 * If zero, no blocking or checking is performed. 411 * @return Error Code generated by function. 0 indicates no error. 412 */ 413 public ErrorCode configSensorTerm(SensorTerm sensorTerm, FeedbackDevice feedbackDevice, int timeoutMs); 414 415 // ------- sensor status --------- // 416 /** 417 * Get the selected sensor position (in raw sensor units). 418 * 419 * @param pidIdx 420 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. See 421 * Phoenix-Documentation for how to interpret. 422 * 423 * @return Position of selected sensor (in raw sensor units). 424 */ 425 public double getSelectedSensorPosition(int pidIdx); 426 427 /** 428 * Get the selected sensor velocity. 429 * 430 * @param pidIdx 431 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 432 * @return selected sensor (in raw sensor units) per 100ms. 433 * See Phoenix-Documentation for how to interpret. 434 */ 435 public double getSelectedSensorVelocity(int pidIdx); 436 437 /** 438 * Sets the sensor position to the given value. 439 * 440 * @param sensorPos 441 * Position to set for the selected sensor (in raw sensor units). 442 * @param pidIdx 443 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 444 * @param timeoutMs 445 * Timeout value in ms. If nonzero, function will wait for 446 * config success and report an error if it times out. 447 * If zero, no blocking or checking is performed. 448 * @return Error Code generated by function. 0 indicates no error. 449 */ 450 public ErrorCode setSelectedSensorPosition(double sensorPos, int pidIdx, int timeoutMs); 451 452 // ------ status frame period changes ----------// 453 /** 454 * Sets the period of the given control frame. 455 * 456 * @param frame 457 * Frame whose period is to be changed. 458 * @param periodMs 459 * Period in ms for the given frame. 460 * @return Error Code generated by function. 0 indicates no error. 461 */ 462 public ErrorCode setControlFramePeriod(ControlFrame frame, int periodMs); 463 464 /** 465 * Sets the period of the given status frame. 466 * 467 * User ensure CAN Bus utilization is not high. 468 * 469 * This setting is not persistent and is lost when device is reset. If this 470 * is a concern, calling application can use hasResetOccurred() to determine if the 471 * status frame needs to be reconfigured. 472 * 473 * @param frame 474 * Frame whose period is to be changed. 475 * @param periodMs 476 * Period in ms for the given frame. 477 * @param timeoutMs 478 * Timeout value in ms. If nonzero, function will wait for config 479 * success and report an error if it times out. If zero, no 480 * blocking or checking is performed. 481 * @return Error Code generated by function. 0 indicates no error. 482 */ 483 public ErrorCode setStatusFramePeriod(StatusFrame frame, int periodMs, int timeoutMs); 484 485 /** 486 * Gets the period of the given status frame. 487 * 488 * @param frame 489 * Frame to get the period of. 490 * @param timeoutMs 491 * Timeout value in ms. If nonzero, function will wait for 492 * config success and report an error if it times out. 493 * If zero, no blocking or checking is performed. 494 * @return Period of the given status frame. 495 */ 496 public int getStatusFramePeriod(StatusFrame frame, int timeoutMs); 497 498 //----- velocity signal conditionaing ------// 499 /* not supported */ 500 501 //------ remote limit switch ----------// 502 /** 503 * Configures the forward limit switch for a remote source. For example, a 504 * CAN motor controller may need to monitor the Limit-F pin of another Talon 505 * or CANifier. 506 * 507 * @param type 508 * Remote limit switch source. User can choose between a remote 509 * Talon SRX, CANifier, or deactivate the feature. 510 * @param normalOpenOrClose 511 * Setting for normally open, normally closed, or disabled. This 512 * setting matches the Phoenix Tuner drop down. 513 * @param deviceID 514 * Device ID of remote source (Talon SRX or CANifier device ID). 515 * @param timeoutMs 516 * Timeout value in ms. If nonzero, function will wait for config 517 * success and report an error if it times out. If zero, no 518 * blocking or checking is performed. 519 * @return Error Code generated by function. 0 indicates no error. 520 */ 521 public ErrorCode configForwardLimitSwitchSource(RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, 522 int deviceID, int timeoutMs); 523 524 /** 525 * Configures the reverse limit switch for a remote source. For example, a 526 * CAN motor controller may need to monitor the Limit-R pin of another Talon 527 * or CANifier. 528 * 529 * @param type 530 * Remote limit switch source. User can choose between a remote 531 * Talon SRX, CANifier, or deactivate the feature. 532 * @param normalOpenOrClose 533 * Setting for normally open, normally closed, or disabled. This 534 * setting matches the Phoenix Tuner drop down. 535 * @param deviceID 536 * Device ID of remote source (Talon SRX or CANifier device ID). 537 * @param timeoutMs 538 * Timeout value in ms. If nonzero, function will wait for config 539 * success and report an error if it times out. If zero, no 540 * blocking or checking is performed. 541 * @return Error Code generated by function. 0 indicates no error. 542 */ 543 public ErrorCode configReverseLimitSwitchSource(RemoteLimitSwitchSource type, LimitSwitchNormal normalOpenOrClose, 544 int deviceID, int timeoutMs); 545 546 /** 547 * Sets the enable state for limit switches. 548 * 549 * @param enable 550 * Enable state for limit switches. 551 **/ 552 public void overrideLimitSwitchesEnable(boolean enable); 553 554 // ------ local limit switch ----------// 555 /* not supported */ 556 557 // ------ soft limit ----------// 558 /** 559 * Configures the forward soft limit threhold. 560 * 561 * @param forwardSensorLimit 562 * Forward Sensor Position Limit (in raw sensor units). 563 * @param timeoutMs 564 * Timeout value in ms. If nonzero, function will wait for 565 * config success and report an error if it times out. 566 * If zero, no blocking or checking is performed. 567 * @return Error Code generated by function. 0 indicates no error. 568 */ 569 public ErrorCode configForwardSoftLimitThreshold(double forwardSensorLimit, int timeoutMs); 570 571 /** 572 * Configures the reverse soft limit threshold. 573 * 574 * @param reverseSensorLimit 575 * Reverse Sensor Position Limit (in raw sensor units). 576 * @param timeoutMs 577 * Timeout value in ms. If nonzero, function will wait for 578 * config success and report an error if it times out. 579 * If zero, no blocking or checking is performed. 580 * @return Error Code generated by function. 0 indicates no error. 581 */ 582 public ErrorCode configReverseSoftLimitThreshold(double reverseSensorLimit, int timeoutMs); 583 584 /** 585 * Configures the forward soft limit enable. 586 * 587 * @param enable 588 * Forward Sensor Position Limit Enable. 589 * @param timeoutMs 590 * Timeout value in ms. If nonzero, function will wait for 591 * config success and report an error if it times out. 592 * If zero, no blocking or checking is performed. 593 * @return Error Code generated by function. 0 indicates no error. 594 */ 595 public ErrorCode configForwardSoftLimitEnable(boolean enable, int timeoutMs); 596 597 /** 598 * Configures the reverse soft limit enable. 599 * 600 * @param enable 601 * Reverse Sensor Position Limit Enable. 602 * @param timeoutMs 603 * Timeout value in ms. If nonzero, function will wait for config 604 * success and report an error if it times out. If zero, no 605 * blocking or checking is performed. 606 * @return Error Code generated by function. 0 indicates no error. 607 */ 608 public ErrorCode configReverseSoftLimitEnable(boolean enable, int timeoutMs); 609 610 /** 611 * Can be used to override-disable the soft limits. 612 * This function can be used to quickly disable soft limits without 613 * having to modify the persistent configuration. 614 * 615 * @param enable 616 * Enable state for soft limit switches. 617 */ 618 public void overrideSoftLimitsEnable(boolean enable); 619 620 // ------ Current Lim ----------// 621 /* not supported */ 622 623 // ------ General Close loop ----------// 624 /** 625 * Sets the 'P' constant in the given parameter slot. 626 * This is multiplied by closed loop error in sensor units. 627 * Note the closed loop output interprets a final value of 1023 as full output. 628 * So use a gain of '0.25' to get full output if err is 4096u (Mag Encoder 1 rotation) 629 * 630 * @param slotIdx 631 * Parameter slot for the constant. 632 * @param value 633 * Value of the P constant. 634 * @param timeoutMs 635 * Timeout value in ms. If nonzero, function will wait for 636 * config success and report an error if it times out. 637 * If zero, no blocking or checking is performed. 638 * @return Error Code generated by function. 0 indicates no error. 639 */ 640 public ErrorCode config_kP(int slotIdx, double value, int timeoutMs); 641 642 /** 643 * Sets the 'I' constant in the given parameter slot. 644 * This is multiplied by accumulated closed loop error in sensor units every PID Loop. 645 * Note the closed loop output interprets a final value of 1023 as full output. 646 * So use a gain of '0.00025' to get full output if err is 4096u for 1000 loops (accumulater holds 4,096,000), 647 * [which is equivalent to one CTRE mag encoder rotation for 1000 milliseconds]. 648 * 649 * @param slotIdx 650 * Parameter slot for the constant. 651 * @param value 652 * Value of the I constant. 653 * @param timeoutMs 654 * Timeout value in ms. If nonzero, function will wait for 655 * config success and report an error if it times out. 656 * If zero, no blocking or checking is performed. 657 * @return Error Code generated by function. 0 indicates no error. 658 */ 659 public ErrorCode config_kI(int slotIdx, double value, int timeoutMs); 660 661 /** 662 * Sets the 'D' constant in the given parameter slot. 663 * 664 * This is multiplied by derivative error (sensor units per PID loop, typically 1ms). 665 * Note the closed loop output interprets a final value of 1023 as full output. 666 * So use a gain of '250' to get full output if derr is 4096u (Mag Encoder 1 rotation) per 1000 loops (typ 1 sec) 667 * 668 * @param slotIdx 669 * Parameter slot for the constant. 670 * @param value 671 * Value of the D constant. 672 * @param timeoutMs 673 * Timeout value in ms. If nonzero, function will wait for 674 * config success and report an error if it times out. 675 * If zero, no blocking or checking is performed. 676 * @return Error Code generated by function. 0 indicates no error. 677 */ 678 public ErrorCode config_kD(int slotIdx, double value, int timeoutMs); 679 680 /** 681 * Sets the 'F' constant in the given parameter slot. 682 * 683 * See documentation for calculation details. 684 * If using velocity, motion magic, or motion profile, 685 * use (1023 * duty-cycle / sensor-velocity-sensor-units-per-100ms). 686 * 687 * @param slotIdx 688 * Parameter slot for the constant. 689 * @param value 690 * Value of the F constant. 691 * @param timeoutMs 692 * Timeout value in ms. If nonzero, function will wait for 693 * config success and report an error if it times out. 694 * If zero, no blocking or checking is performed. 695 * @return Error Code generated by function. 0 indicates no error. 696 */ 697 public ErrorCode config_kF(int slotIdx, double value, int timeoutMs); 698 699 /** 700 * Sets the Integral Zone constant in the given parameter slot. If the 701 * (absolute) closed-loop error is outside of this zone, integral 702 * accumulator is automatically cleared. This ensures than integral wind up 703 * events will stop after the sensor gets far enough from its target. 704 * 705 * @param slotIdx 706 * Parameter slot for the constant. 707 * @param izone 708 * Value of the Integral Zone constant (closed loop error units X 709 * 1ms). 710 * @param timeoutMs 711 * Timeout value in ms. If nonzero, function will wait for config 712 * success and report an error if it times out. If zero, no 713 * blocking or checking is performed. 714 * @return Error Code generated by function. 0 indicates no error. 715 */ 716 public ErrorCode config_IntegralZone(int slotIdx, double izone, int timeoutMs); 717 718 /** 719 * Sets the allowable closed-loop error in the given parameter slot. 720 * 721 * @param slotIdx 722 * Parameter slot for the constant. 723 * @param allowableCloseLoopError 724 * Value of the allowable closed-loop error in sensor units (or sensor units per 100ms for velocity). 725 * @param timeoutMs 726 * Timeout value in ms. If nonzero, function will wait for 727 * config success and report an error if it times out. 728 * If zero, no blocking or checking is performed. 729 * @return Error Code generated by function. 0 indicates no error. 730 */ 731 public ErrorCode configAllowableClosedloopError(int slotIdx, double allowableCloseLoopError, int timeoutMs); 732 733 /** 734 * Sets the maximum integral accumulator in the given parameter slot. 735 * 736 * @param slotIdx 737 * Parameter slot for the constant. 738 * @param iaccum 739 * Value of the maximum integral accumulator (closed loop error 740 * units X 1ms). 741 * @param timeoutMs 742 * Timeout value in ms. If nonzero, function will wait for config 743 * success and report an error if it times out. If zero, no 744 * blocking or checking is performed. 745 * @return Error Code generated by function. 0 indicates no error. 746 */ 747 public ErrorCode configMaxIntegralAccumulator(int slotIdx, double iaccum, int timeoutMs); 748 749 /** 750 * Sets the peak closed-loop output. This peak output is slot-specific and 751 * is applied to the output of the associated PID loop. 752 * This setting is seperate from the generic Peak Output setting. 753 * 754 * @param slotIdx 755 * Parameter slot for the constant. 756 * @param percentOut 757 * Peak Percent Output from 0 to 1. This value is absolute and 758 * the magnitude will apply in both forward and reverse directions. 759 * @param timeoutMs 760 * Timeout value in ms. If nonzero, function will wait for 761 * config success and report an error if it times out. 762 * If zero, no blocking or checking is performed. 763 * @return Error Code generated by function. 0 indicates no error. 764 */ 765 public ErrorCode configClosedLoopPeakOutput(int slotIdx, double percentOut, int timeoutMs); 766 767 /** 768 * Sets the loop time (in milliseconds) of the PID closed-loop calculations. 769 * Default value is 1 ms. 770 * 771 * @param slotIdx 772 * Parameter slot for the constant. 773 * @param loopTimeMs 774 * Loop timing of the closed-loop calculations. Minimum value of 775 * 1 ms, maximum of 64 ms. 776 * @param timeoutMs 777 * Timeout value in ms. If nonzero, function will wait for 778 * config success and report an error if it times out. 779 * If zero, no blocking or checking is performed. 780 * @return Error Code generated by function. 0 indicates no error. 781 */ 782 public ErrorCode configClosedLoopPeriod(int slotIdx, int loopTimeMs, int timeoutMs); 783 784 /** 785 * Configures the Polarity of the Auxiliary PID (PID1). 786 * 787 * Standard Polarity: 788 * Primary Output = PID0 + PID1, 789 * Auxiliary Output = PID0 - PID1, 790 * 791 * Inverted Polarity: 792 * Primary Output = PID0 - PID1, 793 * Auxiliary Output = PID0 + PID1, 794 * 795 * @param invert 796 * If true, use inverted PID1 output polarity. 797 * @param timeoutMs 798 * Timeout value in ms. If nonzero, function will wait for config 799 * success and report an error if it times out. If zero, no 800 * blocking or checking is performed. 801 * @return Error Code 802 */ 803 public ErrorCode configAuxPIDPolarity(boolean invert, int timeoutMs); 804 805 //------ Close loop State ----------// 806 /** 807 * Sets the integral accumulator. Typically this is used to clear/zero the 808 * integral accumulator, however some use cases may require seeding the 809 * accumulator for a faster response. 810 * 811 * @param iaccum 812 * Value to set for the integral accumulator (closed loop error 813 * units X 1ms). 814 * @param pidIdx 815 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 816 * @param timeoutMs 817 * Timeout value in ms. If nonzero, function will wait for config 818 * success and report an error if it times out. If zero, no 819 * blocking or checking is performed. 820 * @return Error Code generated by function. 0 indicates no error. 821 */ 822 public ErrorCode setIntegralAccumulator(double iaccum, int pidIdx, int timeoutMs); 823 824 /** 825 * Gets the closed-loop error. The units depend on which control mode is in 826 * use. 827 * 828 * If closed-loop is seeking a target sensor position, closed-loop error is the difference between target 829 * and current sensor value (in sensor units. Example 4096 units per rotation for CTRE Mag Encoder). 830 * 831 * If closed-loop is seeking a target sensor velocity, closed-loop error is the difference between target 832 * and current sensor value (in sensor units per 100ms). 833 * 834 * If using motion profiling or Motion Magic, closed loop error is calculated against the current target, 835 * and not the "final" target at the end of the profile/movement. 836 * 837 * See Phoenix-Documentation information on units. 838 * 839 * @param pidIdx 840 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 841 * @return Closed-loop error value. 842 */ 843 public double getClosedLoopError(int pidIdx); 844 845 /** 846 * Gets the iaccum value. 847 * 848 * @param pidIdx 849 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 850 * @return Integral accumulator value (Closed-loop error X 1ms). 851 */ 852 public double getIntegralAccumulator(int pidIdx) ; 853 854 /** 855 * Gets the derivative of the closed-loop error. 856 * 857 * @param pidIdx 858 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 859 * @return The error derivative value. 860 */ 861 public double getErrorDerivative(int pidIdx) ; 862 863 /** 864 * Selects which profile slot to use for closed-loop control. 865 * 866 * @param slotIdx 867 * Profile slot to select. 868 * @param pidIdx 869 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 870 **/ 871 public void selectProfileSlot(int slotIdx, int pidIdx); 872 873 /** 874 * Gets the current target of a given closed loop. 875 * 876 * @param pidIdx 877 * 0 for Primary closed-loop. 1 for auxiliary closed-loop. 878 * @return The closed loop target. 879 */ 880 public double getClosedLoopTarget(int pidIdx); // will be added to JNI 881 882 /** 883 * Gets the active trajectory target position for pid0 using 884 * MotionMagic/MotionProfile control modes. 885 * 886 * @return The Active Trajectory Position in sensor units. 887 */ 888 public double getActiveTrajectoryPosition(); 889 890 /** 891 * Gets the active trajectory target velocity for pid0 using 892 * MotionMagic/MotionProfile control modes. 893 * 894 * @return The Active Trajectory Velocity in sensor units per 100ms. 895 */ 896 public double getActiveTrajectoryVelocity(); 897 898 // ------ Motion Profile Settings used in Motion Magic and Motion Profile 899 /** 900 * Sets the Motion Magic Cruise Velocity. This is the peak target velocity 901 * that the motion magic curve generator can use. 902 * 903 * @param sensorUnitsPer100ms 904 * Motion Magic Cruise Velocity (in raw sensor units per 100 ms). 905 * @param timeoutMs 906 * Timeout value in ms. If nonzero, function will wait for config 907 * success and report an error if it times out. If zero, no 908 * blocking or checking is performed. 909 * @return Error Code generated by function. 0 indicates no error. 910 */ 911 public ErrorCode configMotionCruiseVelocity(double sensorUnitsPer100ms, int timeoutMs); 912 913 /** 914 * Sets the Motion Magic Acceleration. This is the target acceleration that 915 * the motion magic curve generator can use. 916 * 917 * @param sensorUnitsPer100msPerSec 918 * Motion Magic Acceleration (in raw sensor units per 100 ms per 919 * second). 920 * @param timeoutMs 921 * Timeout value in ms. If nonzero, function will wait for config 922 * success and report an error if it times out. If zero, no 923 * blocking or checking is performed. 924 * @return Error Code generated by function. 0 indicates no error. 925 */ 926 public ErrorCode configMotionAcceleration(double sensorUnitsPer100msPerSec, int timeoutMs); 927 928 /** 929 * Sets the Motion Magic S Curve Strength. 930 * Call this before using Motion Magic. 931 * Modifying this during a Motion Magic action should be avoided. 932 * 933 * @param curveStrength 934 * 0 to use Trapezoidal Motion Profile. [1,8] for S-Curve (greater value yields greater smoothing). 935 * @param timeoutMs 936 * Timeout value in ms. If nonzero, function will wait for config 937 * success and report an error if it times out. If zero, no 938 * blocking or checking is performed. 939 * @return Error Code generated by function. 0 indicates no error. 940 */ 941 public ErrorCode configMotionSCurveStrength(int curveStrength, int timeoutMs); 942 943 /** 944 * When trajectory points are processed in the motion profile executer, the MPE determines 945 * how long to apply the active trajectory point by summing baseTrajDurationMs with the 946 * timeDur of the trajectory point (see TrajectoryPoint). 947 * 948 * This allows general selection of the execution rate of the points with 1ms resolution, 949 * while allowing some degree of change from point to point. 950 * @param baseTrajDurationMs The base duration time of every trajectory point. 951 * This is summed with the trajectory points unique timeDur. 952 * @param timeoutMs 953 * Timeout value in ms. If nonzero, function will wait for 954 * config success and report an error if it times out. 955 * If zero, no blocking or checking is performed. 956 * @return Error Code generated by function. 0 indicates no error. 957 */ 958 public ErrorCode configMotionProfileTrajectoryPeriod(int baseTrajDurationMs, int timeoutMs); 959 960 // ------ Motion Profile Buffer ----------// 961 /** 962 * Clear the buffered motion profile in both controller's RAM (bottom), and in the 963 * API (top). 964 * 965 * @return Error Code generated by function. 0 indicates no error 966 */ 967 public ErrorCode clearMotionProfileTrajectories(); 968 /** 969 * Retrieve just the buffer count for the api-level (top) buffer. This 970 * routine performs no CAN or data structure lookups, so its fast and ideal 971 * if caller needs to quickly poll the progress of trajectory points being 972 * emptied into controller's RAM. Otherwise just use GetMotionProfileStatus. 973 * 974 * @return number of trajectory points in the top buffer. 975 */ 976 public int getMotionProfileTopLevelBufferCount(); 977 /** 978 * Push another trajectory point into the top level buffer (which is emptied 979 * into the motor controller's bottom buffer as room allows). 980 * @param trajPt to push into buffer. 981 * The members should be filled in with these values... 982 * 983 * targPos: servo position in sensor units. 984 * targVel: velocity to feed-forward in sensor units 985 * per 100ms. 986 * profileSlotSelect0 Which slot to get PIDF gains. PID is used for position servo. F is used 987 * as the Kv constant for velocity feed-forward. Typically this is hardcoded 988 * to the a particular slot, but you are free gain schedule if need be. 989 * Choose from [0,3] 990 * profileSlotSelect1 Which slot to get PIDF gains for auxiliary PId. 991 * This only has impact during MotionProfileArc Control mode. 992 * Choose from [0,1]. 993 * isLastPoint set to nonzero to signal motor controller to keep processing this 994 * trajectory point, instead of jumping to the next one 995 * when timeDurMs expires. Otherwise MP executer will 996 * eventually see an empty buffer after the last point 997 * expires, causing it to assert the IsUnderRun flag. 998 * However this may be desired if calling application 999 * never wants to terminate the MP. 1000 * zeroPos set to nonzero to signal motor controller to "zero" the selected 1001 * position sensor before executing this trajectory point. 1002 * Typically the first point should have this set only thus 1003 * allowing the remainder of the MP positions to be relative to 1004 * zero. 1005 * timeDur Duration to apply this trajectory pt. 1006 * This time unit is ADDED to the exising base time set by 1007 * configMotionProfileTrajectoryPeriod(). 1008 * @return CTR_OKAY if trajectory point push ok. ErrorCode if buffer is 1009 * full due to kMotionProfileTopBufferCapacity. 1010 */ 1011 public ErrorCode pushMotionProfileTrajectory(TrajectoryPoint trajPt); 1012 /** 1013 * Retrieve just the buffer full for the api-level (top) buffer. This 1014 * routine performs no CAN or data structure lookups, so its fast and ideal 1015 * if caller needs to quickly poll. Otherwise just use 1016 * GetMotionProfileStatus. 1017 * 1018 * @return number of trajectory points in the top buffer. 1019 */ 1020 public boolean isMotionProfileTopLevelBufferFull(); 1021 /** 1022 * This must be called periodically to funnel the trajectory points from the 1023 * API's top level buffer to the controller's bottom level buffer. Recommendation 1024 * is to call this twice as fast as the execution rate of the motion 1025 * profile. So if MP is running with 20ms trajectory points, try calling 1026 * this routine every 10ms. All motion profile functions are thread-safe 1027 * through the use of a mutex, so there is no harm in having the caller 1028 * utilize threading. 1029 */ 1030 public void processMotionProfileBuffer(); 1031 /** 1032 * Retrieve all status information. 1033 * For best performance, Caller can snapshot all status information regarding the 1034 * motion profile executer. 1035 * 1036 * @param statusToFill Caller supplied object to fill. 1037 * 1038 * The members are filled, as follows... 1039 * 1040 * topBufferRem: The available empty slots in the trajectory buffer. 1041 * The robot API holds a "top buffer" of trajectory points, so your applicaion 1042 * can dump several points at once. The API will then stream them into the 1043 * low-level buffer, allowing the motor controller to act on them. 1044 * 1045 * topBufferRem: The number of points in the top trajectory buffer. 1046 * 1047 * btmBufferCnt: The number of points in the low level controller buffer. 1048 * 1049 * hasUnderrun: Set if isUnderrun ever gets set. 1050 * Can be manually cleared by clearMotionProfileHasUnderrun() or automatically cleared by startMotionProfile(). 1051 * 1052 * isUnderrun: This is set if controller needs to shift a point from its buffer into 1053 * the active trajectory point however 1054 * the buffer is empty. 1055 * This gets cleared automatically when is resolved. 1056 * 1057 * activePointValid: True if the active trajectory point is not empty, false otherwise. The members in activePoint are only valid if this signal is set. 1058 * 1059 * isLast: is set/cleared based on the MP executer's current 1060 * trajectory point's IsLast value. This assumes 1061 * IsLast was set when PushMotionProfileTrajectory 1062 * was used to insert the currently processed trajectory 1063 * point. 1064 * 1065 * profileSlotSelect: The currently processed trajectory point's 1066 * selected slot. This can differ in the currently selected slot used 1067 * for Position and Velocity servo modes 1068 * 1069 * outputEnable: The current output mode of the motion profile 1070 * executer (disabled, enabled, or hold). When changing the set() 1071 * value in MP mode, it's important to check this signal to 1072 * confirm the change takes effect before interacting with the top buffer. 1073 * @return Error Code generated by function. 0 indicates no error. 1074 */ 1075 public ErrorCode getMotionProfileStatus(MotionProfileStatus statusToFill); 1076 /** 1077 * Clear the "Has Underrun" flag. Typically this is called after application 1078 * has confirmed an underrun had occured. 1079 * 1080 * @param timeoutMs 1081 * Timeout value in ms. If nonzero, function will wait for config 1082 * success and report an error if it times out. If zero, no 1083 * blocking or checking is performed. 1084 * @return Error Code generated by function. 0 indicates no error. 1085 */ 1086 public ErrorCode clearMotionProfileHasUnderrun(int timeoutMs); 1087 /** 1088 * Calling application can opt to speed up the handshaking between the robot 1089 * API and the controller to increase the download rate of the controller's Motion 1090 * Profile. Ideally the period should be no more than half the period of a 1091 * trajectory point. 1092 * 1093 * @param periodMs 1094 * The transmit period in ms. 1095 * @return Error Code generated by function. 0 indicates no error. 1096 */ 1097 public ErrorCode changeMotionControlFramePeriod(int periodMs); 1098 1099 // ------ error ----------// 1100 /** 1101 * Gets the last error generated by this object. Not all functions return an 1102 * error code but can potentially report errors. This function can be used 1103 * to retrieve those error codes. 1104 * 1105 * @return Last Error Code generated by a function. 1106 */ 1107 public ErrorCode getLastError(); 1108 1109 // ------ Faults ----------// 1110 /** 1111 * Polls the various fault flags. 1112 * 1113 * @param toFill 1114 * Caller's object to fill with latest fault flags. 1115 * @return Last Error Code generated by a function. 1116 */ 1117 public ErrorCode getFaults(Faults toFill) ; 1118 1119 /** 1120 * Polls the various sticky fault flags. 1121 * 1122 * @param toFill 1123 * Caller's object to fill with latest sticky fault flags. 1124 * @return Last Error Code generated by a function. 1125 */ 1126 public ErrorCode getStickyFaults(StickyFaults toFill) ; 1127 1128 /** 1129 * Clears all sticky faults. 1130 * 1131 * @param timeoutMs 1132 * Timeout value in ms. If nonzero, function will wait for config 1133 * success and report an error if it times out. If zero, no 1134 * blocking or checking is performed. 1135 * @return Last Error Code generated by a function. 1136 */ 1137 public ErrorCode clearStickyFaults(int timeoutMs); 1138 1139 // ------ Firmware ----------// 1140 /** 1141 * Gets the firmware version of the device. 1142 * 1143 * @return Firmware version of device. For example: version 1-dot-2 is 1144 * 0x0102. 1145 */ 1146 public int getFirmwareVersion(); 1147 1148 /** 1149 * Returns true if the device has reset since last call. 1150 * 1151 * @return Has a Device Reset Occurred? 1152 */ 1153 public boolean hasResetOccurred(); 1154 1155 // ------ Custom Persistent Params ----------// 1156 /** 1157 * Sets the value of a custom parameter. This is for arbitrary use. 1158 * 1159 * Sometimes it is necessary to save calibration/limit/target information in 1160 * the device. Particularly if the device is part of a subsystem that can be 1161 * replaced. 1162 * 1163 * @param newValue 1164 * Value for custom parameter. 1165 * @param paramIndex 1166 * Index of custom parameter [0,1] 1167 * @param timeoutMs 1168 * Timeout value in ms. If nonzero, function will wait for config 1169 * success and report an error if it times out. If zero, no 1170 * blocking or checking is performed. 1171 * @return Error Code generated by function. 0 indicates no error. 1172 */ 1173 public ErrorCode configSetCustomParam(int newValue, int paramIndex, int timeoutMs); 1174 1175 /** 1176 * Gets the value of a custom parameter. 1177 * 1178 * @param paramIndex 1179 * Index of custom parameter [0,1]. 1180 * @param timeoutMs 1181 * Timeout value in ms. If nonzero, function will wait for config 1182 * success and report an error if it times out. If zero, no 1183 * blocking or checking is performed. 1184 * @return Value of the custom param. 1185 */ 1186 public int configGetCustomParam(int paramIndex, int timeoutMs); 1187 1188 //------ Generic Param API, typically not used ----------// 1189 /** 1190 * Sets a parameter. Generally this is not used. This can be utilized in - 1191 * Using new features without updating API installation. - Errata 1192 * workarounds to circumvent API implementation. - Allows for rapid testing 1193 * / unit testing of firmware. 1194 * 1195 * @param param 1196 * Parameter enumeration. 1197 * @param value 1198 * Value of parameter. 1199 * @param subValue 1200 * Subvalue for parameter. Maximum value of 255. 1201 * @param ordinal 1202 * Ordinal of parameter. 1203 * @param timeoutMs 1204 * Timeout value in ms. If nonzero, function will wait for config 1205 * success and report an error if it times out. If zero, no 1206 * blocking or checking is performed. 1207 * @return Error Code generated by function. 0 indicates no error. 1208 */ 1209 public ErrorCode configSetParameter(ParamEnum param, double value, int subValue, int ordinal, int timeoutMs); 1210 /** 1211 * Sets a parameter. 1212 * 1213 * @param param 1214 * Parameter enumeration. 1215 * @param value 1216 * Value of parameter. 1217 * @param subValue 1218 * Subvalue for parameter. Maximum value of 255. 1219 * @param ordinal 1220 * Ordinal of parameter. 1221 * @param timeoutMs 1222 * Timeout value in ms. If nonzero, function will wait for 1223 * config success and report an error if it times out. 1224 * If zero, no blocking or checking is performed. 1225 * @return Error Code generated by function. 0 indicates no error. 1226 */ 1227 public ErrorCode configSetParameter(int param, double value, int subValue, int ordinal, int timeoutMs); 1228 1229 /** 1230 * Gets a parameter. 1231 * 1232 * @param paramEnum 1233 * Parameter enumeration. 1234 * @param ordinal 1235 * Ordinal of parameter. 1236 * @param timeoutMs 1237 * Timeout value in ms. If nonzero, function will wait for 1238 * config success and report an error if it times out. 1239 * If zero, no blocking or checking is performed. 1240 * @return Value of parameter. 1241 */ 1242 public double configGetParameter(ParamEnum paramEnum, int ordinal, int timeoutMs) ; 1243 /** 1244 * Gets a parameter. 1245 * 1246 * @param paramEnum 1247 * Parameter enumeration. 1248 * @param ordinal 1249 * Ordinal of parameter. 1250 * @param timeoutMs 1251 * Timeout value in ms. If nonzero, function will wait for 1252 * config success and report an error if it times out. 1253 * If zero, no blocking or checking is performed. 1254 * @return Value of parameter. 1255 */ 1256 public double configGetParameter(int paramEnum, int ordinal, int timeoutMs) ; 1257 1258 //------ Misc. ----------// 1259 /** 1260 * @return BaseID of device 1261 */ 1262 public int getBaseID(); 1263 /** 1264 * Returns the Device ID 1265 * 1266 * @return Device number. 1267 */ 1268 public int getDeviceID(); 1269 /** 1270 * @return control mode motor controller is in 1271 */ 1272 public ControlMode getControlMode(); 1273 // ----- Follower ------// 1274 /* in parent interface */ 1275}