Skip to content

Commit 5924257

Browse files
jmirabelolivier-stasse
authored andcommitted
Check that robot control is not NaN.
1 parent c583d56 commit 5924257

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/device.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ void Device::integrate( const double & dt )
526526
{
527527
const Vector & controlIN = controlSIN.accessCopy();
528528

529+
if (sanityCheck_ && controlIN.hasNaN())
530+
{
531+
dgRTLOG () << "Device::integrate: Control has NaN values: " << '\n'
532+
<< controlIN.transpose() << '\n';
533+
return;
534+
}
535+
529536
if (controlInputType_==CONTROL_INPUT_NO_INTEGRATION)
530537
{
531538
assert(state_.size()==controlIN.size()+6);

0 commit comments

Comments
 (0)