From e7face21833006e19f61e53e1b7d51d17826e167 Mon Sep 17 00:00:00 2001 From: cosmic_power Date: Tue, 5 Nov 2024 07:48:26 +0800 Subject: [PATCH] add 6aixsForceSensor --- Identification_main.m | 2 +- get_baseParams.m | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Identification_main.m b/Identification_main.m index 2c7e83d..7bb1784 100644 --- a/Identification_main.m +++ b/Identification_main.m @@ -22,4 +22,4 @@ robot = get_regressor(robot,opt); % symbol matched % verify_regressor_R1000; robot = get_baseParams(robot, opt); -robot = estimate_dyn(robot,opt); \ No newline at end of file +% robot = estimate_dyn(robot,opt); \ No newline at end of file diff --git a/get_baseParams.m b/get_baseParams.m index 1bd148e..8ca1b76 100644 --- a/get_baseParams.m +++ b/get_baseParams.m @@ -14,7 +14,7 @@ q2d_max = 6*pi*ones(ndof,1); % Find relation between independent columns and dependent columns % ----------------------------------------------------------------------- % Get observation matrix of identifiable paramters -W = []; +W = []; isSixAxisFTSensor =1; isJointTorqueSensor =0; for i = 1:25 q_rnd = q_min + (q_max - q_min).*rand(ndof,1); qd_rnd = -qd_max + 2*qd_max.*rand(ndof,1); @@ -22,11 +22,16 @@ for i = 1:25 if includeMotorDynamics % Y = regressorWithMotorDynamics(q_rnd,qd_rnd,q2d_rnd); - else + elseif isJointTorqueSensor standard_regressor_func = sprintf('standard_regressor_%s',opt.robotName); Y = feval(standard_regressor_func, q_rnd,qd_rnd,q2d_rnd); - %FIXME: better compute standard_regressor -% Y = standard_regressor_func(q_rnd,qd_rnd,q2d_rnd); + elseif isSixAxisFTSensor + standard_regressor_func = sprintf('standard_regressor_%s',opt.robotName); + Y = feval(standard_regressor_func, q_rnd,qd_rnd,q2d_rnd); + % FIXME hack here + Zeros_ = zeros(size(Y)); + Zeros_(ndof-3,:) = Y(ndof-3,:); + Y = Zeros_; end W = vertcat(W,Y); end