Page 1 of 1

Error in code for ex__kinematics__visualization.m

Posted: Thu Sep 17, 2020 2:43 am
by abdulaleey
I am trying to visualize kinematics of 6 Dof Arm but receiving this error. Any idea why is that so?



Warning: Objects of us/hebi/sdk/matlab/HebiTrajectoryGenerator class exist - not clearing java
> In javaclasspath>local_javapath (line 195)
In javaclasspath (line 124)
In javaaddpath (line 71)
In HebiJoystick.loadLibs (line 65)
In HebiKeyboard.loadLibs (line 60)
In HebiKeyboard (line 77)
In ex_kinematics_visualization (line 42)
Warning: Objects of us/hebi/sdk/matlab/structs/GainStruct class exist - not clearing java
> In javaclasspath>local_javapath (line 195)
In javaclasspath (line 124)
In javaaddpath (line 71)
In HebiJoystick.loadLibs (line 65)
In HebiKeyboard.loadLibs (line 60)
In HebiKeyboard (line 77)
In ex_kinematics_visualization (line 42)
Warning: Objects of us/hebi/sdk/matlab/HebiKinematics class exist - not clearing java
> In javaclasspath>local_javapath (line 195)
In javaclasspath (line 124)
In javaaddpath (line 71)
In HebiJoystick.loadLibs (line 65)
In HebiKeyboard.loadLibs (line 60)
In HebiKeyboard (line 77)
In ex_kinematics_visualization (line 42)
Warning: Objects of us/hebi/sdk/matlab/HebiGroup class exist - not clearing java
> In javaclasspath>local_javapath (line 195)
In javaclasspath (line 124)
In javaaddpath (line 71)
In HebiJoystick.loadLibs (line 65)
In HebiKeyboard.loadLibs (line 60)
In HebiKeyboard (line 77)
In ex_kinematics_visualization (line 42)
Warning: Objects of us/hebi/sdk/matlab/CommandStruct class exist - not clearing java
> In javaclasspath>local_javapath (line 195)
In javaclasspath (line 124)
In javaaddpath (line 71)
In HebiJoystick.loadLibs (line 65)
In HebiKeyboard.loadLibs (line 60)
In HebiKeyboard (line 77)
In ex_kinematics_visualization (line 42)
Undefined variable "us" or class "us.hebi.matlab.input.HebiKeyboard".

Error in HebiKeyboard (line 78)
this.obj = us.hebi.matlab.input.HebiKeyboard(driver, index);

Error in ex_kinematics_visualization (line 42)
kb = HebiKeyboard();

Re: Error in code for ex__kinematics__visualization.m

Posted: Thu Sep 17, 2020 9:41 am
by dave_rollinson
Abdul,

This means that you already have made objects from the HEBI API, before trying to load the Java libraries related to keyboard input, HebiKeyboard(). As far as I know, Matlab does not let you load Java libraries after you've made objects in the workspace with any other libraries, and you get errors like the one you've posted.

To fix this, please make sure to use the startup.m scripts in the examples the first thing when you start up Matlab. For the arm examples the startup.m file is in hebi-matlab-examples/kits/arms/. Underneath it calls an include.m file that loads the libraries for HebiKeyboard and HebiJoystick, to make sure they can be used later without having to restart Matlab.

If you're creating your own projects we recommend making a startup.m file for that project, modeled on the startup.m / include.m files above and running them as the first thing when you start Matlab (if you start Matlab in a directory that has a startup.m file, that file is automatically run on startup).

Hope this helps,
-Dave