Clear Filters
Clear Filters

"Update traversal encountered invalid scene tree." error while using AppDesigner

1 view (last 30 days)
Hello everyone, I am currently trying to represent the orientation of an object in a appdesigner interface i designed. I figured i can use the sensor fusion toolbox to visualize roll pitch and yaw data that i obtained from an external source. However, when i tried to plot it on a axes, it shows an empty 3d axes system and gives the error in the summary. It works just fine in MATLAB editor however i cannot make it work in appdesigner. Can you help me?
tp = theaterPlot('Parent',app.UIAxes7,'XLimit',[-2 2],'YLimit',[-2 2],'ZLimit',[-2 2]);
op = orientationPlotter(tp,'DisplayName','orientation','LocalAxesLength',2);

Accepted Answer

Ryan Salvo
Ryan Salvo on 7 Jul 2021
Hi Kaan,
I suspect the error may be caused by something besides the orientationPlotter. I was able to create a simple app in appdesigner and update the orientationPlotter with roll, pitch, and yaw values.
Here is the code used to try the simple app:
myApp = app1_exported;
roll = 0; pitch = 0; yaw = 45;
update(myApp, roll, pitch, yaw);
Here is the simple app:
classdef app1_exported < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
UIAxes matlab.ui.control.UIAxes
methods (Access = public)
function update(app, roll, pitch, yaw)
plotOrientation(app.OrientationPlot, roll, pitch, yaw);
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 640 480];
app.UIFigure.Name = 'MATLAB App';
% Create UIAxes
app.UIAxes = uiaxes(app.UIFigure);
title(app.UIAxes, 'Title')
xlabel(app.UIAxes, 'X')
ylabel(app.UIAxes, 'Y')
zlabel(app.UIAxes, 'Z')
app.UIAxes.Position = [171 149 300 185];
tp = theaterPlot('Parent',app.UIAxes,'XLimit',[-2 2],'YLimit',[-2 2],'ZLimit',[-2 2]);
op = orientationPlotter(tp,'DisplayName','orientation','LocalAxesLength',2);
plotOrientation(op, 0, 0, 0);
app.OrientationPlot = op;
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
% App creation and deletion
methods (Access = public)
% Construct app
function app = app1_exported
% Create UIFigure and components
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
Kaan Ege Tirman
Kaan Ege Tirman on 19 Jul 2021
Hello again and thank you for asnwer. I tried to run the code you provided with the answer but still, I get similar errors. I add the error messages below. By the way, I use 2020b release, maybe it causes problems?
Ryan Salvo
Ryan Salvo on 20 Jul 2021
Hi Kaan,
I took a look at orientationPlotter in R2020b and R2021a and I did not see any changes. I suspect that the graphics framework was updated in App Designer in R2021a to resolve this error. I recommend upgrading to R2021a to resolve this issue. If that is not possible, please submit a support request to continue to investigate workarounds in R2020b.

Sign in to comment.

More Answers (0)


Find more on Develop uifigure-Based Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!