I’ve been trying to learn how to use the gyro in our autonomous programming. I’ve run into an issue where my code works most of the time, however, sometimes when I attempt to “set gyro heading to X degrees”, it fails to do so, instead setting the heading to some seemingly random value. Has anyone else encountered a similar problem?
I did a quick check of set heading and don’t see any issues. Can you post the code you are using or a simple example that demonstrates the problem. Thanks.
Thanks! It won’t let me upload attachments so I’ve linked to a simple program which acts as described. The bot turns correctly only some of the time. I’ve tried this with two different gyros. Perhaps I don’t understand how “set heading” is supposed to work. Any insight you can provide will be most appreciated.
code: https://www.dropbox.com/s/pyj8ecxin9mymg1/gyro_test.iqblocks?dl=1
pdf: https://www.dropbox.com/s/y86tmgs2n2z4lxl/gyro_test.pdf?dl=1
we have confirmed a bug in the sdk. The issue can happen occasionally when setting heading from an event if the gyro is also being used in another event or thread (ie. a when block). It should be fixed in the next release which will be out soon.
Thanks for the update. I look forward to the next release!