No announcement yet.

Using FTC in AP-Computer Science Principles class

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using FTC in AP-Computer Science Principles class

    I'm implementing AP-CSP in our small school next year and would like to integrate FTC as the primary project, if possible. Are there other teams already doing this?

  • #2
    This isn't an answer to your question, but...

    If it would be of any help, you could try this FTC Programming 2D Simulator from FTC Team 8397:

    It has three simple robot configurations (two-wheeled, 4-Mechanum wheel, and X-Drive) that you write op modes for, to operate DC Motors, Servo, Gyro, Color Sensor, and Distance Sensors, telemetry, and one gamepad. Adding additional robot configurations is more involved than writing op modes, but still not terribly complicated. Since the video was posted, we have modified the project to use a real gamepad (just plug it in to the computer), instead of the "virtual gamepad" shown on the video. If you try it and have any issues with it, feel free to post to our github repository.


    • #3
      I think it is a great idea. Having something the students find interest in helps tremendously.

      The elephant in the room for it is that you have to write the curriculum. I am developing a crash course for my group, and find most existing tutorials to be lacking. Much of it centers around linear op modes. I wouldn't want to base a robot in such myself. I would like to see my teams learn quality code that is easy to understand an maintain.


      • #4
        I'll offer the quick start curriculum I wrote for our team. It uses regular opModes (I think that is a much better way to do things especially if you look at how LinearOpModes are implemented....)

        It took our students 2 meetings to go through the whole thing. (in pairs)

        After we had four students go through it, we had some of those students lead the next pairs.


        • #5
          I'm not sure what level you are concerned about.
          At one level the rules (RS05) say that you have to use the FTCRobotController app. It has OpMode and LinearOpMode modes, so you are stuck with this standard. There are examples for both modes. One thing to be aware of is in the OpMode mode the IO happens outside of the loop method, so you can't write blocking code. The loop method is what is called repeatedly after start is pressed.

          Or is your concern that the example code isn't written in a style that you would prefer to see? There are teams that have written extensive code that they have shared. One is Titan -


          • #6
            My concern is that the LinearOpMode class is a hack on top of the OpMode class. LinearOpMode is derived from OpMode. Basically the init from OpMode spawns a thread for LinearOpMode.

            If you get a team to implement their classes as OpModes (instead of Linear OpModes) it is a little more difficult to begin with, but allows for some very powerful possibilities. For example, you can create a class that does things on every iteration of the loop that your classes can then derive from. The OpMode method is also much closer to how the Java works for FRC as well as most embedded systems I have worked on. You do have to think a little more about states or steps in your autonomous, but that links into teaching students about state machines.

            I think the example code is fine for example code. However, as I tell my students - they are trying to show an example not give a coding style that is easy to expand off of.



            • #7
              I agree with Alan. I believe LinearOpMode was created to cater to programmers that were tainted by the old NXT programming environment.
              COVID-19 Warning: Your only [earthly] defense against the virus is your immune system. Do everything you can to boost your immune system and/or lighten the workload of your immune system:
              • Avoid unhealthy foods and unhealthy eating/drinking habits,
              • Eliminate stress and anxiety,
              • Get sufficient sleep and avoid fatigue