Skip to content

Generate overload JntToJac function in ChainJntToJacSolver Class to return Jacobians for all segments #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

craigirobot
Copy link

JntToJac() in the ChainJntToJacSolver Class only returns the Jacobian for the specified input segment seg_nr. Some inverse kinematics algorithms require Jacobians for multiple segments in a chain such as those used for commanding self-motion. Because JntToJac already calculates all of the Jacobians leading up to seg_nr, it does not cost anything computationally to return the intermediate Jacobians. The modified JntToJac() returns Jacobians for all of the segments by encapsulating them in a std vector . Note that this is analogous to overloaded function JntToCart() in the ChainFkSolverPos_recursive Class which returns Cartesian frames for all of the intermediate segments in std::vector. JntToJac() follows JntToCart() as a model to generate the same functionality.

Craig Carignan and others added 3 commits May 7, 2025 09:27
… jacobians

JntToJac(const JntArray& q_in, Jacobian& jac, int seg_nr) in ChainJntToJacSolver Class only returns the Jacobian for the specified input segment.  Because this function internally calculates all of the Jacobians leading up to seg_nr, the modified JntToJac() returns all of the intermediate Jacobians by encapsulating them in a std vector <Jacobian>.  Note that this is analogous to overloaded function JntToCart() in the ChainFkSolverPos_recursive Class which returns Cartesian frames for all of the intermediate segments in std::vector<Frame>.
… jacs

Unit test 'JacAllSegments()' was added to solvertest.cpp for the new jnttojac() function that returns the Jacobians for all of the segments.  It uses the (current) JntToJac function to test the return value of the Jacobian for each individual segment.  Note that the index starts at 0 so that segment N has the index N-1 in the Jacobian vector.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant