Azzera filtri
Azzera filtri

Compound quaternion Matlab -error

1 visualizzazione (ultimi 30 giorni)
Mark S
Mark S il 6 Dic 2021
Modificato: Mark S il 8 Gen 2022
Hi, I have written a Matlab code where i can compound two relative poses by Translation-Vecot-Unit-Quaternion-Pair
But I get an error and I did not know why. The error message is:
Output argument "t_q_pair_A_C" (and possibly others) not assigned a value in the execution with "test2>t_q_pair_compound"
function.
Error in test2 (line 40)
q_pair_A_C = t_q_pair_compound(t_q_pair_A_B,t_q_pair_B_C);
Can anybody give me a hint why I get this error message. Thank you :)
Here is my code:
.

Risposta accettata

KSSV
KSSV il 6 Dic 2021
In this function:
function t_q_pair_A_C = t_q_pair_compound(t_q_pair_A_B,t_q_pair_B_C)
% Extract Translation Vectors
t_A_B = t_q_pair_A_B.t;
t_B_C = t_q_pair_B_C.t;
% Extract Unit Quaternion
q_A_B = t_q_pair_A_B.q;
q_B_C = t_q_pair_B_C.q;
%Compound Translation Vectors
t_A_C_pure_q = q_pure(t_A_B) + q_A_B * q_pure(t_B_C) * q_inv(q_A_B);
[~, v_1,v_2, v_3] = parts(t_A_C_pure_q);
t_A_C = [v_1;
v_2;
v_3];
end
You need to assign the output. May be you want:
function t_q_pair_A_C = t_q_pair_compound(t_q_pair_A_B,t_q_pair_B_C)
% Extract Translation Vectors
t_A_B = t_q_pair_A_B.t;
t_B_C = t_q_pair_B_C.t;
% Extract Unit Quaternion
q_A_B = t_q_pair_A_B.q;
q_B_C = t_q_pair_B_C.q;
%Compound Translation Vectors
t_A_C_pure_q = q_pure(t_A_B) + q_A_B * q_pure(t_B_C) * q_inv(q_A_B);
[~, v_1,v_2, v_3] = parts(t_A_C_pure_q);
t_q_pair_A_C = [v_1;
v_2;
v_3];
end
  3 Commenti
KSSV
KSSV il 6 Dic 2021
Thanks is accepting/ voting the answer. :)
KSSV
KSSV il 6 Dic 2021
You are using a different variable name for that. This line:
q_pair_A_C = t_q_pair_compound(t_q_pair_A_B,t_q_pair_B_C);
should be:
t_q_pair_A_C = t_q_pair_compound(t_q_pair_A_B,t_q_pair_B_C);

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by