Skip to content

Commit

Permalink
Fix return type
Browse files Browse the repository at this point in the history
  • Loading branch information
DrDab committed Oct 3, 2023
1 parent edff9dd commit affcec0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/control/PlanarArmController.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ template <unsigned int N> class PlanarArmController {
* @param input The input vector to normalize.
* @param radius The radius to normalize the vector to.
*/
void normalizeVectorWithinRadius(Eigen::Vector2d input, double radius) {
Eigen::Vector2d normalizeVectorWithinRadius(Eigen::Vector2d input, double radius) {
if (input.norm() > radius) {
// TODO: will need to eventually shrink velocity vector until it is within radius
// instead of just normalizing it.

input.normalize();
input *= radius;
}

return input;
}

/**
Expand All @@ -87,8 +89,7 @@ template <unsigned int N> class PlanarArmController {

// bounds check (new pos + vel vector <= sum of joint lengths)
double radius = kin.getSegLens().sum() * safetyFactor;
normalizeVectorWithinRadius(pos, radius);
return pos;
return normalizeVectorWithinRadius(pos, radius);
}

/**
Expand Down

0 comments on commit affcec0

Please sign in to comment.