Drake
IKTrajectoryHelper Class Reference

This class is a helper for backend implementations of inverse kinematics trajectory planning. More...

#include <drake/attic/multibody/ik_trajectory_helper.h>

Public Member Functions

 IKTrajectoryHelper (int nq, int nT, const double *t, int num_qfree, int num_qdotfree, const IKoptions &ikoptions, const double *dt, const double *dt_ratio)
 
double CalculateCost (const Eigen::MatrixXd &q, const Eigen::MatrixXd &q_nom, int qstart_idx, const Eigen::VectorXd &qdot0, const Eigen::VectorXd &qdotf, bool fix_initial_state, Eigen::MatrixXd *dJ_vec) const
 Calculate the cost given the current q, qdot0, and qdotf. More...
 
int nq () const
 
int nT () const
 
const doublet () const
 
int num_qfree () const
 
int num_qdotfree () const
 
const Eigen::MatrixXd & Q () const
 
const Eigen::MatrixXd & Qa () const
 
const Eigen::MatrixXd & Qv () const
 
const Eigen::MatrixXd & velocity_mat () const
 
const Eigen::MatrixXd & velocity_mat_qd0 () const
 
const Eigen::MatrixXd & velocity_mat_qdf () const
 
const Eigen::MatrixXd & accel_mat () const
 
const Eigen::MatrixXd & accel_mat_qd0 () const
 
const Eigen::MatrixXd & accel_mat_qdf () const
 
const std::vector< Eigen::VectorXd > & t_inbetween () const
 
const std::vector< double > & t_samples () const
 
const std::vector< Eigen::MatrixXd > & dq_inbetween_dqknot () const
 
const std::vector< Eigen::MatrixXd > & dq_inbetween_dqd0 () const
 
const std::vector< Eigen::MatrixXd > & dq_inbetween_dqdf () const
 

Detailed Description

This class is a helper for backend implementations of inverse kinematics trajectory planning.

It holds some general data about the problem being computed and is able to calculate some of the interesting parts of the optimization. It is intended to only hold/calculate data which is independent of the solver being used.

Constructor & Destructor Documentation

◆ IKTrajectoryHelper()

IKTrajectoryHelper ( int  nq,
int  nT,
const double t,
int  num_qfree,
int  num_qdotfree,
const IKoptions ikoptions,
const double dt,
const double dt_ratio 
)
Parameters
nq– number of positions of the body
nT– number of timesteps being planned
t– array of timestep values (of length nT)
num_qfree– number of timesteps for which position variables are free to change during optimization.
num_qdotfree– number of qdot states which are free to change during optimization (in practice, this will be 1 (final only) when the initial state is fixed, and 2 (initial and final) otherwise.
ikoptions– options passed to inverseKinTraj
dt– array of deltas between timestamps (length nT - 1)
dt_ratio– ratio of consecutive values in dt (length nT - 2)

Member Function Documentation

◆ accel_mat()

const Eigen::MatrixXd& accel_mat ( ) const
inline

◆ accel_mat_qd0()

const Eigen::MatrixXd& accel_mat_qd0 ( ) const
inline

◆ accel_mat_qdf()

const Eigen::MatrixXd& accel_mat_qdf ( ) const
inline

◆ CalculateCost()

double CalculateCost ( const Eigen::MatrixXd &  q,
const Eigen::MatrixXd &  q_nom,
int  qstart_idx,
const Eigen::VectorXd &  qdot0,
const Eigen::VectorXd &  qdotf,
bool  fix_initial_state,
Eigen::MatrixXd *  dJ_vec 
) const

Calculate the cost given the current q, qdot0, and qdotf.

Returns
cost
Parameters
q– Current position estimates
q_nom– Estimates for nominal postures
qstart_idx– offset into q to start considering in cost calculations (usually 0 if the initial state is free, and 1 otherwise)
qdot0– current estimate of qdot at timestep 0
qdotf– current estimate of qdot at final timestep
fix_initial_state– true if the initial state is fixed
[out]dJ_vecMatrix to be filled in with the current gradients.

◆ dq_inbetween_dqd0()

const std::vector<Eigen::MatrixXd>& dq_inbetween_dqd0 ( ) const
inline

◆ dq_inbetween_dqdf()

const std::vector<Eigen::MatrixXd>& dq_inbetween_dqdf ( ) const
inline

◆ dq_inbetween_dqknot()

const std::vector<Eigen::MatrixXd>& dq_inbetween_dqknot ( ) const
inline

◆ nq()

int nq ( ) const
inline

◆ nT()

int nT ( ) const
inline

◆ num_qdotfree()

int num_qdotfree ( ) const
inline

◆ num_qfree()

int num_qfree ( ) const
inline

◆ Q()

const Eigen::MatrixXd& Q ( ) const
inline

◆ Qa()

const Eigen::MatrixXd& Qa ( ) const
inline

◆ Qv()

const Eigen::MatrixXd& Qv ( ) const
inline

◆ t()

const double* t ( ) const
inline

◆ t_inbetween()

const std::vector<Eigen::VectorXd>& t_inbetween ( ) const
inline

◆ t_samples()

const std::vector<double>& t_samples ( ) const
inline

◆ velocity_mat()

const Eigen::MatrixXd& velocity_mat ( ) const
inline

◆ velocity_mat_qd0()

const Eigen::MatrixXd& velocity_mat_qd0 ( ) const
inline

◆ velocity_mat_qdf()

const Eigen::MatrixXd& velocity_mat_qdf ( ) const
inline

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