forked from HebiRobotics/hebi-matlab-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupArmWithGripper.m
46 lines (36 loc) · 1.31 KB
/
setupArmWithGripper.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function [ arm, params, gripper ] = setupArmWithGripper(family)
% Arm Module Names
group = HebiLookup.newGroupFromNames(family, {
'J1_base'
'J2_shoulder'
'J3_elbow'
'J4_wrist1'
'J5_wrist2'
'J6_wrist3' });
% Load and send Gains
params.gains = HebiUtils.loadGains('gains/6-dof-arm-gains-rosie');
HebiUtils.sendWithRetry(group, 'gains', params.gains);
% Kinematic Model
kin = HebiUtils.loadHRDF('hrdf/6-DoF_arm_w_gripper');
% Gripper
gripperGroup = HebiLookup.newGroupFromNames(family, 'Spool');
params.gripperGains = HebiUtils.loadGains('gains/gripper-gains');
HebiUtils.sendWithRetry(gripperGroup, 'gains', params.gripperGains);
% API Wrappers
arm = HebiArm(group, kin);
gripper = HebiGripper(gripperGroup);
% Default seed positions for doing inverse kinematics
params.ikSeedPos = [0 1 2.5 1.5 -1.5 1];
% Trajectory generator parameters
params.minTrajDuration = 0.33; % [sec]
params.defaultSpeedFactor = 0.9;
arm.trajGen.setMinDuration(params.minTrajDuration);
arm.trajGen.setSpeedFactor(params.defaultSpeedFactor);
% (Optional) Compensation to joint efforts due to a gas spring (if present)
shoulderJointComp = 0; % Nm <--- Change this if you add a gas spring
params.effortOffset = [0 shoulderJointComp 0 0 0 0];
% Default plugins
arm.plugins = {
HebiArmPlugins.EffortOffset(params.effortOffset)
};
end