This class controls the position of a multidimensional mechanism with a trapezoidal velocity profile using the jacobian of the kinematics.
More...
#include <JacobianPosController.h>
|
| JacobianPosController (const std::function< navtypes::Vectord< outputDim >(const navtypes::Vectord< inputDim > &)> &kinematicsFunc, const std::function< navtypes::Matrixd< outputDim, inputDim >(const navtypes::Vectord< inputDim > &)> &jacobianFunc, double maxVel, double maxAccel) |
| Construct a new controller.
|
|
navtypes::Vectord< inputDim > | getCommand (robot::types::datatime_t currTime, const navtypes::Vectord< inputDim > &currPos) const |
| Get the current command position in the input space.
|
|
navtypes::Vectord< inputDim > | getCommand (robot::types::datatime_t currTime, const navtypes::Vectord< inputDim > &currPos, double &cosineSim) const |
| Get the current command position in the input space.
|
|
void | setTarget (robot::types::datatime_t currTime, const navtypes::Vectord< inputDim > &currPos, const navtypes::Vectord< outputDim > &target) |
| Set the target position of the controller.
|
|
bool | hasTarget () const |
| Check if a target has been set.
|
|
void | reset () |
| Reset the controller, unsetting the target.
|
|
template<int outputDim, int inputDim>
class control::JacobianPosController< outputDim, inputDim >
This class controls the position of a multidimensional mechanism with a trapezoidal velocity profile using the jacobian of the kinematics.
Note that the jacobian matrix is of dimension outputDim x inputDim
- Template Parameters
-
outputDim | The dimension of the output vector of the kinematic function. |
inputDim | The dimension of the input vector of the kinematic function. |
- See also
- https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant
◆ JacobianPosController()
template<int outputDim, int inputDim>
Construct a new controller.
- Parameters
-
kinematicsFunc | The kinematics of the mechanism being controlled. This is a function that takes in some input vector (ex: joint angles of an arm) and outputs another vector (ex: the 3d pose of the hand) |
jacobianFunc | The jacobian of the kinematic function. |
maxVels | The maximum velocity in the output space of the kinematic function. |
maxAccels | The maximum acceleration in the output space of the kinematic function. |
◆ getCommand() [1/2]
template<int outputDim, int inputDim>
Get the current command position in the input space.
- Parameters
-
currTime | The current timestamp. |
currPos | The current position, in the input space. |
- Returns
- navtypes::Vectord<inputDim> The target position, in the input space of the kinematic function. Returns the current position if no target is set.
◆ getCommand() [2/2]
template<int outputDim, int inputDim>
Get the current command position in the input space.
- Parameters
-
| currTime | The current timestamp. |
| currPos | The current position, in the input space. |
[out] | cosineSim | Output parameter, gives the cosine similarity of the delta to the returned target and the delta to the commanded target. This similarity may be low if the kinematics of the mechanism do not allow it to move in the commanded direction. May be NaN if stuck in singularity point, in which case the command is the current position. |
- Returns
- navtypes::Vectord<inputDim> The target position, in the input space of the kinematic function. Returns the current position if no target is set.
◆ hasTarget()
template<int outputDim, int inputDim>
Check if a target has been set.
- Returns
- bool True iff a target has been set.
◆ setTarget()
template<int outputDim, int inputDim>
Set the target position of the controller.
- Parameters
-
currTime | The current timestamp. |
currPos | The current position in the input space. |
target | The target position in the output space. |
The documentation for this class was generated from the following file: