This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m_groundSteeringAngle = (-1) * m_groundSteeringAngle; // Flip direction of steering because we're going in reverse. Steering is calculated every turn in the universal state.
if (*m_pDetectionDistance > PREFERRED_DISTANCE - MARGIN) {
double estimated_distance;
if (std::abs(*m_pDetectionAngle) < ULTRASONIC_ANGLE_THRESHOLD)
estimated_distance = *m_pFrontDistance;
else
estimated_distance = (*m_pDetectionDistance);
if (estimated_distance > PREFERRED_DISTANCE - MARGIN) {
setState(&BehaviourFollowRobot::atAlignedPositionState); // Stop reversing as soon as we are within the margin of preferred distance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters