The Circle Tutorial

Course Dates: Open-ended
Enrollment Dates: Enroll Anytime
Who can Enroll: Registered users.
Course Language: English
Price:  FREE
rich kopelow
rich kopelow
Mentor Team y0b0tics!
The Circle Tutorial

About this course

This tutorial is meant to help new teams get up to speed quickly with ZR programming. This tutorial should get you started with SPHERES programming in general and prepare you to complete the Circle Practice Game. Originally the Circle Practice Game was going to be used as a qualification for the 2013 ZR season. While the ZR team has removed this requirement, the skill set hasn't changed. So here you are at the ZR "on-ramp," the next step is up to you.

The Circle Practice Game:
This challenge requires ZR programmers to fly in a circular orbit around another satellite while it sits still at the origin (position <0,0,0>.) You should use the x-axis as your axis of rotation. You can select your own orbital radius and speed but should also keep these as constant as possible while orbiting. You should clearly try to avoid elliptical orbits. 

As is so commonly the case, there are many ways of solving this problem, and as will happen in live ZR competitions, careful attention to the constraints will often make problems simpler than they initially seem. For instance, as this problem is presented the orbit is only in two dimensions which makes certain approaches (i.e. trigonometric ones) much simpler than if it were in three dimensions. In this tutorial I will attempt to give you the ZR skills required to solve this problem across several methods. I will also follow at least one method all the way through to a final solution.

What to Expect:

  • You will see a bunch of example programs with code.
  • You will create and run a bunch of little programs.
  • You will learn the basic ZR API functions.
  • You will learn the basic math and program functions for 3D navigation.
  • You will take away a couple of tools for ZR coding.
  • By the end of the tutorial you should be able to tackle the Circle Practice Game on your own and you will be given a full solution to the problem.

This is not a C/C++ tutorial. You should have a basic understanding of C syntax. The ZR IDE is a C++ development environment, but I will treat it as simple C with the one notable exception that I will take advantage of the fact that C++ allows us to be more flexible with where we define variables and functions.

This tutorial is designed to help you learn to do this on your own. While there will be ample opportunity to cut and paste code, you will be doing yourself and your team a favor by typing the code in yourself instead of using cut and paste - you will simply learn it better. 

Course Structure

  • First Programs
  • Vector Math
    • Vectors and the Known Universe
      • Vectors and the Known Universe
    • Addition and Subtraction
      • Addition and Subtraction
    • How do we get there from here?
      • How do we get there from here?
    • Magnitude and Scaling
      • Magnitude and Scaling
    • Are we there yet?
      • Are we there yet?
    • I can see you!
      • I can see you!
    • Two blocks down and make a right.
      • Two blocks down and make a right.
  • A (very) Little Physics
    • Things at rest tend to stay at rest, Things in motion tend to hit the walls!
      • Things at rest tend to stay at rest, Things in motion tend to hit the walls!
    • It's just a jump to the left, and a step to the right.
      • It's just a jump to the left, and a step to the right.
  • So what about that circle?
    • Putting it all together.
      • Putting it all together
    • Epilogue
      • Epilogue