Interested in autonomous vehicles and curious how to make your own? Well, we have what you are looking for! This activity demonstrates how to make an autonomous car out of a modified AdventureBot. However, you can use a Roli Rover or Six Hexapod as well!
Using additional EZ-Bits, the AdventureBot was modified for the camera to sit on the left of the robot. This allows the robot to see the lines on the road and maintain the lines within the center of the camera view by turning the robot. The floor is darker than the lines, without bright reflection from ceiling lights. A custom multi-color filter was created to identify the lines on the road. Creating a custom color filter is also covered in the Detect Multiple Colors activity.
The EZ-Builder App for AdventureBot and Battle Flipper used in this video activity can be downloaded here.
What You Will Need
- An assembled AdventureBot, BattleFlipper, Six or Roli with charged battery
- For AdventureBot and Six, you will need an additional EZ-Bit Servo to position the camera. Available in our store. BattleFlipper,
you can recycle the flipper servo. And for Roli, you can angle his camera looking down with existing servo.
- A Windows PC with EZ-Builder installed
Real Test Results
We took this robot to a real autonomous car testing track. Interested in the results? Watch the video...
DIY Race Track At Home
We taped small slits of bright green paper to the floor and created a track. The slits were separated to simulate the lanes of a road.
Using With Roli or Six
This demo uses an AdventureBot, however it can easily be used with a Roli or Six. The good news about a Roli is the camera can be angled down to look at the ground. However, Six will require an additional servo to angle the camera down.
How The Camera Control was Configured
Step 1: A custom color filter was created to identify only the lanes on the floor. This uses the MultiColor option, and the tutorial to learn how to use it can be viewed HERE.
Step 2: The camera control configuration is pressed to load the configuration setting window.
Step 3: For Roli, AdventureBot and Battle Flipper: Enable the following checkboxes for Movement Tracking, Allow Forward Movement, Allow Left/Right Movement, Use Speed Settings, and Dynamic Speed When Turning. This settings will allow the robot move forward, left and right at different speeds when it detects an object. The object we will use is the Multi Color that was trained earlier in this tutorial.
For Six: Do NOT check Dynamic Speed When Turning for SIX robot. Enable the following checkboxes for Movement Tracking, Allow Forward Movement, Allow Left/Right Movement, and Use Speed Settings. This settings will allow the robot move forward, left and right at different speeds when it detects an object. The object we will use is the Multi Color that was trained earlier in this tutorial.
Step 4: By default, the Forward and Turn speeds may be too fast and the robot will simply drive away too quickly. This means the Forward, Left and Right speed values for tracking can be modified. Lower the values and press the TEST button for Forward to verify a slow forward speed. Then do the same for Left and Right. Press the Test buttons after each speed adjustment. Press STOP to stop the robot from moving.
Step 5: For Roli, AdventureBot and Battle Flipper, the Dynamic Speed When Turning values can now be adjusted. Do NOT check Dynamic Speed When Turning if using a Six robot. By default, these settings will have a value of 1. This is usually an okay value, however you can experiment and read the question mark help to fine tune.
Step 6: Switch to SCRIPTS tab and configure the Sort to TopToBottom. This will prioritize the detected objects at the top of the screen first. Meaning, the robot will follow the objects at the top of the screen higher priority than objects at the bottom.
Step 7: Press SAVE on the camera configuration window and enable Multi Color Tracking. Place the robot on the track and it should begin tracking.
Things To Note
If the robot is detecting objects other than the specified color, consider tweaking the filter to narrow the color range and remove False Positives.
Building The Robot with AdventureBot or BattleFlipper
The robot is a modified AdventureBot with additional EZ-Bits. However, you could use an AdventureBot with no modifications and have the robot follow the line. The difference with our modification moves the camera to the left and aims the camera down to see the road lane. If you use an unmodified AdventureBot, the camera may be facing too high and not detect the lines on the ground.
Continue to Next lesson