Gyroscope in Blocky



  • What can I do with the Gyroscope in Blocky? I feel like I am missing something? The codrone has sensors but I don't really understand how to access them. I can make it fly around and use the keyboard as a remote but isn't there more? Can it read colors or sense how close to the ground it is, or is all this in python? Would love some help.


  • administrators

    @gemslpc We don't have a sample code for that particular activity that can do an emergency stop midflight. Blockly is able to listen for the emergency stop command while simultaneously running code, but in Python, this is not possible. What I suggest is writing a code that uses basic flight commands to fly through each hoop. After each hoop, check the gyroscope and use set_yaw() to turn left or right if you need to correct.



  • Great!
    Would it be possible to give me an example python code of what it would look like to have the codrone check itself in space and correct it's course.
    For example if the challenge was to create a program that allows your codrone to successfully fly thru 3 hoops of various heights turn around and go back thru ( straight line) and land. How would that look in python with an emergency stop?

    The students challenge would read " Your Lieutenant has decided that your flight skills are above par. You and your flight partner have been selected to preform at the local air show. A copy of the course has been provided. Good Luck and as always personal touches are encouraged!"

    Thank-you!


  • administrators

    Hi @GEMSLPC! The gyroscope and sensor functionality for Blockly is still under development. If you want to see how to use our sensors with Python, you can see our documentation page. There you will find the complete list of what CoDrone has on board!


Log in to reply
 

Looks like your connection to Robolink community was lost, please wait while we try to reconnect.