SPIKE Prime 3.x 2023 Python Tutorial: Part 2 Gyro, Distance, Force Sensor

Поділитися
Вставка
  • Опубліковано 28 вер 2024
  • Learn Python for the LEGO® Education SPIKE Prime system in this brand new tutorial series for 2023.
    To buy SPIKE Prime, visit www.mooreed.co...
    Project files:
    github.com/Cre...
    For more in-depth science, building and coding on this subject, visit www.creatoracademy.com.au
    LEGO® is a trademark of the LEGO Group of companies which does not sponsor, authorise, or endorse this video.

КОМЕНТАРІ • 29

  • @solversmind
    @solversmind Рік тому +2

    Hi, very nice tutorials and our FLL team is currently exploring the new Python functionalities. One thing we found is that, even though the gyro resolution is higher (desidegrees), the accuracy is not good, not to the standard we would expect. When we turn 90 degrees, either way, we consistently saw about 3-4 degrees of overshoot, even at a relatively slow speed, a full 360-degree turn (i.e. repeat 90 turn 4 times), you would find a significant overshoot. When dealing with EV3, you can do a less turn to accommodate the "inertia", but the problem with the new Spike, is when we printed out the final gyro reading after the 90-degree turn, the data obviously "lied", i.e., we saw an obvious overshoot, say, 93 degrees, but the console would report around "90x". But from your video, the turn is pretty accurate, any other tips you would like to share? I found some others also report the inaccuracy of the yaw readings... Thanks in advance.

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому +1

      It seems like the gyro sensor in the SPIKE hub isn’t super accurate, but I will need to do more testing.
      I highly recommend using PID to regularly check the robot heading throughout navigation as well, not just for the initial turn. Garry

    • @oliver-beyer
      @oliver-beyer Рік тому

      @@CreatorAcademyAustralia Hello Garry, at first thank you very much for all your help. It would be great if you could do a video explaining on how to use PID to control / adjust turning or moving straight very accurately. I can only find PID-examples and -tutorials for line-following and self-balancing robots (maybe I missed something by searching)...

  • @tomkirbygreen
    @tomkirbygreen Рік тому +3

    Awesome stuff sir! More Python 3.x stuff please.

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому

      More to come! Garry

    • @tomkirbygreen
      @tomkirbygreen Рік тому +1

      @@CreatorAcademyAustralia I'm in the UK and so source my daughters Lego Spike kits locally rather than from your sponsor. I really appreciate your lessons, is there any way I can support your endeavours?

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому

      Thank you so much for following my videos! You can support me by sharing the tutorials with your local schools and students who want to learn robotics. You can also join my channel membership for access to more coding lesson replays for a monthly fee and cancel anytime. Garry

  • @BehindtheCache
    @BehindtheCache Рік тому +2

    Are you going to do a line follow tutorial? I am really wanting our 2nd year + students on my FLL teams to use Python this year. So any help would be greatly appreciated.

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому +4

      I sure am! New Python line following tutorial is coming soon in part 3. Garry

    • @BehindtheCache
      @BehindtheCache Рік тому

      @@CreatorAcademyAustralia great I am looking forward to it. Now the next question how soon?

    • @carrieczerwonka
      @carrieczerwonka Рік тому

      We are having issues with this as well. We actually want the sensor to tell us the color it sees. What libraries do we work with? Thank you

  • @Adwita-y5o
    @Adwita-y5o Місяць тому

    Line 32 is showing error because my motor pair is not defined

  • @rockymountainfacet5958
    @rockymountainfacet5958 Рік тому +6

    I really appreciate what you do and the content you make. I have learned so much because of you. If anyone reads this I highly recommend this channel.

  • @oliver-beyer
    @oliver-beyer Рік тому +1

    Thank you very much for this tutorial! Any idea why LEGO "inverted" yaw-angle values in Python compared to word-blocks, i. e. having positive values for turning left and negative for turning right? Besides, I don't find tilt_angles() in the Python-documentation, only reset_tilt_angles(). Is the documentation "work in progress"?

  • @ProsperTeni
    @ProsperTeni Рік тому +1

    Hello, I app noticed the update on the spike prime app, and I also noticed that your color following technique is from 2 years ago, so I am worried about the compatibility of the old code and the updated app.

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому +1

      Hi! We are still filming the line following video for the new version of SPIKE. Stay tuned! Garry

  • @AdamSingle
    @AdamSingle Рік тому +1

    Great tutorial. Interesting note, on my machine motion_sensor api has a reset_yaw_angle method that throws a missing attribute error when you try to run it. But if I use reset_yaw as in your code, it works, despite the IDE showing it as an error and the API docs and autocomplete telling me to use reset_yaw_angle

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому +1

      That does seem to be strange! When I used to build complicated programs, I would generate documentation from the code. It looks like the code and documentation are out of sync in SPIKE, maybe it will be fixed in a later patch. Garry

  • @tomt453
    @tomt453 Рік тому

    These tutorials are great. Does v3 allow you to move in distance while programming in Python? I've only been able to move by time and velocity. Thanks!

  • @IsaacTimothyMei
    @IsaacTimothyMei 11 місяців тому

    why is it tilt angles

  • @จิรัฎฐ์พงษ์ทองเมือง-ท4ฉ

    I cant reset yaw angle. plz tell me how to do that. thank you.
    AttributeError: 'module' object has no attribute 'reset_yaw_angle'

  • @juliebendig6066
    @juliebendig6066 Рік тому

    Hi, Have you tried this logic in the case of turn the robot twice? We have found that the reset_yaw(0) is not actually setting the yaw value to 0. I see there was a "Fixed delay issue with set yaw angle to 0 block" in Release 3.4 but I am not sure this applies to Python as well.
    Any advice?

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому

      We haven't had an issue with the gyro turns so far, will continue testing. Thanks! Garry

    • @sameerruiwale9201
      @sameerruiwale9201 11 місяців тому

      We are having the same issue - we created a function for gyro turn - and if we call it twice - it doesn't execute and it looks like the yaw value is not being reset.@@CreatorAcademyAustralia

  • @imp20in
    @imp20in Рік тому

    How to get access to your tutorials via channel membership.

    • @CreatorAcademyAustralia
      @CreatorAcademyAustralia  Рік тому

      Hi! Click the ‘Join’ button under the video and follow the prompts. Garry

    • @imp20in
      @imp20in 10 місяців тому +1

      I don’t see any join button