示例#1
0
/**
 * Stop the robot.
 */
void stopPosition(PidMotion* pidMotion, bool maintainPositionValue, OutputStream* notificationOutputStream) {
    updateTrajectoryAndClearCoders();

    if (maintainPositionValue) {
        maintainPosition(pidMotion, notificationOutputStream);
    }
    
    // Avoid that the robot considered he will remain the initial speed for next move (it is stopped).
    clearInitialSpeeds(pidMotion);

    DualHBridgeMotor* dualHBridgeMotor = pidMotion->dualHBridgeMotor;
    stopMotors(dualHBridgeMotor);
}
示例#2
0
/**
 * Stop the robot.
 */
void stopPosition(bool maintainPositionValue) {
    updateTrajectoryAndClearCoders();

    if (maintainPositionValue) {
        maintainPosition();
    } else {
        // Avoid that robot reachs his position, and stops the motors
        setMustReachPosition(false);
    }
    // Avoid that the robot considered he will remain the initial speed for next move (it is stopped).
    clearInitialSpeeds();

    stopMotors();
}