Included Examples#

This page lists the included example projects that demonstrate how to control the VEX AIM Coding Robot using Python over WebSocket.

Basic#

Within the basic directory, you will find:

File Name

Description

ai_vision_for_loops.py

This project uses a proper Python For Loop to iterate through AI Vision data to calculate a mid-point between an Orange Barrel and Blue Barrel.

angled_moving.py

This project moves the robot at 45-degree angles at 100% velocity to trace a diamond shape.

colorful_square.py

This project makes the robot move in a square path, changing the LED color at each color.

conditional_kicker.py

This project will turn the AIM robot to rotate 180 degrees to the right. If the robot is holding an orange barrel, it will kick it; otherwise, the robot will do nothing.

creating_timeouts.py

This project will turns in place while searching for an orange barrel. If none is found within 10 seconds, it plays a ‘fail’ sound and stops the search.

emoji_reaction.py

This project displays a happy emoji when the robot’s angle is stable and a surprised emoji when tilted.

emoji_touch.py

This project changes the screen’s emoji based on how many times the screen has been pressed, showing a different expression for each press.

get_blue_barrel.py

This project will look for blue barrel , move to it, celebrates once it has the blue barrel.

led_color_cycle.py

This project cycles through each LED color, pausing for one second between each.

level_detector.py

In this project, the screen will show a green background with the word “FLAT” when the robot is not tilted. If the robot tilts, the screen will turn red and say “TILTED”.

move_and_stop.py

This project moves the robot forward 300 mm and plays the “complete” sound once it has completed movement.

move_to_apriltag.py

This project turns the robot until it detects AprilTag ID 1, then moves toward it.

multi_step_pickup.py

This project turns right until an orange barrel is found, moves backwards, and places it.

musical_thread.py

This project will play a song (using notes) in one thread while driving in another thread at the same time.

object_detection_alert.py

This project will move the AIM robot forward until any cargo is found. When detected, the robot will play a beep sound, and stop all robot movement.

obstacle_avoidance.py

This project will move the AIM robot forward until any cargo is found. When detected, the robot will turn right for 45 degrees.

screen_drawing.py

This project draws a line, square, and circle on its screen, showing the name of each shape while it’s being drawn.

sensor_monitor.py

This project will print the timer, heading, and yaw orientation values to the robot screen.

tap_to_start.py

This project waits for a touchscreen tap before moving forward 200 mm and displaying an emoji at the end.

timing_events.py

This project starts driving forward but stops automatically once five seconds have elapsed, then displays “Time’s up!” on the screen.

Advanced#

Within the advanced directory, you will find:

File Name

Description

aim_example_base.py

Provides AimExample base class, which parses arguments, tries to find the IP of AIM Robot, and initializes aim.Robot instance.

fpv.py

This project allows the user to control the robot while streaming images from the camera. LEDs are green when robot is moving, red when robot is stopped.

multiple_robots.py

This project makes two robots to move in a square path, changing the LED color at each color.

play_sounds.py

The robot will play a local sound file, then play some notes from Beethoven’s Symphony No. 5.

save_jpg.py

Save image in JPEG format to filesystem given by filename, defaulting to aim_img.jpg

stream_video.py

JPEG image stream, using opencv to display to screen.