I've looked online for instructions for this but am not sure of the proper way to word what I'm looking for because the hits I'm getting aren't exactly what I'm looking for.
I am attempting to make a cat toy laser to mount to my wall. I am using this as the basis for my design. However, I would like to limit the movement of the servos to only the zones as defined here (top view of living room) in order to avoid the laser going on/behind furniture. I understand how to define the ranges independently, but I'm not sure how to limit the horizontal value based on the vertical value. Originally I was thinking to simply do that, but then realized this would still allow the servos to select positions that would take the path of the laser over furniture. Instead, I need to define "zones" of available positions that are selected prior to the specific positions being genreated. Additionally, before moving between Zones 1, 3 and 4 in the picture, it needs to return to zone 2 so that the laser doesn't move over furniture and out of the cat's vision.
So the steps would be: 1- Randomly select any zone if in zone 2 OR randomly select current zone or zone 2 if in zones 1,3 or 4 2- Randomly select horizontal/vertical position within selected zone
Anyone have any suggestions on how to do this? I have little experience doing anything like this and am not sure what to search for to get me in the right direction.