Commit c79b1b89 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

[CenterOfMassComputation] Fix invalid memory access.

parent e7cc5556
Pipeline #12877 failed with stage
in 2 minutes and 49 seconds
......@@ -66,13 +66,18 @@ namespace hpp {
// Nullify non-subtree com and mass.
std::size_t root = 0;
std::size_t rootId = roots_[root];
for(std::size_t jid=1; jid<model.joints.size(); ++jid )
{
const std::size_t& rootId = roots_[root];
if(jid == rootId)
{
jid = (std::size_t)data.lastChild[rootId];
root ++;
if (root < roots_.size())
rootId = roots_[root];
else
// After last root, make sure that all joints set to 0.
rootId = model.joints.size();
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment