[states] Fixes #256. Remove global mutable variables from statemultibody class
As reported in #256 (closed), there was a race condition occuring with the ddp solve. It turns out that it was because we defined data inside the state variables, and it was being accessed by multiple threads.
THis PR corrects this bug.
Edit:
- WIP status: As discussed, I'll make functions of state and actuation const.
- CI integration: to be dealt with by @cmastall
Merge request reports
Activity
- Resolved by Rohan Budhiraja
@cmastall In order to avoid such a thing happening again, I would like to make all the functions of the state classes as const. This way, we can be sure that in the the future when we use multi-threading, there is no global variable access from the state class. The similar should go for the actuation classes.
Is that okay with you? If so, don't merge this yet.
- Resolved by Rohan Budhiraja
- Resolved by Carlos Mastalli
- Resolved by Carlos Mastalli
- Resolved by Rohan Budhiraja
- Resolved by Carlos Mastalli
- Resolved by Carlos Mastalli
You have a problem with your CI. Please add @gsaurel to debug it.
He's on holidays now, and probably you finish this PR before his return. If so, I will have to push your branch into my fork, and checks that everything work. It's everything is fine, I will merge this PR as it is, so no need to close and create another PR.
added 1 commit
- 58570577 - [states] use block expr, and other comments from !248 (merged)
- Resolved by Rohan Budhiraja
added 1 commit
- e9041802 - [states] make state functions const. and change numdiff/state such that it avoids class variables.
@cmastall This should be ok to merge now.