-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from robotology/devel
Merge devel into master - minor changes and fixes
- Loading branch information
Showing
13 changed files
with
2,178 additions
and
1,558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
controllers/+floatingBaseBalancingTorqueControlWithSimulator/src/EventWithEncoderSpikes.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
classdef EventWithEncoderSpikes < Simulink.IntEnumType | ||
%EVENTWITHENCODERSPIKES Class for selecting a None, Warning or EmergencyStop signal | ||
% | ||
% Class for selecting a None, Warning or EmergencyStop signal triggered by an encoder spike | ||
% event. | ||
|
||
enumeration | ||
None(0) | ||
Warning(1) | ||
EmergencyStop(2) | ||
end | ||
end |
12 changes: 12 additions & 0 deletions
12
controllers/+floatingBaseBalancingTorqueControlWithSimulator/src/EventWithJointLimits.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
classdef EventWithJointLimits < Simulink.IntEnumType | ||
%EVENTWITHJOINTLIMITS Class for selecting a None, Warning or EmergencyStop signal | ||
% | ||
% Class for selecting a None, Warning or EmergencyStop signal triggered by the joints hitting | ||
% the limits. | ||
|
||
enumeration | ||
None(0) | ||
Warning(1) | ||
EmergencyStop(2) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3,437 changes: 1,939 additions & 1,498 deletions
3,437
...llers/+floatingBaseBalancingTorqueControlWithSimulator/torqueControlBalancingWithSimu.mdl
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function [noSpikes, res_check_spikes] = checkInputSpikesWithSimulator(u_prev, u, delta_u_max) | ||
|
||
% CHECKINPUTSPIKESWITHSIMULATOR checks the (unsigned) difference between two consecutive | ||
% measurements of the input u, i.e. delta = abs(u(k)-u(k-1)) | ||
% returns FALSE if delta is bigger than a user-defined threshold. | ||
% | ||
% FORMAT: [noSpikes, res_check_spikes] = checkInputSpikesWithSimulator(u_prev, u, delta_u_max) | ||
% | ||
% INPUT: - u = [n x 1] input values; | ||
% - u_prev = delayed [n x 1] input values; | ||
% - delta_u_max = user-defined threshold; | ||
% | ||
% OUTPUT: - noSpikes = FALSE if delta is greater than delta_u_max; | ||
% - res_check_spikes = vector of booleans to check the single joints. | ||
% | ||
% Authors: Gabriele Nava | ||
% | ||
% all authors are with the Italian Istitute of Technology (IIT) | ||
% email: name.surname@iit.it | ||
% | ||
% Genoa, Dec 2018 | ||
% | ||
|
||
delta = abs(u - u_prev); | ||
|
||
% u may be a vector | ||
res_check_spikes = (delta >= delta_u_max); | ||
noSpikes = double(~any(res_check_spikes)); | ||
end |
Binary file modified
BIN
+17.3 KB
(130%)
library/simulink-library/MomentumVelocityControl/momentumVelocityControl_lib.slx
Binary file not shown.
6 changes: 4 additions & 2 deletions
6
...y/simulink-library/MomentumVelocityControl/src/ComputeContactJacobianWithFeetContactFCN.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
function [J_c, J_c_dot_nu] = ComputeContactJacobianWithFeetContactFCN(J_L, J_R, J_dot_nu_L, J_dot_nu_R, feet_contact_status) | ||
function [J_c, J_c_dot_nu, holonomicConstraintActivation] = ComputeContactJacobianWithFeetContactFCN(J_L, J_R, J_dot_nu_L, J_dot_nu_R, feet_contact_status) | ||
|
||
NDOF = length(J_L(1,7:end)); | ||
|
||
J_c = zeros(12,6+NDOF); | ||
J_c_dot_nu = zeros(12,1); | ||
|
||
holonomicConstraintActivation = 0.0; | ||
% if left foot in contact | ||
if(feet_contact_status(1)) | ||
J_c (1:6,:) = J_L; | ||
J_c_dot_nu(1:6) = J_dot_nu_L; | ||
holonomicConstraintActivation= 1.0; | ||
end | ||
|
||
% if right foot in contact | ||
if(feet_contact_status(2)) | ||
J_c(7:end,:) = J_R; | ||
J_c_dot_nu(7:end) = J_dot_nu_R; | ||
holonomicConstraintActivation = 1.0 | ||
end | ||
|
||
end |
9 changes: 4 additions & 5 deletions
9
library/simulink-library/MomentumVelocityControl/src/ComputeReferences.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
function [L_star, L_dot_star, s_dot_star_k_1] = ComputeReferences(x_com, x_d_com, L, L_dot_d, Ld, int_L_angular, s_dot_des_k_1, s_des_k, s_k, totalMass,Gains) | ||
function [L_star, L_dot_star, s_dot_star_k_1] = ComputeReferences(x_com, x_d_com, L, L_dot_d, Ld, int_L_angular, s_dot_des_k_1, s_des_k, s_k, totalMass, KpPostural,Gains) | ||
|
||
L_int_lin = Gains.KP_CoM*totalMass*(x_com - x_d_com); | ||
L_int_ang = Gains.KI_ang*(int_L_angular); | ||
L_int = [L_int_lin; L_int_ang]; | ||
L_star = Ld-L_int; | ||
|
||
L_dot_star = L_dot_d -blkdiag(Gains.KD_CoM, Gains.KP_ang)*(L-Ld) -L_int; | ||
|
||
s_dot_star_k_1 = s_dot_des_k_1 - Gains.KP_Postural*(s_k-s_des_k); | ||
|
||
L_dot_star = L_dot_d -blkdiag(Gains.KD_CoM, Gains.KP_ang)*(L-Ld) -L_int; | ||
s_dot_star_k_1 = s_dot_des_k_1 - KpPostural*(s_k-s_des_k); | ||
%s_dot_star_k_1 = s_dot_des_k_1 - Gains.KP_Postural*(s_k-s_des_k); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.