Fly CoDrone in Square Pattern



  • Hi all,

    I have been working through the lessons for the coDrone, but have come across some difficulties trying to have the drone fly in a square pattern as described here in Step #4.
    I have copied the code verbatim, but the gyro seems to either be malfunctioning or the sample code needs adjustment.

    Please see this video to get an idea of what is happening. Thoughts? I have tried to add some additional wait events thinking the drone needed more time to get a reading from the gyro before the next event, but no luck.

    Thanks in advance for the help.



  • Hmmmm, that's not good! It looks like the yaw power is a bit too strong, so it keeps trying to adjust for the amounts. I know the lesson shows -50 and 50, but can you try changing all those yaw values to -20 and 20 instead?

    If you find that's better, we may need to change those code values in the lesson!



  • Hi @robolink_wes, I will be able to test your suggestion tomorrow and will let you know. Thanks



  • Hi @robolink_wes, I was able to try your suggestion plus a few other. Below are the affects when changing the speed of the yaw

    • -20/20 - drone didn't yaw, only hovered

    • -35/35, -45/45, & -75/57 same affect as using -50/50, just back and forth



  • Here is the xml from my project if you would like to try. Thanks!


  • administrators

    @vette99 Make sure to add a 5 second delay after takeoff this makes the CoDrone stabilize. Then make sure to add a little delay after it performs each sendcontrol command like 0.05 seconds. Just to give you some insight on the BLE communication, each request for sensors or setting flight commands need a small delay in order to function properly, otherwise, the Bluetooth gets jammed pack with messages. Also, I recommend testing each loop individually to find the source of error and then stitching them together.



  • Thanks @robolink_arnold. I will give it try and let you know the outcome.


Log in to reply
 

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