Skip to content

Commit

Permalink
Bugfix when rtMat are empty, changed identf visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
rustlluk committed Mar 14, 2022
1 parent c371f90 commit 08bd148
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion @Robot/prepareDataset.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@
camFrames = [camFrames{:}];
uniqueFrames = [uniqueFrames; {camFrames.name}'];
end
rtFields = fieldnames(datasets.(part){dataset}.rtMat)';
if isstruct(datasets.(part){dataset}.rtMat)
rtFields = fieldnames(datasets.(part){dataset}.rtMat)';
else
rtFields = {};
end
% Preallocate arrays
links(length(datasets.(part){dataset}.frame), 1) = Link();
for name=1:length(datasets.(part){dataset}.frame)
Expand Down
Binary file modified MRC.mlappinstall
Binary file not shown.
2 changes: 1 addition & 1 deletion UserData/Robots/iCub/loadICUB.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [ name, linkStructure, structure ] = loadICUBv2()
function [ name, linkStructure, structure ] = loadICUB()
%LOADICUBV2 Function for loading iCub version 2 robot
% Custom function for loading iCub version 2 robot.
% OUTPUT - name - robot name
Expand Down
1 change: 1 addition & 0 deletions Utils/CalibUtils/internalCalibration.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@ function internalCalibration(rob, config, whpars, data, folder, saveInfo, saveDa
if saveInfo(2)
save([outfolder, 'jacobians.mat'], 'jacobians', '-v7.3');
end
addpath(outfolder);
end
9 changes: 5 additions & 4 deletions Visualisation/plotJacobian.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ function plotJacobian(folder, titles)
for fig=1:floor(length(jacobians)/6)+1
rows = 2;
cols = 3;
h = figure();
hold on;
%h = figure();
%hold on;
%% plot normalized jacobians
for j = count:min(count+5,length(jacobians))
subplot(rows,cols,j-count+1);
%subplot(rows,cols,j-count+1);
h = figure();
maxs = max(max(abs(jacobians{j})));
maxs(maxs == 0) = 1;
jac = jacobians{j}./maxs;
Expand All @@ -72,7 +73,7 @@ function plotJacobian(folder, titles)
ylim([-1,1])
xlim([0.5, size(jac,2)+0.5])
bp = gca;
xtickangle(15)
xtickangle(30)
bp.XAxis.TickLabelInterpreter = 'latex';
ylabel('$\frac{\partial X_i}{\partial \phi_j}$', 'Interpreter', 'latex','FontSize',12);

Expand Down
Binary file modified gui.mlapp
Binary file not shown.

0 comments on commit 08bd148

Please sign in to comment.