Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions vrep/lbr4-torque-control/lbr4_torque_control.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
vi.wait_for_simulation_step_to_end();

% Define robot interface
robot_vrep = LBR4pVrepRobot('LBR4p', vi);
robot_name = 'LBR4p';
for i=1:7
current_joint_name = {robot_name,'_joint',int2str(i)};
joint_names{i} = strjoin(current_joint_name,''); %#ok
end

%% Definition of the actuation torque
tau = [-0.005; -25; 0; -30; -0.007; 0; 0];
Expand All @@ -44,7 +48,7 @@
%% Main control loop for the first desired pose
while(iteration <= max_iteration)
% Robot actuation in V-REP
robot_vrep.send_tau_to_vrep(tau);
vi.set_joint_torques(joint_names, tau);
vi.trigger_next_simulation_step();
vi.wait_for_simulation_step_to_end();

Expand All @@ -53,7 +57,7 @@
disp(' ')

% Read joint torques from V-REP
tau_read = robot_vrep.get_tau_from_vrep;
tau_read = vi.get_joint_torques(joint_names);

formatSpec = 'Joint torque read from V-REP: %f\n';
fprintf(formatSpec,tau_read);
Expand Down