Exemplo n.º 1
0
int mainControlInit(void)
{

    ROTATION_DIAMETER = sqrt(pow(WHEELS_DISTANCE, 2) + pow(WHEELS_SPACING, 2));

    motorsInit();
    encodersInit();
    mulimeterInit();
    telemetersInit();
    speedControlInit();
    positionControlInit();
    wallFollowControlInit();
    lineFollowControlInit();
    transfertFunctionInit();
    wallSensorInit();
    adxrs620Init();

    speed_params.initial_speed = 0;

    control_params.wall_follow_state = 0;
    control_params.position_state = 0;
    control_params.speed_state = 0;
    control_params.line_follow_state = 0;

    return MAIN_CONTROL_E_SUCCESS;
}
Exemplo n.º 2
0
int mainControlInit(void)
{
    pid_loop.start_state = FALSE;

    ROTATION_DIAMETER = sqrt(pow(WHEELS_DISTANCE, 2) + pow(WHEELS_SPACING, 2));

    motorsInit();
    encodersInit();
    telemetersInit();
    adxrs620Init();

    speedControlInit();
    positionControlInit();
    wallFollowControlInit();
    lineFollowControlInit();
    transfertFunctionInit();

    positionControlSetPositionType(ENCODERS);
    mainControlSetFollowType(NO_FOLLOW);

    mainControlSetMoveType(STRAIGHT);

    control_params.wall_follow_state = 0;
    control_params.line_follow_state = 0;

    return MAIN_CONTROL_E_SUCCESS;
}