Changes between Version 4 and Version 5 of ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous


Ignore:
Timestamp:
Nov 3, 2019, 8:42:47 PM (6 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/Autonomous

    v4 v5  
    2323
    2424*  In robotInit() instantiate the Encoder and Motor objects
    25   For PWM Motor Controller robots (Macadamia):
     25  * For PWM Motor Controller robots (Macadamia):
    2626  {{{   
    2727    // Quadrature encoder has A and B channels connected to DIO0,1, DIO2,3
     
    3636    rightMotor = new Talon(1);
    3737  }}}
    38 
    39   For CAN Motor Controller robots (Hazelnut):
     38  * For CAN Motor Controller robots (Hazelnut):
    4039  {{{
    4140    // CAN motor controllers connected to CAN bus (addrs 3,4)
     
    5150
    5251* In robotPeriodic() display the encoder values
    53 
    5452  * For PWM controller robots (Macadamia):
    5553  {{{
     
    5755    SmartDashboard.putNumber("Right", rightEncoder.getDistance());
    5856  }}}
    59 
    6057  * For CAN motor controllers (Hazelnut) note the use of the [https://www.ctr-electronics.com/downloads/api/java/html/classcom_1_1ctre_1_1phoenix_1_1motorcontrol_1_1can_1_1_base_motor_controller.html#afb934a11682e710df123eec35aba1ba9 getSelectedFeedbackSensor()] method of the motor controller object which returns raw encoder counts. 
    6158  Add the following function to the Robot class:
     
    6360     double raw2inches(int raw_count, int counts_per_rotation, double wheel_diameter) {
    6461        return (raw_count / counts_per_rotation) * (3.141492 * wheel_diameter);
    65   {{{
     62     }
     63  }}}
    6664  Add the following to the robotPeriodic() method:
    6765    // Encoders connected to CAN controller return raw counts