Page 1 of 1

Trajecotry generator gives an error on getStartTime()

Posted: Tue Sep 12, 2023 6:33 am
by RoySevit
Hi there,

I have been running an application flawlessly for quite some time now, but after the latest update in matlab 2022b with the HEBI Matlab API 1.8.0 if have been getting this error:
Incorrect number or types of inputs or outputs for function 'getStartTime'.

Error in HebiTrajectory (line 172)
this.startTime = getStartTime(obj);
I do not recall making any changes to my code so I could not really figure out why this is happening.

So I went ahead and copied the following code of the github:

Code: Select all

trajGen = HebiTrajectoryGenerator();

     % Go from 0 to 180-degrees in 3 seconds
     waypoints = [
         0;
         pi ];
     time = [ 0 3 ];

     % This function generates smooth minimum jerk trajectories
    trajectory = trajGen.newJointMove( waypoints, 'time', time );

    % Visualize the trajectory
    HebiUtils.plotTrajectory(trajectory);
    drawnow;
This however provides a simular error:
Incorrect number or types of inputs or outputs for function 'getStartTime'.

Error in HebiTrajectory (line 172)
this.startTime = getStartTime(obj);

Error in HebiTrajectoryGenerator/newJointMove (line 362)
trajectory = HebiTrajectory(newJointMove(this.obj, varargin{:}));
The only thing that possibly changed is that before I loaded in a previous version of the API 1.7...

Normally with the parameters waypoints and times you would have a trajectory object with properties startTime, endTime, and duration, however when I examine the object returned by the code above, specifically in the file HebiTrajectory.m, I see on line 171 that obj only contains a 'duration' attribute.

It is therefore that the error at line 172 is produced...

Please advise if you spot a clear error in the example above or if a workaround for this error is available.

Kind regards,

Roy

Re: Trajecotry generator gives an error on getStartTime()

Posted: Mon Sep 18, 2023 11:36 am
by florian_enner
Sometimes MATLAB has issues with loading Java libraries after other Java have been executed. Did you try restarting MATLAB and running just this snippet?

If that fixes it, you may need to pre-load your other dependencies first. Here is some more info: https://github.com/HebiRobotics/MatlabI ... -libraries

Re: Trajecotry generator gives an error on getStartTime()

Posted: Tue Sep 19, 2023 7:36 am
by RoySevit
Hi Florian,

I did not try to load dependencies or the correct API lib, I might perhaps have this week a window where i can have a closer look at what is going on. Thanks for the pointer to this possible problem.

Kind regards,

Roy