About the CenterOfMass property of rigidBodyTree
The CenterOfMass property in the rigidBodyTree class seems to not work. The code is as follows
clear;
load exampleRobots.mat
% Set lbr robot dynamics input data format to ‘column’
lbr.DataFormat = ‘column’;
lbr.Gravity=[0 0 -9.80665];
% Generate a random configuration for lbr
q = [0 0 0 0 0 0 0]’;
dq = [0 0 0 0 0 0 0]’;
ddq = [0.1 0 0 0 0 0 0]’;
%
% Compute the required joint torques for lbr to
% statically hold that configuration
tau = inverseDynamics(lbr, q);
disp(tau);
lbr.Bodies{1}.CenterOfMass=[1000 0 0];
tau = inverseDynamics(lbr, q);
disp(tau);
No matter how I change the position of the center of mass, the moment always remains the same.It looks like the center of mass position or body mass is set to 0,
matlab version is 2022a.The CenterOfMass property in the rigidBodyTree class seems to not work. The code is as follows
clear;
load exampleRobots.mat
% Set lbr robot dynamics input data format to ‘column’
lbr.DataFormat = ‘column’;
lbr.Gravity=[0 0 -9.80665];
% Generate a random configuration for lbr
q = [0 0 0 0 0 0 0]’;
dq = [0 0 0 0 0 0 0]’;
ddq = [0.1 0 0 0 0 0 0]’;
%
% Compute the required joint torques for lbr to
% statically hold that configuration
tau = inverseDynamics(lbr, q);
disp(tau);
lbr.Bodies{1}.CenterOfMass=[1000 0 0];
tau = inverseDynamics(lbr, q);
disp(tau);
No matter how I change the position of the center of mass, the moment always remains the same.It looks like the center of mass position or body mass is set to 0,
matlab version is 2022a. The CenterOfMass property in the rigidBodyTree class seems to not work. The code is as follows
clear;
load exampleRobots.mat
% Set lbr robot dynamics input data format to ‘column’
lbr.DataFormat = ‘column’;
lbr.Gravity=[0 0 -9.80665];
% Generate a random configuration for lbr
q = [0 0 0 0 0 0 0]’;
dq = [0 0 0 0 0 0 0]’;
ddq = [0.1 0 0 0 0 0 0]’;
%
% Compute the required joint torques for lbr to
% statically hold that configuration
tau = inverseDynamics(lbr, q);
disp(tau);
lbr.Bodies{1}.CenterOfMass=[1000 0 0];
tau = inverseDynamics(lbr, q);
disp(tau);
No matter how I change the position of the center of mass, the moment always remains the same.It looks like the center of mass position or body mass is set to 0,
matlab version is 2022a. 2022a, rigidbodytree MATLAB Answers — New Questions