RGS

Link to 2024 materials

WRO 2025

Sec 1

CoSpace

  • For beginners
  • Setup compilation in vscode
    1. Open up your cospace C file in vscode.
    2. Press “Ctrl – Shift – b”. You should see a message “No build task to run found. Configure build task”. Click on that message.
    3. Click on “Create tasks.json file from template”
    4. Click on “Others”. This should open a new “tasks.json” file.
    5. Delete everything in you “tasks.json” and replace it with the content of this link. Save your “tasks.json” (Ctrl – s).
    6. Go back to your C file, and press “Ctrl – Shift – b”. Your file should now be compiled into a dll.

Robocup OnStage

  • Detecting the balls
  • Sending commands
    • When sending data from an OpenMV Cam to an ESP32, the easiest way would be to use a UART connection.
    • To wire the UART connection, connect the TX pin of one device to the RX pin of the other device (…and vice versa). The GND pin of one device should also be connected to the GND pin of the other device.
    • OpenMV Cam. Read the docs to learn how to send data. You can find the TX and RX pin position here (…use UART3. Avoid UART1). When sending data, it’s often best to use string format. Be sure to add a ‘\n’ at the end of the line.
    • ESP32. Read this page on initializing the UART and the TX RX pin numbers. And this page on how to readline. Do not use UART0 (…UART2 is fine, and you can use the default pins for that).

Robocup Rescue Line (OpenMV Cam)

  • If you are using the OpenMV Cam, you’ll need to…
    • Detect the black line and green box. Install the OpenMV IDE. Open the IDE and load the multi-color blob tracking example. Try it out, and tune it to detect the black line.
    • When tuning, set the preview to LAB mode, select a region that you’re interested in (eg. black line), and look at the histogram to determine a suitable threshold. Note that in LAB color space, the L represents brightness, and should be low for black.
    • By default, the example uses the entire frame for detection. That’s probably too large. Use the crop function to reduce the detection area.
    • If you’re using the spike prime, you should use PUPremote to communicate between the OpenMV cam and Spike Prime. Download the python files from this github page. pupremote.py needs to be uploaded to your openmv cam, while pupremote_hub.py needs to be uploaded to your spike prime (via pybricks software).
    • Other examples.
      • OpenMV IDE contains an example of a line following code (Image Processing -> Black grayscale line following).
      • Antons Mindstorm provides another example of line following code here.
      • Neither are recommended, because… 1) You should write your own code. 2) Both of these are inadequate for robocup; you’ll need to modify them, so it’s better to start with simple code that you can understand well.
      • But feel free to read through and understand how these examples work.

Robocup Rescue Line (EV3)

Robocup Rescue Line (Generic stuff)

These slides are old, so the sample code are based on the old EV3 software. You won’t be able to use them directly, but the concepts and approach remains the same.

IoTy

IoTy is a platform for programming the ESP32 using blocks or Python. This is useful for OnStage, Robocup Rescue Line (…if you’re building non-Lego robots), and for general electronics projects (eg. for WRO open category).

Others