HebiRobotics / hebi-matlab-api

Public download and issue tracker of the latest HEBI API for MATLAB
http://docs.hebi.us/tools.html#matlab-api
0 stars 0 forks source link

Add a struct for Safety Limits #19

Closed ennerf closed 5 years ago

ennerf commented 5 years ago

Currently it's possible to set safety limits via send('PositionLimit', [limits]), but there is no way to get feedback. Since the safety options are becoming quite extensive (different strategies etc.), it'd make sense to turn those into a separate struct similar to gains.

ennerf commented 5 years ago

added support in latest snapshot

%%
group = HebiLookup.newGroupFromFamily('Test*')

%% Get feedback
limits = group.getSafety()

%% Set commands
limits = SafetyStruct();
limits.positionMinLimit = [-pi 0];
group.send('Safety', limits)

% positionLimitStrategy values:
% nan => unknown
% 0 => disabled
% 1 => motor off
% 2 => hold position
% 3 => damped spring

Log groups already support it, but some of the HebiUtils methods don't. Some of the user facing documentation is still missing as well.

Not sure whether group.getSafety() and group.send('Safety', ...) are good names yet

ennerf commented 5 years ago

Named getSafetyParams() and SafetyParamsStruct