
cparks328
Hi all,
I'm making a small robot to run a maze and find a small red ball. I have sonar and the camera mounted next to it. The sonar works fine, but the color tracking does not seem to work. The camera is not mounted to a servo, as you can see in the picture. I have the camera config set for movement tracking, forward, left and right turning. It seems like the sonar overrides the tracking. Also, is there a way to get the robot to stop in front of the object?
There are 4 of us at work that are using different systems, E-Z Robot (me), 2 Raspberry Pi users and and an Arduino.
And, unless the red ball is always in front of the robot camera, having the the Movement Tracking enabled will only make the robot follow the ball. So the ball has to be in front of the camera. If the ball isn't in front of the camera, it can't see it, so how can it track it? It can't.
Lastly, what sonar control are you using for navigation? Use the Ultrasonic Radar Control.
It is incredibly easy to achieve what you're wanting to do - however, the blue question marks were not used to read what the options do before enabling them. Such as, the Movement Tracking.
I would recommend a few things - which would be super super super super easy to achieve your goal.
1) Use the Ultrasonic Radar Control so the robot will begin navigating the maze. Once you have the Ultrasonic Radar Control working, and the robot is indeed navigating correctly, move to the next step.
2) Add the camera control. Do not enable movement tracking, because you're not following anything. Instead, switch to the SCRIPTS tab and edit the "Tracking Start" script..
Press the EDIT button on that script and put create some easy code that does something like
Code:
Or use blockly...
3) Save the script, save the configuration and return to the Camera Control and set the Tracking Type to Color
4) Fine tune the color brightness so it detects the redness of the ball and nothing else. You will know because the robot will speak when it sees the ball. Also the bottom of the camera control shows TRACKING in red when it detects the object
5) Set your robot mouse loose and you win
The entire project is super easy and should look like this when it is done...
@DJ beat me to it...
mazeexplore.EZB
You could very well do that, by simply putting this in your Tracking Start script in the camera config
Code:
Start Exploring script can begin the whole process like this. Which enables the red color tracking, unpauses the sonar sensor and begins moving at a slow speed.
mazeexplore.EZB
Thanks again, the community here is the best.