Skip to content

Commit 8b8a291

Browse files
Attempt to minimize the angular momentum on the z component
1 parent 759997a commit 8b8a291

File tree

8 files changed

+51
-23
lines changed

8 files changed

+51
-23
lines changed

src/WalkingModule/app/robots/ergoCubGazeboV1_1/dcm_walking/common/plannerParams.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ saturationFactors (0.7, 0.7)
2121

2222
##Bounds
2323
#Step length
24-
maxStepLength 0.25
24+
maxStepLength 0.34
2525
minStepLength 0.01
2626
maxLengthBackwardFactor 1.0
2727
#Width
@@ -32,7 +32,7 @@ maxAngleVariation 18.0
3232
minAngleVariation 5.0
3333
#Timings
3434
maxStepDuration 1.31
35-
minStepDuration 0.7
35+
minStepDuration 0.5
3636

3737
##Nominal Values
3838
#Width
@@ -45,11 +45,11 @@ comHeightDelta 0.01
4545
#Timings
4646
nominalDuration 1.3
4747
lastStepSwitchTime 0.8
48-
switchOverSwingRatio 0.3
48+
switchOverSwingRatio 0.1
4949

5050
#ZMP Delta
51-
leftZMPDelta (0.005 -0.0)
52-
rightZMPDelta (0.005 0.0)
51+
leftZMPDelta (0.0 -0.0)
52+
rightZMPDelta (0.0 0.0)
5353

5454
#Feet cartesian offset on the yaw
5555
leftYawDeltaInDeg 0.0

src/WalkingModule/app/robots/ergoCubGazeboV1_1/dcm_walking/joypad_control/inverseKinematics.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ max-cpu-time 20
2626

2727
#DEGREES
2828
jointRegularization (7, 0.12, -0.01,
29-
-3.7, 20.0, -13.0, 40.769,
30-
-3.7, 20.0, -13.0, 40.769,
29+
0.0, 0.0, -0.0, 0.0,
30+
0.0, 0.0, -0.0, 0.0,
3131
5.76, 1.61, -0.31, -31.64, -20.52, -1.52,
3232
5.76, 1.61, -0.31, -31.64, -20.52, -1.52)
3333

src/WalkingModule/app/robots/ergoCubGazeboV1_1/dcm_walking/joypad_control/qpInverseKinematicsBlf.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,10 @@ frame_name "l_sole"
2424
kp_linear 7.0
2525
kp_angular 5.0
2626

