This repository has been archived by the owner on Oct 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
torquebalancing is connected with mpc and working in simulation
- Loading branch information
1 parent
4e33107
commit ca9a554
Showing
23 changed files
with
61,124 additions
and
69,387 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
controllers/torqueBalancingFootstepPlanner/src/fromQuatToTransfMatrix.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,18 @@ | ||
function w_H_fixedLink = fromQuatToTransfMatrix(qt_fixed_LFoot, LFoot_is_active, qt_fixed_RFoot) | ||
|
||
|
||
q = qt_fixed_RFoot; | ||
toll = 0.1; | ||
|
||
if LFoot_is_active > (1-toll) | ||
|
||
q = qt_fixed_LFoot; | ||
end | ||
|
||
% transformation matrix from position + quaternions rapresentation | ||
w_R_fixedLink = rotationFromQuaternion(q(4:7)); | ||
|
||
w_H_fixedLink = [w_R_fixedLink, q(1:3); | ||
0 0 0 1]; | ||
|
||
end |
50 changes: 50 additions & 0 deletions
50
controllers/torqueBalancingFootstepPlanner/src/stateMachineWalking.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,50 @@ | ||
function [CoMDes, impedances, kpCom, kdCom, currentState] = ... | ||
stateMachineWalking(wrench_rightFoot, wrench_leftFoot, CoM_0, q0, x_CoM, qj, t, sm, gain,... | ||
CoMDesInput, qjDesInput, constraintsInput) | ||
|
||
% state machine for teleoperated walking | ||
persistent state; | ||
|
||
if isempty(state) | ||
state = sm.stateAt0; | ||
end | ||
|
||
impedances = gain.impedances(1,:); | ||
kpCom = gain.PCOM(1,:); | ||
kdCom = gain.DCOM(1,:); | ||
toll = 0.1; | ||
|
||
%% TWO FEET BALANCING | ||
if constraintsInput(1)>(1-toll) && constraintsInput(2)>(1-toll) | ||
|
||
% nothing to do actually. Just wait to switch in another state | ||
state = 1; | ||
end | ||
|
||
%% LEFT FOOT BALANCING | ||
if constraintsInput(1)>(1-toll) && constraintsInput(2)<(toll) | ||
|
||
% update gains | ||
impedances = gain.impedances(state,:); | ||
kpCom = gain.PCOM(state,:); | ||
kdCom = gain.DCOM(state,:); | ||
state = 2; | ||
end | ||
|
||
%% RIGHT FOOT BALANCING | ||
if constraintsInput(1)<(toll) && constraintsInput(2)>(1-toll) | ||
|
||
% update gains | ||
impedances = gain.impedances(state,:); | ||
kpCom = gain.PCOM(state,:); | ||
kdCom = gain.DCOM(state,:); | ||
state = 3; | ||
end | ||
|
||
%% The following variables actually does not depend upon the current state | ||
CoMDes = [CoMDesInput(1:3),CoMDesInput(4:6),CoMDesInput(7:9)]; | ||
|
||
%% Current state and smoothing time | ||
currentState = state; | ||
|
||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.