function J = get_body_Jacobian(robot,q,link_name)

J_ibar_0_i_rst = geometricJacobian(robot, q, link_name);
H_0_i_rst = getTransform(robot,q,link_name,"base");
[R_0_i,~] = TransToRp(H_0_i_rst);
H_i_ibar = RpToTrans(R_0_i',zeros(3,1));
J = Adjoint(H_i_ibar)*J_ibar_0_i_rst;

end