Skip to content

Commit

Permalink
Clip too big reference speeds instead of aborting setter
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jan 17, 2024
1 parent 5adb74f commit 32aec36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ bool TechnosoftIposEmbedded::setRefSpeedRaw(int j, double sp)

if (sp <= 0.0)
{
yCIWarning(IPOS, id()) << "Illegal negative speed provided:" << sp;
yCIError(IPOS, id()) << "Illegal reference speed provided:" << sp;
return false;
}
else if (sp > maxVel)
{
yCIWarning(IPOS, id()) << "Reference speed exceeds maximum velocity, i.e." << maxVel.load();
return false;
sp = maxVel;
}

double value = std::abs(degreesToInternalUnits(sp, 1));
Expand All @@ -88,7 +88,7 @@ bool TechnosoftIposEmbedded::setRefAccelerationRaw(int j, double acc)

if (acc <= 0.0)
{
yCIWarning(IPOS, id()) << "Illegal negative acceleration provided:" << acc;
yCIError(IPOS, id()) << "Illegal reference acceleration provided:" << acc;
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ bool TechnosoftIposExternal::setRefSpeedRaw(int j, double sp)

if (sp <= 0.0)
{
yCIWarning(IPOS, id()) << "Illegal reference speed provided:" << sp;
yCIError(IPOS, id()) << "Illegal reference speed provided:" << sp;
return false;
}
else if (sp > maxVel)
{
yCIWarning(IPOS, id()) << "Reference speed exceeds maximum velocity:" << sp << ">" << maxVel.load();
return false;
sp = maxVel;
}

if (trajectory.isActive())
Expand All @@ -108,7 +108,7 @@ bool TechnosoftIposExternal::setRefAccelerationRaw(int j, double acc)

if (acc <= 0.0)
{
yCIWarning(IPOS, id()) << "Illegal reference acceleration provided:" << acc;
yCIError(IPOS, id()) << "Illegal reference acceleration provided:" << acc;
return false;
}

Expand Down

0 comments on commit 32aec36

Please sign in to comment.