jdelacroix / simiam

A MATLAB-based educational bridge between theory and practice in robotics.
http://gritslab.gatech.edu/projects/robot-simulator
Other
104 stars 52 forks source link

Does not work in MatLab 2016b #24

Open burf2000 opened 7 years ago

burf2000 commented 7 years ago

I run launch and get

Error using getappdata Value must be a handle.

Error in GridLayout/Update (line 282) OldPosition = getappdata(Obj.Container,'Position');

Error in GridLayout>@(hsrc,ev)Update(Obj,true)

Error using GridLayout (line 70) Error while evaluating UIContainer SizeChangedFcn

Undefined function or variable 'fHG1Client'.

Error in simiam.ui.AppWindow/create_layout (line 212) jClient = jFrame.fHG1Client;

Error in simiam.ui.AppWindow/load_ui (line 72) obj.create_layout();

Error in launch (line 20) app.load_ui();

XiGuaSZ commented 7 years ago

I get the same errors in matlab 2016a

billtubbs commented 4 years ago

I get similar errors in MATLAB R2019b (and a few warnings).

>> launch
Error using getappdata
Value must be a handle.

Error in GridLayout/Update (line 282)
            OldPosition = getappdata(Obj.Container,'Position');

Error in GridLayout>@(hsrc,ev)Update(Obj,true) (line 72)
                'ResizeFcn', @(hsrc,ev)Update(Obj,true), ...

Error using GridLayout (line 70)
Error while evaluating UIContainer SizeChangedFcn.

Warning: The JavaFrame figure property will be removed in a future release. For more information, see Recommendations for Java
and ActiveX Users on mathworks.com. 
> In findjobj/getRootPanel (line 383)
  In findjobj (line 216)
  In simiam.ui/AppWindow/create_layout (line 140)
  In simiam.ui/AppWindow/load_ui (line 72)
  In launch (line 20) 
Warning: The JavaFrame figure property will be removed in a future release. For more information, see Recommendations for Java
and ActiveX Users on mathworks.com. 
> In findjobj/getRootPanel (line 383)
  In findjobj (line 216)
  In simiam.ui/AppWindow/create_layout (line 183)
  In simiam.ui/AppWindow/load_ui (line 72)
  In launch (line 20) 
Warning: The JavaFrame figure property will be removed in a future release. For more information, see Recommendations for Java
and ActiveX Users on mathworks.com. 
> In findjobj/getRootPanel (line 383)
  In findjobj (line 216)
  In simiam.ui/AppWindow/create_layout (line 190)
  In simiam.ui/AppWindow/load_ui (line 72)
  In launch (line 20) 
Warning: The JavaFrame figure property will be removed in a future release. For more information, see Recommendations for Java
and ActiveX Users on mathworks.com. 
> In findjobj/getRootPanel (line 383)
  In findjobj (line 216)
  In simiam.ui/AppWindow/create_layout (line 195)
  In simiam.ui/AppWindow/load_ui (line 72)
  In launch (line 20) 
Warning: The JavaFrame figure property will be removed in a future release. For more information, see Recommendations for Java
and ActiveX Users on mathworks.com. 
> In simiam.ui/AppWindow/create_layout (line 211)
  In simiam.ui/AppWindow/load_ui (line 72)
  In launch (line 20) 
Unrecognized function or variable 'fHG1Client'.

Error in simiam.ui.AppWindow/create_layout (line 212)
            jClient = jFrame.fHG1Client;

Error in simiam.ui.AppWindow/load_ui (line 72)
            obj.create_layout();

Error in launch (line 20)
app.load_ui();

I appreciate it's been a while since this tool was developed (5 years!) so maybe shouldn't expect it to work today. How serious are these bugs and what would it take to update the code? (Happy to help if it's within my capabilities).

billtubbs commented 4 years ago

Actually there's a post about this error on the Mathworks help forum here:

There is one answer that recommends the following:

Change the code to jClient = jFrame.fHG2Client;

Somebody else explains:

The code is designed to work with Matlab's HG1 graphics. It will not run with modern Matlab versions. Ask the authors for instructions.

This seems to eliminate the last error.

billtubbs commented 4 years ago

I managed to hack my way past the immediate errors (see here for example) but then the UI launches and there are still lots of problems (e.g. text on buttons missing) so I guess this is going to be more than just a quick-fix:

matlab_screenshot

jtisaacs commented 4 years ago

@billtubbs Any luck getting the simulator fully working on a newer version of MATLAB?

billtubbs commented 4 years ago

@jtisaacs I was using version R2019b. I haven’t tried anything more recent.

jtisaacs commented 4 years ago

I have it working now on R2020a. Beyond the fixes that you mention above I had to make changes to the AppWindow function to make the images show up on the buttons. The problem seemed to be with using img paths when I was using the html strings, so I switched to loading the image and setting the 'cdata' field.

adumont commented 4 years ago

I have it working now on R2020a. Beyond the fixes that you mention above I had to make changes to the AppWindow function to make the images show up on the buttons. The problem seemed to be with using img paths when I was using the html strings, so I switched to loading the image and setting the 'cdata' field.

@jtisaacs would you mind sharing how you fixed it? Maybe you can upload it to Github (or submit a pull request).