Skip to content

Commit 93d4a05

Browse files
authored
[DQ_SerialManipulatorDenso.cpp] Added the pose_jacobian_derivative method. (#54)
1 parent 7a96866 commit 93d4a05

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

src/robot_modeling/DQ_SerialManipulatorDenso.cpp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,36 @@ MatrixXd DQ_SerialManipulatorDenso::raw_pose_jacobian(const VectorXd &q_vec, con
105105
*/
106106
MatrixXd DQ_SerialManipulatorDenso::raw_pose_jacobian_derivative(const VectorXd &q, const VectorXd &q_dot, const int &to_ith_link) const
107107
{
108-
throw std::runtime_error(std::string("pose_jacobian_derivative is not implemented yet."));
108+
_check_q_vec(q);
109+
_check_q_vec(q_dot);
110+
_check_to_ith_link(to_ith_link);
111+
112+
int n = to_ith_link+1;
113+
DQ x_effector = raw_fkm(q,to_ith_link);
114+
MatrixXd J = raw_pose_jacobian(q,to_ith_link);
115+
VectorXd vec_x_effector_dot = J*q_dot.head(n);
116+
DQ x = DQ(1);
117+
MatrixXd J_dot = MatrixXd::Zero(8,n);
118+
119+
for(int i=0;i<n;i++)
120+
{
121+
const DQ w = k_;
122+
const DQ z = 0.5*x*w*conj(x);
123+
124+
VectorXd vec_zdot;
125+
if(i==0)
126+
{
127+
vec_zdot = VectorXd::Zero(8,1);
128+
}
129+
else
130+
{
131+
vec_zdot = 0.5*(haminus8(w*conj(x)) + hamiplus8(x*w)*C8())*raw_pose_jacobian(q,i-1)*q_dot.head(i);
132+
}
133+
J_dot.col(i) = haminus8(x_effector)*vec_zdot + hamiplus8(z)*vec_x_effector_dot;
134+
x = x*_denso2dh(q(i),i);
135+
}
136+
137+
return J_dot;
109138
}
110139

111140

0 commit comments

Comments
 (0)