Skip to content

Commit b7adab2

Browse files
Merge pull request #334 from dic-iit/diegoferigo-patch-1
Restore backward compatibility of SwingFootPlanner parameters
2 parents bd401fe + b3ccb3e commit b7adab2

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ All notable changes to this project are documented in this file.
6060
- Fix `YarpImplementation::setParameterPrivate()` when a boolean or a vector of boolean is passed (https://github.com/dic-iit/bipedal-locomotion-framework/pull/311)
6161
- Add `foot_take_off_acceleration` and `foot_take_off_velocity` parameters in the `SwingFootPlanner` class (https://github.com/dic-iit/bipedal-locomotion-framework/issues/323)
6262
- Change the parameters handler verbosity (https://github.com/dic-iit/bipedal-locomotion-framework/pull/330)
63+
- Restore backward compatibility of SwingFootPlanner parameters (https://github.com/dic-iit/bipedal-locomotion-framework/pull/334)
6364

6465
### Fixed
6566
- Fix missing implementation of `YarpSensorBridge::getFailedSensorReads()`. (https://github.com/dic-iit/bipedal-locomotion-framework/pull/202)

src/Planners/include/BipedalLocomotion/Planners/SwingFootPlanner.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class SwingFootPlanner : public System::Source<SwingFootPlannerState>
7575
* | `sampling_time` | `double` | Sampling time of the planner in seconds | Yes |
7676
* | `step_height` | `double` | Height of the swing foot. It is not the maximum height of the foot. If apex time is 0.5 `step_height` is the maximum | Yes |
7777
* | `foot_apex_time` | `double` | Number between 0 and 1 representing the foot apex instant. If 0 the apex happens at take off if 1 at touch down | Yes |
78-
* | `foot_landing_velocity` | `double` | Landing vertical velocity | Yes |
79-
* | `foot_landing_acceleration` | `double` | Landing vertical acceleration | Yes |
80-
* | `foot_take_off_velocity` | `double` | Take-off vertical velocity | Yes |
81-
* | `foot_take_off_acceleration` | `double` | Take-off vertical acceleration | Yes |
78+
* | `foot_landing_velocity` | `double` | Landing vertical velocity (default value 0.0) | No |
79+
* | `foot_landing_acceleration` | `double` | Landing vertical acceleration (default value 0.0) | No |
80+
* | `foot_take_off_velocity` | `double` | Take-off vertical velocity (default value 0.0) | No |
81+
* | `foot_take_off_acceleration` | `double` | Take-off vertical acceleration (default value 0.0) | No |
8282
* @return True in case of success/false otherwise.
8383
*/
8484
bool initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler) final;

src/Planners/src/SwingFootPlanner.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,32 @@ bool SwingFootPlanner::initialize(std::weak_ptr<const ParametersHandler::IParame
4343
return false;
4444
}
4545

46-
double footTakeOffVelocity;
46+
double footTakeOffVelocity = 0.0;
4747
if (!ptr->getParameter("foot_take_off_velocity", footTakeOffVelocity))
4848
{
49-
log()->error("{} Unable to initialize the foot take-off velocity.", logPrefix);
50-
return false;
49+
log()->info("{} Using default foot_take_off_velocity={}.", logPrefix, footTakeOffVelocity);
5150
}
5251

53-
double footTakeOffAcceleration;
52+
double footTakeOffAcceleration = 0.0;
5453
if (!ptr->getParameter("foot_take_off_acceleration", footTakeOffAcceleration))
5554
{
56-
log()->error("{} Unable to initialize the foot take-off acceleration.", logPrefix);
57-
return false;
55+
log()->info("{} Using default foot_take_off_acceleration={}.",
56+
logPrefix,
57+
footTakeOffAcceleration);
5858
}
5959

60-
double footLandingVelocity;
60+
double footLandingVelocity = 0.0;
6161
if (!ptr->getParameter("foot_landing_velocity", footLandingVelocity))
6262
{
63-
log()->error("{} Unable to initialize the foot landing velocity.", logPrefix);
64-
return false;
63+
log()->info("{} Using default foot_landing_velocity={}.", logPrefix, footLandingVelocity);
6564
}
6665

67-
double footLandingAcceleration;
66+
double footLandingAcceleration = 0.0;
6867
if (!ptr->getParameter("foot_landing_acceleration", footLandingAcceleration))
6968
{
70-
log()->error("{} Unable to initialize the foot landing acceleration.", logPrefix);
71-
return false;
69+
log()->info("{} Using default foot_landing_acceleration={}.",
70+
logPrefix,
71+
footLandingAcceleration);
7272
}
7373

7474
// check the parameters passed to the planner

0 commit comments

Comments
 (0)