Patch for ChainJntToJacSolver::JntToJac() to Calculate Jacobian in Intermediate Frames

Modification of JntToJac() in ChainJntToJacSolver class to Calculate Jacobian in Intermediate Frames

Files affected:
- chainjnttojacsolver.cpp
- chainjnttojacsolver.hpp

JntToJac() in ChainJntToJacSolver class currently only returns the Jacobian at the terminal segment of a chain. Several control/kinematics algorithms requirement the Jacobian for other points in a chain such as at the elbow. This patch therefore modifies JntToJac() to accommodate the calculation of the Jacobian in the intermediate segment specified by the additional input argument segment_nr. This functionality is equivalent to the ability of JntToCart() in the ChainJntToJacSolver class to return an intermediate frame, and the modifications for JntToJac() derive directly from JntToCart().

Additionally, note that Jacobian is initialized to zero since only the first segment_nr columns are computed. This initialization should probably be done regardless of the subject of this patch so that it returns zeros instead of random values in the event of an error.

AttachmentSize
0001-modified-JntToJac-in-class-ChainJntToJacSolver-to-al.patch4.33 KB
Ruben Smits's picture

Patch for ChainJntToJacSolver::JntToJac() to Calculate Jacobian

On 11 Mar 2011, at 14:53, CARIGNAN, CRAIG R. (GSFC-442.0)[Bastion Technologies, Inc.] wrote:

> Modification of JntToJac() in ChainJntToJacSolver class to Calculate Jacobian in Intermediate Frames
>
> Files affected:
> - chainjnttojacsolver.cpp
> - chainjnttojacsolver.hpp
>
> JntToJac() in ChainJntToJacSolver class currently only returns the Jacobian at the terminal segment of a chain. Several control/kinematics algorithms requirement the Jacobian for other points in a chain such as at the elbow. This patch therefore modifies JntToJac() to accommodate the calculation of the Jacobian in the intermediate segment specified by the additional input argument segment_nr. This functionality is equivalent to the ability of JntToCart() in the ChainJntToJacSolver class to return an intermediate frame, and the modifications for JntToJac() derive directly from JntToCart().
>
> Additionally, note that Jacobian is initialized to zero since only the first segment_nr columns are computed. This initialization should probably be done regardless of the subject of this patch so that it returns zeros instead of random values in the event of an error.
>

The patch looks nice, thanks. I'll include it ASAP.

-- Ruben