
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

These two threads will need to communicate with each other: the simplest mechanism will be to have a boolean variable avoid, which is set to true in the ObstacleAvoidance thread when this thread wants to take control. When this variable is set to true, then the RandomWalk thread suspends its actions, allowing the ObstacleAvoidance thread to take action. Start by just implementing the RandomWalk thread, and tweak it until it generates the sort of behaviour you want.