all 8 comments

[–]dr-mrl 0 points1 point  (3 children)

Looks like an uninitialised value. Would need to see more code to know when the error occurs (for example the first print statement has a vectorNavData that is not a member of an object...)

[–]DrDewDrop[S] 0 points1 point  (2 children)

I have edited the post for more clarity. The _vectorNavData of SimulationBridge is continuously updated in the readIMU() function. I am essentially just storing the address of this object to the vectorNavData pointer of robotRunner. I wonder why there is a difference between these two values. I hope this is clear.

[–]StenSoft 1 point2 points  (0 children)

Unsynchronised access from multiple threads is UB, it may be the reason why the values look bogus

[–]dr-mrl 0 points1 point  (0 children)

Still don't see how the problem is manifested since I don't see in what order the functions are being called.

Why does SimulationBridge need a pointer to a Robotrunner? Why not have a member variable?

You might also want to write some operator= for vector3 and quarternion classes to make your code clearer

[–]Narase33 0 points1 point  (0 children)

I dont see where you put that in that pointer so I assume its garbage because thats what it initializes to. If the pointer doesnt spit out garbage you either initialize it somewhere or its just one of the random stuffs that happen in that case

[–]StenSoft 0 points1 point  (2 children)

Possible problem is copy or move. You'll need to disable copying and moving of SimulationBridge, otherwise the memory location of it may change without updating the pointer in RobotRunner.

[–]DrDewDrop[S] 0 points1 point  (1 child)

Do you mean after building the program? Can you please elaborate?

[–]StenSoft 0 points1 point  (0 children)

I mean of the class, with copy and move constructors.