From a691bffd584c3a40ba70a0c6b9f3d90a6bd18bcc Mon Sep 17 00:00:00 2001 From: Stephen Roderick Date: Wed, 12 Jan 2011 10:46:43 -0500 Subject: [PATCH] modified JntToJac in class ChainJntToJacSolver to allow for calculation of Jacobian in intermediate frames --- src/chainjnttojacsolver.cpp | 71 +++++++++++++++++++++++++------------------ src/chainjnttojacsolver.hpp | 2 +- 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/chainjnttojacsolver.cpp b/src/chainjnttojacsolver.cpp index b36b8ef..8af2087 100644 --- a/src/chainjnttojacsolver.cpp +++ b/src/chainjnttojacsolver.cpp @@ -45,43 +45,54 @@ namespace KDL } } - int ChainJntToJacSolver::JntToJac(const JntArray& q_in,Jacobian& jac) + int ChainJntToJacSolver::JntToJac(const JntArray& q_in, Jacobian& jac, int segmentNr) { + if(segmentNr<0) + segmentNr=chain.getNrOfSegments(); + + //Initialize Jacobian to zero since only segmentNr colunns are computed + SetToZero(jac) ; + if(q_in.rows()!=chain.getNrOfJoints()||nr_of_unlocked_joints_!=jac.columns()) return -1; - T_tmp = Frame::Identity(); - SetToZero(t_tmp); - int j=0; - int k=0; - Frame total; - for (unsigned int i=0;ichain.getNrOfSegments()) + return -1; + else{ + T_tmp = Frame::Identity(); + SetToZero(t_tmp); + int j=0; + int k=0; + Frame total; + for (unsigned int i=0;i locked_joints); private: -- 1.7.3.5