%% Compute Velocity-Induced Joint Torques
% Load a predefined KUKA LBR robot model, which is specified as a  RigidBodyTree object.

load exampleRobots.mat lbr

%
% Set the data format to 'row'. For all dynamics calculations, the data format must be either 'row' or 'column'.

lbr.DataFormat = 'row';

%
% Set the joint velocity vector.

qdot = [0 0 0.2 0.3 0 0.1 0];

%
% Compute the joint torques required to cancel the velocity-induced joint torques at the robot home configuration ([] input). The velocity-induced joint torques equal the negative of the velocityProduct output.

tau = -velocityProduct(lbr,[],qdot);

% Copyright 2012 The MathWorks, Inc.