You don't actually handle the 'both' case where you test for left/right/both/none. I assume it means that you are pointing the right way and should go into your range check, but the algorithm as described would start turning in an arbitrary direction. Gut feeling is that the two checks for PIR sensors picking up motion should be the same check i.e. your initial state is the same as the state when you are clear of obstacles and motion.I assume you mean to turn towards the motion and then try to move to within 36", but the logic as described would not stop turning if you were already within 36".What do you intend your 'bot to do about motion detection while it is moving forward? It seems to me that it should always steer towards detected motion but what should it do if there is nothing in range and it stops detecting motion?
What do you intend to happen in the case where you detect motion, turn towards it and start moving forwards, and do not detect any further motion? Are you going to stop (and try to reacquire somehow) or keep going forwards blindly in the hope you will run into something eventually?
I was hoping, from the flowchart, that if no more motion was detected it would stop and stay put in the 'Detect motion?' loop until there is motion detected (you can see where the 'move foward' condition loops back up to 'Detect motion?'
I suggest you find out how your motion sensors behave. My experience of PIR sensors is that they're highly sensitive to being moved and need to be stationary (and have time to settle) before they will detect motion. Also that they are motion sensors not presence sensors, so if you intend the bot to detect you and follow you, I suspect you'll need to keep waving at it to maintain its interest.(You can describe this type of behaviour in many ways including FSM and flow charts - to me a FSM seems like a more natural way to express this type of behaviour because I anticipate that your design will have several modes of operation depending what the sensors tell it. But you can describe it using a flow chart if you find that easier to understand. The important thing is to be clear in your own mind what behaviour you're trying to achieve.)
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16