Example #1
0
  /**
   * Robot-wide initialization code should go here. This default Robot-wide initialization code will
   * be called when the robot is first powered on. It will be called exactly 1 time.
   */
  public void robotInit() {
    // create mechanism components and controllers
    this.components = new ComponentManager();
    this.controllers = new ControllerManager(this.components);

    DashboardLogger.putString(Robot.ROBOT_STATE_LOG_KEY, "Init");
  }
Example #2
0
  /**
   * Initialization code for teleop mode should go here. This code will be called each time the
   * robot enters teleop mode.
   */
  public void teleopInit() {
    // create driver for user's joystick
    this.driver = new UserDriver(this.components);

    this.generalInit();

    // log that we are in teleop mode
    DashboardLogger.putString(Robot.ROBOT_STATE_LOG_KEY, "Teleop");
  }
Example #3
0
  /**
   * Initialization code for disabled mode should go here. This code will be called each time the
   * robot enters disabled mode.
   */
  public void disabledInit() {
    if (this.driver != null) {
      this.driver.stop();
    }

    if (this.controllers != null) {
      this.controllers.stop();
    }

    DashboardLogger.putString(Robot.ROBOT_STATE_LOG_KEY, "Disabled");
  }
Example #4
0
  /**
   * Initialization code for autonomous mode should go here. This code will be called each time the
   * robot enters autonomous mode.
   */
  public void autonomousInit() {
    // reset the position manager so that we consider ourself at the origin (0,0) and facing the 0
    // direction.
    this.components.getPositionManager().reset();

    // Create an autonomous driver
    this.driver = new AutonomousDriver(this.components);

    this.generalInit();

    // log that we are in autonomous mode
    DashboardLogger.putString(Robot.ROBOT_STATE_LOG_KEY, "Autonomous");
  }