Skip to main content

Lesson 1: Collecting Cargo

Get ready to start coding with the AI Vision Sensor! In this lesson, you'll code your VEX AIM Coding Robot to detect and pick up a barrel placed randomly on the field. You’ll learn how to use the sensor to help your robot turn toward objects and collect them. Then you’ll create a project where your robot finds, collects, and kicks the barrel—no matter where the barrel starts!

Watch the video below to learn about:  

  • What the AI Vision Sensor is
  • What a macro block is
  • How to use the Turn until object block to turn towards a barrel
  • How to use the Get object block to collect a barrel

Guided Practice

FYI - Setting Velocity

If your robot turns too quickly, it might spin past the object before the AI Vision Sensor has time to detect it. The sensor needs a moment to detect the object and process what it is. Slowing down can give it the time it needs. When you are coding, there are two blocks that can help with this. 

The set move velocity and set turn velocity blocks in VEXcode AIM.

Use the VEXcode API Reference to learn more about the Set move velocity and the Set turn velocity blocks, and how to use them in your project. 

Wrap-Up


Select Next > to explore an example project.