Skip to content

Commit 65daadd

Browse files
committed
improve layout of EE pose
1 parent b11004f commit 65daadd

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

RTBPlot.m

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@
196196
'Position', [0.3 1-height 0.6 height], ...
197197
'FontUnits', 'normalized', ...
198198
'FontSize', 0.8, ...
199-
'String', sprintf('%.3f', T6(1,4)), ...
199+
'String', sprintf('%.3f ', T6(1,4)), ...
200200
'TooltipString', 'End-effector x-coordinate', ...
201+
'HorizontalAlignment', 'right', ...
201202
'Tag', 'T6');
202203

203204
% Y
@@ -216,7 +217,8 @@
216217
'FontUnits', 'normalized', ...
217218
'FontSize', 0.8, ...
218219
'TooltipString', 'End-effector y-coordinate', ...
219-
'String', sprintf('%.3f', T6(2,4)));
220+
'HorizontalAlignment', 'right', ...
221+
'String', sprintf('%.3f ', T6(2,4)));
220222

221223
if ~opt.d_2d
222224
% Z
@@ -235,7 +237,8 @@
235237
'FontUnits', 'normalized', ...
236238
'FontSize', 0.8, ...
237239
'TooltipString', 'End-effector z-coordinate', ...
238-
'String', sprintf('%.3f', T6(3,4)));
240+
'HorizontalAlignment', 'right', ...
241+
'String', sprintf('%.3f ', T6(3,4)));
239242
end
240243

241244
% Orientation
@@ -290,7 +293,8 @@
290293
'FontUnits', 'normalized', ...
291294
'FontSize', 0.8, ...
292295
'TooltipString', tips{1}, ...
293-
'String', sprintf('%.3f', 0));
296+
'HorizontalAlignment', 'right', ...
297+
'String', sprintf("%.1f ", 0));
294298

295299
% AY
296300
uicontrol(panel, 'Style', 'text', ...
@@ -308,7 +312,8 @@
308312
'FontUnits', 'normalized', ...
309313
'FontSize', 0.8, ...
310314
'TooltipString', tips{2}, ...
311-
'String', sprintf('%.3f', 0));
315+
'HorizontalAlignment', 'right', ...
316+
'String', sprintf("%.1f ", 0));
312317

313318
% AZ
314319
uicontrol(panel, 'Style', 'text', ...
@@ -317,6 +322,7 @@
317322
'Position', [0.05 1-7*height 0.2 height], ...
318323
'FontUnits', 'normalized', ...
319324
'FontSize', 0.9, ...
325+
'HorizontalAlignment', 'r', ...
320326
'HorizontalAlignment', 'left', ...
321327
'String', labels(3));
322328

@@ -326,7 +332,8 @@
326332
'FontUnits', 'normalized', ...
327333
'FontSize', 0.8, ...
328334
'TooltipString', tips{3}, ...
329-
'String', sprintf('%.3f', 0));
335+
'HorizontalAlignment', 'right', ...
336+
'String', sprintf("%.1f ", 0));
330337
end
331338
%---- add buttons
332339
uicontrol(panel, 'Style', 'pushbutton', ...
@@ -400,7 +407,7 @@ function teach_callback(src, name, j, teachhandles)
400407
case 'slider'
401408
% slider changed, get value and reflect it to edit box
402409
newval = get(src, 'Value');
403-
set(teachhandles.edit(j), 'String', num2str(qscale(j)*newval, 3));
410+
set(teachhandles.edit(j), 'String', sprintf("%.1f", qscale(j)*newval));
404411
case 'edit'
405412
% edit box changed, get value and reflect it to slider
406413
newval = str2double(get(src, 'String')) / qscale(j);
@@ -462,8 +469,8 @@ function teach_callback(src, name, j, teachhandles)
462469
set(teachhandles.t6.r(1), 'String', sprintf('%.3f', orient(1)));
463470
else
464471
for i=1:3
465-
set(teachhandles.t6.t(i), 'String', sprintf('%.3f', T6(i,4)));
466-
set(teachhandles.t6.r(i), 'String', sprintf('%.3f', orient(i)));
472+
set(teachhandles.t6.t(i), 'String', sprintf("%.3f ", T6(i,4)));
473+
set(teachhandles.t6.r(i), 'String', sprintf("%.1f ", orient(i)));
467474
end
468475
end
469476

0 commit comments

Comments
 (0)