Skip to content

Commit

Permalink
do not kill robot if it collides, just give it a penalty.
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJerez committed Sep 28, 2024
1 parent fe75d2b commit 6807a81
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,6 @@ namespace ndAdvancedRobot
}
}

if (ModelCollided())
{
return true;
}

return false;
}

Expand Down Expand Up @@ -518,6 +513,11 @@ namespace ndAdvancedRobot
return ND_DEAD_PENALTY;
}

if (ModelCollided())
{
return ND_DEAD_PENALTY;
}

const ndMatrix effectorMatrix(m_effectorLocalTarget * m_arm_4->GetBody0()->GetMatrix());
const ndMatrix baseMatrix(m_effectorLocalBase * m_base_rotator->GetBody1()->GetMatrix());
const ndMatrix currentEffectorMatrix(effectorMatrix * baseMatrix.OrthoInverse());
Expand Down Expand Up @@ -574,7 +574,7 @@ namespace ndAdvancedRobot

bool hitaLimit = m_arm_0->GetJointHitLimits() || m_arm_1->GetJointHitLimits();

observation->m_hitLimit = ndBrainFloat (hitaLimit ? 1.0 : 0.0f);
observation->m_hitLimit = ndBrainFloat (hitaLimit ? 1.0f : 0.0f);
observation->m_collided = ndBrainFloat(ModelCollided() ? 1.0f : 0.0f);

const ndMatrix effectorMatrix(m_effectorLocalTarget * m_arm_4->GetBody0()->GetMatrix());
Expand Down

0 comments on commit 6807a81

Please sign in to comment.