Center of mass position and Jacobian
Load a predefined KUKA LBR robot model, which is specified as a
load exampleRobots.mat lbr
Set the data format to
'row'. For all dynamics calculations, the data format must be either
lbr.DataFormat = 'row';
Compute the center of mass position and Jacobian at the home configuration of the robot.
[comLocation,comJac] = centerOfMass(lbr);
robot— Robot model
Robot model, specified as a
rigidBodyTree object. To
centerOfMass function, set the
DataFormat property to either
configuration— Robot configuration
Robot configuration, specified as a vector with positions for all nonfixed joints in the robot
model. You can generate a configuration using
randomConfiguration(robot), or by specifying your own
joint positions. To use the vector form of
configuration, set the
DataFormat property for the
robot to either
com— Center of mass location
[x y z]vector
Center of mass location, returned as an
[x y z] vector.
The vector describes the location of the center of mass for the specified
to the body frame, in meters.
comJac— Center of mass Jacobian
Center of mass Jacobian, returned as a 3-by-n matrix, where n is the robot velocity degrees of freedom.
Usage notes and limitations:
When creating the
rigidBodyTree object, use the syntax that specifies the
MaxNumBodies as an upper bound for adding bodies to the robot model.
You must also specify the
DataFormat property as a name-value pair. For
robot = rigidBodyTree("MaxNumBodies",15,"DataFormat","row")
To minimize data usage, limit the upper bound to a number close to the expected number of bodies in the model. All data formats are supported for code generation. To use the dynamics functions, the data format must be set to