Project

General

Profile

Revision 4026134b

ID4026134b3992a1c11aa320bef116820fab7547b0
Parent 4bdd00ba
Child c33e5aa4

Added by Alex Zirbel over 3 years ago

Added Behavior::wait() to spinOnce for a duration.

Also added maze_solve_simple which always turns right.

View differences:

scout/libscout/src/Behavior.cpp
106 106
    ros::spinOnce();
107 107
    return;
108 108
}
109

  
110
/**
111
 * Calls ros::spinOnce() in a loop until the duration is up.
112
 */
113
void Behavior::wait(float duration)
114
{
115
    ros::Rate r(WAIT_HZ);
116
    int ticks = int(duration * 100);
117
    for (int i = 0; i < ticks; i++)
118
    {
119
        spinOnce();
120
        r.sleep();
121
    }
122
}

Also available in: Unified diff