27+
[ANGULAR_MOMENTUM_TASK]
28+
robot_velocity_variable_name "robot_velocity"
29+
mask (false, false, true)
30+
weight (2.0)
31+
2732
[include TORSO_TASK "./tasks/torso.ini"]
2833
[include JOINT_REGULARIZATION_TASK "./tasks/regularization.ini"]
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
robot_velocity_variable_name "robot_velocity"
2-
kp (5.0, 5.0, 5.0,
3-
5.0, 5.0, 5.0, 5.0,
4-
5.0, 5.0, 5.0, 5.0,
5-
5.0, 5.0, 5.0, 5.0, 5.0, 5.0,
6-
5.0, 5.0, 5.0, 5.0, 5.0, 5.0)
2+
kp (5.0, 5.0, 1.0,
3+
0.5, 5.0, 5.0, 0.5,
4+
0.5, 5.0, 5.0, 0.5,
5+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
6+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
77

88
states ("stance", "walking")
99
sampling_time 0.002
1010
settling_time 0.5
1111

1212
[stance]
1313
name "stance"
14-
weight (1.0, 1.0, 1.0,
15-
2.0, 2.0, 2.0, 2.0,
16-
2.0, 2.0, 2.0, 2.0,
14+
weight (1.0, 1.0, 0.5,
15+
1.0, 2.0, 2.0, 1.0,
16+
1.0, 2.0, 2.0, 1.0,
1717
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1818
1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
1919

2020
[walking]
2121
name "walking"
22-
weight (1.0, 1.0, 1.0,
23-
2.0, 2.0, 2.0, 2.0,
24-
2.0, 2.0, 2.0, 2.0,
22+
weight (1.0, 1.0, 0.5,
23+
1.0, 2.0, 2.0, 1.0,
24+
1.0, 2.0, 2.0, 1.0,
2525
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2626
1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
robot_velocity_variable_name "robot_velocity"
22
frame_name "chest"
3-
kp_angular 5.0
3+
kp_angular 50.0
44

55

66
states ("stance", "walking")
@@ -9,8 +9,8 @@ settling_time 0.5
99

1010
[stance]
1111
name "stance"
12-
weight (5.0, 5.0, 5.0)
12+
weight (15.0, 15.0, 1.0)
1313

1414
[walking]
1515
name "walking"
16-
weight (5.0, 5.0, 5.0)
16+
weight (15.0, 15.0, 1.0)

src/WalkingModule/app/robots/ergoCubGazeboV1_1/dcm_walking_with_joypad.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ skip_dcm_controller 1
1717
goal_port_scaling (0.5, 1.0, 0.5)
1818

1919
# How much in advance the planner should be called. The time is in seconds
20-
planner_advance_time_in_s 0.02
20+
planner_advance_time_in_s 0.08
2121

2222
# How much time (in seconds) before failing due to missing feedback
2323
max_feedback_delay_in_s 1.0
@@ -29,7 +29,7 @@ remove_zmp_offset 0
2929
[GENERAL]
3030
name walking-coordinator
3131
# height of the com
32-
com_height 0.7
32+
com_height 0.715
3333
# sampling time
3434
sampling_time 0.01
3535
# Specify the frame to use to control the robot height. Currently, we support only the following options: com, root_link

src/WholeBodyControllers/include/WalkingControllers/WholeBodyControllers/BLFIK.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <BipedalLocomotion/IK/R3Task.h>
1919
#include <BipedalLocomotion/IK/SE3Task.h>
2020
#include <BipedalLocomotion/IK/SO3Task.h>
21+
#include <BipedalLocomotion/IK/AngularMomentumTask.h>
2122
#include <BipedalLocomotion/ParametersHandler/IParametersHandler.h>
2223
#include <BipedalLocomotion/System/VariablesHandler.h>
2324

@@ -68,6 +69,7 @@ class BLFIK
6869
std::shared_ptr<BipedalLocomotion::IK::R3Task> m_rootTask;
6970
std::shared_ptr<BipedalLocomotion::IK::JointTrackingTask> m_jointRetargetingTask;
7071
std::shared_ptr<BipedalLocomotion::IK::JointTrackingTask> m_jointRegularizationTask;
72+
std::shared_ptr<BipedalLocomotion::IK::AngularMomentumTask> m_angularMomentumTask;
7173

7274
iDynTree::VectorDynSize m_jointVelocity;
7375
bool m_usejointRetargeting{false};

src/WholeBodyControllers/src/BLFIK.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ bool BLFIK::initialize(
102102
lowPriority,
103103
m_jointRegularizationWeight);
104104

105+
m_angularMomentumTask = std::make_shared<BipedalLocomotion::IK::AngularMomentumTask>();
106+
ok = ok && m_angularMomentumTask->setKinDyn(kinDyn);
107+
ok = ok && m_angularMomentumTask->initialize(ptr->getGroup("ANGULAR_MOMENTUM_TASK"));
108+
109+
Eigen::VectorXd angularMomentumWeight;
110+
ok = ok && ptr->getGroup("ANGULAR_MOMENTUM_TASK").lock()->getParameter("weight", angularMomentumWeight);
111+
112+
ok = ok
113+
&& m_qpIK.addTask(m_angularMomentumTask,
114+
"angular_momentum_task",
115+
lowPriority,
116+
angularMomentumWeight);
117+
if (!ok)
118+
{
119+
BipedalLocomotion::log()->error("{} Unable to initialize the angular momentum task.", prefix);
120+
return false;
121+
}
122+
105123
if (m_usejointRetargeting)
106124
{
107125
m_jointRetargetingTask = std::make_shared<BipedalLocomotion::IK::JointTrackingTask>();
@@ -124,6 +142,9 @@ bool BLFIK::initialize(
124142

125143
ok = ok && m_qpIK.finalize(m_variableHandler);
126144

145+
m_angularMomentumTask->setSetPoint(Eigen::Vector3d::Zero());
146+
147+
127148
BipedalLocomotion::log()->info("[BLFIK::initialize] {}", m_qpIK.toString());
128149

129150
m_jointVelocity.resize(kinDyn->getNrOfDegreesOfFreedom());

0 commit comments

Comments
 (0)