Skip to content

Commit

Permalink
Rename input vector to better reflect end effector
Browse files Browse the repository at this point in the history
  • Loading branch information
DrDab committed Oct 3, 2023
1 parent 73e01be commit cc7c16b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/control/PlanarArmController.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,22 @@ template <unsigned int N> class PlanarArmController {
const double safetyFactor;

/**
* @brief Normalize the input vector to have a set radius,
* @brief Normalize the input vector (end-effector position) to have a set radius,
* while maintaining the same direction it did before if it exceeds that set radius.
*
* @param input The input vector to normalize.
* @param radius The radius to normalize the vector to.
* @param eePos The end-effector position to normalize.
* @param radius The radius to normalize the end-effector to.
*/
Eigen::Vector2d normalizeVectorWithinRadius(Eigen::Vector2d input, double radius) {
if (input.norm() > radius) {
Eigen::Vector2d normalizeVectorWithinRadius(Eigen::Vector2d eePos, double radius) {
if (eePos.norm() > radius) {
// TODO: will need to eventually shrink velocity vector until it is within radius
// instead of just normalizing it.

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

return input;
return eePos;
}
};
} // namespace control

0 comments on commit cc7c16b

Please sign in to comment.