Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
JacobianVelController< outputDim, inputDim > Class Template Reference

This class controls the velocity of a multidimensional mechanism by commanding its position using the jacobian of the kinematics. More...

#include <JacobianVelController.h>

Public Member Functions

 JacobianVelController (const std::function< navtypes::Vectord< outputDim >(const navtypes::Vectord< inputDim > &)> &kinematicsFunc, const std::function< navtypes::Matrixd< outputDim, inputDim >(const navtypes::Vectord< inputDim > &)> &jacobianFunc)
 Construct a new controller.
 
navtypes::Vectord< inputDim > getCommand (robot::types::datatime_t currTime, const navtypes::Vectord< inputDim > &currPos)
 Get the current target position.
 
navtypes::Vectord< inputDim > getCommand (robot::types::datatime_t currTime, const navtypes::Vectord< inputDim > &currPos, double &cosineSim)
 Get the current target position.
 
void setTarget (robot::types::datatime_t currTime, const navtypes::Vectord< outputDim > &targetVel)
 Set the target velocity.
 
bool hasTarget ()
 Check if a target velocity has been set.
 
void reset ()
 Reset the controller, unsetting the current command.
 

Detailed Description

template<int outputDim, int inputDim>
class JacobianVelController< outputDim, inputDim >

This class controls the velocity of a multidimensional mechanism by commanding its position using the jacobian of the kinematics.

Template Parameters
outputDimThe dimension of the output vector of the kinematic function.
inputDimThe dimension of the input vector of the kinematic function.
See also
https://en.wikipedia.org/wiki/Jacobian_matrix_and_determinant

Constructor & Destructor Documentation

◆ JacobianVelController()

template<int outputDim, int inputDim>
JacobianVelController< outputDim, inputDim >::JacobianVelController ( const std::function< navtypes::Vectord< outputDim >(const navtypes::Vectord< inputDim > &)> & kinematicsFunc,
const std::function< navtypes::Matrixd< outputDim, inputDim >(const navtypes::Vectord< inputDim > &)> & jacobianFunc )
inline

Construct a new controller.

Parameters
kinematicsFuncThe 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)
jacobianFuncThe jacobian of the kinematic function.

Member Function Documentation

◆ getCommand() [1/2]

template<int outputDim, int inputDim>
navtypes::Vectord< inputDim > JacobianVelController< outputDim, inputDim >::getCommand ( robot::types::datatime_t currTime,
const navtypes::Vectord< inputDim > & currPos )
inline

Get the current target position.

Parameters
currTimeThe current timestamp.
currPosThe current position of the mechanism, in the kinematic input space.
Returns
navtypes::Vectord<inputDim> The target position of the mechanism, in the kinematic input space.

◆ getCommand() [2/2]

template<int outputDim, int inputDim>
navtypes::Vectord< inputDim > JacobianVelController< outputDim, inputDim >::getCommand ( robot::types::datatime_t currTime,
const navtypes::Vectord< inputDim > & currPos,
double & cosineSim )
inline

Get the current target position.

Parameters
currTimeThe current timestamp.
currPosThe current position of the mechanism, in the kinematic input sequence.
[out]cosineSimOutput 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.
Returns
navtypes::Vectord<inputDim> The target position of the mechanism, in the kinematic input space. Returns the current position if no target is set.

◆ hasTarget()

template<int outputDim, int inputDim>
bool JacobianVelController< outputDim, inputDim >::hasTarget ( )
inline

Check if a target velocity has been set.

Returns
bool True iff a target has been set.

◆ setTarget()

template<int outputDim, int inputDim>
void JacobianVelController< outputDim, inputDim >::setTarget ( robot::types::datatime_t currTime,
const navtypes::Vectord< outputDim > & targetVel )
inline

Set the target velocity.

Parameters
currTimeThe current timestamp.
targetVelThe target velocity, in the output space of the kinematic function.

The documentation for this class was generated from the following file: