leave other non-working examples in the code

master-costfun
EmaMaker 2024-09-26 23:15:08 +02:00
parent cceb2f1379
commit 9fcadcde54
2 changed files with 22 additions and 3 deletions

View File

@ -32,9 +32,28 @@ function [u_corr, U_corr_history, q_pred] = ucorr(t, q, sim_data)
T_inv = decouple_matrix(q_act, sim_data); T_inv = decouple_matrix(q_act, sim_data);
ut = utrack(t, q_act, sim_data); ut = utrack(t, q_act, sim_data);
% minimize v % minimize v, unicycle and ddr
% actually minimize xdot^2 + ydot^2 = v
H = 2*eye(2); H = 2*eye(2);
% minimize vcorr^2 + wcorr^2, unicycle and ddr
%H = T_inv
if eq(sim_data.robot, 0)
% ex3: unicycle, minimize v
%H = T_inv' * [1 0; 0 0] * T_inv;
% ex4: unicycle, minimize w
%H = T_inv' * [0 0; 0 1] * T_inv;
else
% ex1: ddr, minimize v. det(H) = 0 H not symmetric
%R = [sim_data.r/2 sim_data.r/2]
%H = T_inv' * R' * R * T_inv;
% ex2: ddr, minimize w. det(H) = 0
%R = [sim_data.r/sim_data.d -sim_data.r/sim_data.d]
%H = T_inv' * R' * R * T_inv;
end
f = zeros(2,1); f = zeros(2,1);
A = [T_inv; -T_inv]; A = [T_inv; -T_inv];
%A = [eye(2); -eye(2)]; %A = [eye(2); -eye(2)];

4
tesi.m
View File

@ -3,7 +3,7 @@ clear all
close all close all
% options % options
ROBOT = 'diffdrive' ROBOT = 'unicycle'
%TESTS = ["straightline/chill", "straightline/chill_errortheta_pisixths", "straightline/toofast", "straightline/chill_errory", "circle/start_center", "figure8/chill", "figure8/toofast", "square"] %TESTS = ["straightline/chill", "straightline/chill_errortheta_pisixths", "straightline/toofast", "straightline/chill_errory", "circle/start_center", "figure8/chill", "figure8/toofast", "square"]
TESTS = ["circle/start_center"] TESTS = ["circle/start_center"]
@ -36,7 +36,7 @@ for i = 1:length(TESTS)
% 1: track only % 1: track only
% 2: track + 1step % 2: track + 1step
% 3: track + multistep % 3: track + multistep
spmd (3) spmd (2)
worker_index = spmdIndex; worker_index = spmdIndex;
% load controller-specific options % load controller-specific options
data = load(['tests/' num2str(worker_index) '.mat']); data = load(['tests/' num2str(worker_index) '.mat']);