lsw9021 / MASS

Apache License 2.0
582 stars 109 forks source link

Incorrect state calculating? #23

Open hukaidong opened 4 years ago

hukaidong commented 4 years ago

In function Envirement::GetState, I assumes it gathers relative position and velocity data for human body. Without position of pelvis node (index node 0), in your case, you have 23 node in your model. There should be 22 nodes left recorded index [1, 22].

Here I supposed you excluded pelvis and counting number of node need to processed:

https://github.com/lsw9021/MASS/blob/8a1843331c9218d516a851e7524d07c19d81dab7/core/Environment.cpp#L294

But in real computing step, the code tries to iterate over 21 nodes in middle without very first and last node. (Should the upper bound be nodes.size() instead of nodes.size()-1 ?). And then you appended velocity of pelvis in the end?

https://github.com/lsw9021/MASS/blob/8a1843331c9218d516a851e7524d07c19d81dab7/core/Environment.cpp#L300

As there's no obvious reason for excluding the last node, and not be mentioned anywhere in your project, is this behavior incorrect or intended?