Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination array was not long enough. Error #1

Open
Hedronmx opened this issue Jan 13, 2021 · 4 comments
Open

Destination array was not long enough. Error #1

Hedronmx opened this issue Jan 13, 2021 · 4 comments

Comments

@Hedronmx
Copy link

I get the following error when running the project

Destination array was not long enough. Check destIndex and length, and the array's lower bounds:  at System.Array.Copy (System.Array sourceArray, System.Int32 sourceIndex, System.Array destinationArray, System.Int32 destinationIndex, System.Int32 length) [0x000da] in <9577ac7a62ef43179789031239ba8798>:0 
  at Bno055.SerialReceiver.Read () [0x0003c] in /home/carlos/Downloads/bno055-unity-master/Assets/Scripts/SerialReceiver.cs:127 
UnityEngine.Debug:LogWarning(Object)
Bno055.SerialReceiver:Read() (at Assets/Scripts/SerialReceiver.cs:162)
System.Threading.ThreadHelper:ThreadStart()

@benjagooder
Copy link

I'm getting a similar error (see below). @Hedronmx or @thorikawa have you been able to find a solution yet?

Index was outside the bounds of the array.: at Bno055.Tracker.DataReceiver_OnDataReceived (System.String incoming) [0x00067] in D:\Unity\Games\bno055_test_1\Assets\Scripts\Tracker.cs:50

at Bno055.SerialReceiver.Read () [0x000ec] in D:\Unity\Games\bno055_test_1\Assets\Scripts\SerialReceiver.cs:146
UnityEngine.Debug:LogWarning(Object)
Bno055.SerialReceiver:Read() (at Assets/Scripts/SerialReceiver.cs:162)
System.Threading.ThreadHelper:ThreadStart()

@Hedronmx
Copy link
Author

I changed the baud size. I think i used 115200. But i cant remember

@benjagooder
Copy link

My baud size was already 115200. The error behind my issue was that the Tracker code responsible for parsing the Orientation code was looking for a fourth number, but the bunny.ino code only produces 3 numbers (Orientation: 191.81 -7.69 26.31)

I just hardcoded var w to 1f and then all errors went away.
image

@Hedronmx Thanks for the quick response though!! Happy coding! It's my first time playing around with these BNO055 sensors. Pretty cool stuff.

@Hedronmx
Copy link
Author

Oh yeah!! I forgot about that, i did that too, actually you can use those variables in the update function to rotate the model. I think its way better, than rotation.set on line 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants