Class MultiJacobianGenerator#

Inheritance Relationships#

Base Type#

Class Documentation#

class MultiJacobianGenerator : public Karana::Core::LockingBase#

Class for the Jacobian generator for a list of Karana::Frame::FrameToFrame related frame pairs for a list of CoordData.

This class builds on the FrameToFrameJacobianGenerator class to support multiple Karana::Frame::FrameToFrame instances. This class is used by the ConstraintKinematicsSolver to compute Jacobians needed for the iterative constraint kinematics algorithms. See the

Jacobians section for more discussion on Jacobians.

CAUTION: When using the “analytical” computation approach (recommended), an important assumption is that the f2f paths contains only regular edges, i.e. one whose transform values that depend on coordinate values do so via regular subhinges and body coordinates, and not in come non-standard way (e.g., subtree CM frames, ephemeris frames). Since this Jacobian generator will not know about these non-standard dependencies, it will not be able to take them into account when computing the Jacobians, so use the “numerical” approach for these situations.

Public Functions

MultiJacobianGenerator(std::string_view name, const std::vector<kc::ks_ptr<kf::FrameToFrame>> &f2fs, kc::ks_ptr<CoordData> coord_data)#

Constructor.

Parameters:
  • name – the name for the new object.

  • f2fs – the list of FrameToFrame’s for the Jacobian generator

  • coord_data – the CoordDatas to use for the Jacobian columns

~MultiJacobianGenerator()#

Destructor.

km::Mat jacobian(bool analytical = true)#

Return the Jacobian matrix.

Return the Jacobian matrix map from the free U velocity coordinate to the f2fs relative velocity.

Parameters:

analytical – If true, use the analytical method, else numerical differencing

Returns:

the Jacobian matrix

km::Mat jacobianDot(bool analytical = true, kc::ks_ptr<Multibody> mb = nullptr)#

Method to compute the time derivative of the Jacobian matrix.

The multibody argument is required when analytical is false, since a total time derivative of the Jacobian needs to be computed, and this requires that all the multibody coordinates be perturbed.

Parameters:
  • analytical – If true, use the analytical method, else numerical differencing

  • mb – the multibody system

Returns:

the time derivative of the Jacobian matrix

km::Mat poseGradient(bool analytical = true)#

Return the pose gradient matrix.

Return the gradient matrix map from the free Q configuration coordinates to the f2fs relative pose

Parameters:

analytical – If true, use the analytical method, else numerical differencing

Returns:

the pose gradient matrix

virtual std::string dumpString(std::string_view prefix, const kc::Base::DumpOptions *options) const override#

Return a formatted string containing information about this object.

Parameters:
  • prefix – String prefix to use for formatting.

  • options – Dump options (if null, defaults will be used).

Returns:

A string representation of the object.

Public Static Functions

static kc::ks_ptr<MultiJacobianGenerator> create(std::string_view name, const std::vector<kc::ks_ptr<kf::FrameToFrame>> &f2fs, kc::ks_ptr<CoordData> coord_data)#

Factory method for creating a new MultiJacobianGenerator instance.

Parameters:
  • name – the name for the new object.

  • f2fs – the list of FrameToFrame’s for the Jacobian generator

  • coord_data – the CoordDatas to use for the Jacobian columns

Returns:

a new MultiJacobianGenerator instance

Protected Functions

void _discard(kc::ks_ptr<Base> &base) override#

Parameters:

base – - Base pointer to the MultiJacobianGenerator to discard.

Protected Attributes

std::vector<kc::ks_ptr<kf::FrameToFrame>> _f2fs#

the frame to frame instances for this multi-jacobian generator

std::unordered_map<kc::ks_ptr<kf::FrameToFrame>, kc::ks_ptr<FrameToFrameJacobianGenerator>> _jac_gen_map#

map of Jacobian generators for each frame to frame instance

kc::ks_ptr<CoordData> _coord_data#

the CoordData with the CoordBases the multi-Jacobian is for