Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix idyntree deprecations #66

Merged
merged 8 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: C++ CI Workflow
on:
push:
pull_request:

env:
iDynTree_TAG: v4.3.0
iDynTree_TAG: v10.0.0


jobs:
build:
Expand Down Expand Up @@ -48,15 +48,15 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libeigen3-dev

- name: Cache Source-based Dependencies
id: cache-source-deps
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/install/deps
# Including ${{ runner.temp }} is a workaround taken from https://github.com/robotology/whole-body-estimators/pull/62 to fix macos configuration failure on https://github.com/dic-iit/bipedal-locomotion-framework/pull/45
key: source-deps-${{ runner.os }}-${{runner.temp}}-build-type-${{ matrix.build_type }}-iDynTree-${{ env.iDynTree_TAG }}

- name: Source-based Dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (startsWith(matrix.os, 'ubuntu') || matrix.os == 'macos-latest')
shell: bash
Expand Down Expand Up @@ -108,4 +108,4 @@ jobs:
run: |
cd build
ctest --output-on-failure -C ${{ matrix.build_type }} .

17 changes: 8 additions & 9 deletions .github/workflows/conda-forge-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
# schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
# Execute a "nightly" build at 2 AM UTC
# - cron: '0 2 * * *'

jobs:
Expand All @@ -23,26 +23,25 @@ jobs:

- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
miniforge-variant: Mambaforge
miniforge-version: latest

- name: Dependencies
shell: bash -l {0}
run: |
# Compilation related dependencies
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install eigen idyntree

- name: Configure [Linux&macOS]
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -GNinja -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..

- name: Configure [Windows]
if: contains(matrix.os, 'windows')
shell: bash -l {0}
Expand All @@ -51,12 +50,12 @@ jobs:
cd build
cmake -G"Visual Studio 16 2019" -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..

- name: Build
- name: Build
shell: bash -l {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}

- name: Test
shell: bash -l {0}
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
endif()
endif()

find_package(iDynTree 4.3.0 REQUIRED)
find_package(iDynTree 10.0.0 REQUIRED)
find_package(Eigen3 REQUIRED)

set(UCPLANNER_SOURCES src/ControlledUnicycle.cpp
Expand Down
4 changes: 2 additions & 2 deletions include/ControlledUnicycle.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

#include <iDynTree/DynamicalSystem.h>
#include <iDynTree/Controller.h>
#include <iDynTree/Core/VectorDynSize.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/VectorDynSize.h>
#include <iDynTree/VectorFixSize.h>
#include <memory>

class ControlledUnicycle : public iDynTree::optimalcontrol::DynamicalSystem{
Expand Down
4 changes: 2 additions & 2 deletions include/DCMTrajectoryGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <StepPhase.h>
#include <FootPrint.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/VectorFixSize.h>

#include <vector>
#include <memory>
Expand Down Expand Up @@ -46,7 +46,7 @@ class DCMTrajectoryGenerator {
* @param right Right Steps
* @return True in case of success.
*/
bool computeNewTrajectories(double initTime, double dT, double switchPercentage, double maxStepTime,
bool computeNewTrajectories(double initTime, double dT, double switchPercentage, double maxStepTime, double endSwitchTime,
double nominalStepTime, bool pauseActive, const std::vector<const Step *> &orderedSteps,
const std::vector<size_t> &phaseShift, const std::vector<StepPhase> &lFootPhases,
const FootPrint &left, const FootPrint &right);
Expand Down
10 changes: 8 additions & 2 deletions include/DCMTrajectoryGeneratorHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <Eigen/Dense>

// iDynTree
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/VectorFixSize.h>

#include <FootPrint.h>
#include <StepPhase.h>
Expand Down Expand Up @@ -142,6 +142,7 @@ class DCMTrajectoryGeneratorHelper

double m_maxDoubleSupportDuration; /**< Max duration of a DS phase. */
double m_nominalDoubleSupportDuration; /**< Nominal duration of a DS phase. */
double m_endSwitchTime; /**< Duration of the switch time to get to a stop. */
bool m_pauseActive; /**< True if the pause feature is activate. */

std::vector<std::shared_ptr<GeneralSupportTrajectory>> m_trajectory; /**< Vector containing pointer of every trajectory phase. */
Expand All @@ -152,6 +153,8 @@ class DCMTrajectoryGeneratorHelper
std::vector<iDynTree::Vector2> m_ZMPPosition; /**< Vector containing the position of the ZMP. */
std::vector<double> m_weightInLeft, m_weightInRight; /**< Vectors containing the percentage of weight carried by the foot. */

bool m_timingWarningPrinted{false}; /**< Flag used to print a warning message about the timings only once. */


/**
* Add the last Single and Double support phases.
Expand Down Expand Up @@ -279,11 +282,14 @@ class DCMTrajectoryGeneratorHelper

/**
* Set the pause condition.
* @param pauseActive is a flag used to activate the pause feature;
* @param maxDoubleSupportDuration is the maximum duration of a DS phase;
* @param nominalDoubleSupportDuration is the nominal duration of a DS phase.
* @param endSwitchTime is the duration of the switch time to get to a stop.
* @return true if the pause conditions are set, false otherwise.
*/
bool setPauseConditions(bool pauseActive, const double &maxDoubleSupportDuration, const double &nominalDoubleSupportDuration);
bool setPauseConditions(bool pauseActive, const double &maxDoubleSupportDuration,
const double &nominalDoubleSupportDuration, const double& endSwitchTime);

/**
* Set the last step DCM offset
Expand Down
2 changes: 1 addition & 1 deletion include/FeetCubicSplineGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <FootPrint.h>
#include <FeetGenerator.h>

#include <iDynTree/Core/Transform.h>
#include <iDynTree/Transform.h>

#include <vector>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion include/FeetGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <StepPhase.h>
#include <FootPrint.h>

#include <iDynTree/Core/Transform.h>
#include <iDynTree/Transform.h>

#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion include/FeetMinimumJerkGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <FootPrint.h>
#include <FeetGenerator.h>

#include <iDynTree/Core/Transform.h>
#include <iDynTree/Transform.h>

#include <vector>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion include/FootPrint.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <deque>
#include <memory>
#include "iDynTree/Core/VectorFixSize.h"
#include "iDynTree/VectorFixSize.h"

struct Step{
iDynTree::Vector2 position;
Expand Down
4 changes: 2 additions & 2 deletions include/FreeSpaceEllipse.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#ifndef FREESPACEELLIPSE_H
#define FREESPACEELLIPSE_H

#include <iDynTree/Core/MatrixFixSize.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/MatrixFixSize.h>
#include <iDynTree/VectorFixSize.h>

class FreeSpaceEllipse
{
Expand Down
6 changes: 3 additions & 3 deletions include/PersonFollowingController.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include "FreeSpaceEllipse.h"
#include "UnicycleBaseController.h"
#include <iDynTree/TimeRange.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/Core/VectorDynSize.h>
#include <iDynTree/Core/MatrixDynSize.h>
#include <iDynTree/VectorFixSize.h>
#include <iDynTree/VectorDynSize.h>
#include <iDynTree/MatrixDynSize.h>
#include <deque>

typedef struct{
Expand Down
4 changes: 2 additions & 2 deletions include/UnicycleBaseController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#define UNICYCLEBASECONTROLLER_H

#include <iDynTree/Controller.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/Core/VectorDynSize.h>
#include <iDynTree/VectorFixSize.h>
#include <iDynTree/VectorDynSize.h>

class UnicycleBaseController : public iDynTree::optimalcontrol::Controller{

Expand Down
4 changes: 2 additions & 2 deletions include/UnicycleFoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <memory>
#include "FootPrint.h"
#include "UnicycleState.h"
#include "iDynTree/Core/VectorFixSize.h"
#include "iDynTree/Core/MatrixDynSize.h"
#include "iDynTree/VectorFixSize.h"
#include "iDynTree/MatrixDynSize.h"

class UnicycleFoot {
std::shared_ptr<FootPrint> m_steps_ptr;
Expand Down
3 changes: 2 additions & 1 deletion include/UnicycleGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ class UnicycleGenerator {
//Settings
bool setSwitchOverSwingRatio(double ratio = 1.0); //indeed the swing time cannot be null, while the switch time can be very close to zero (but not zero)

bool setTerminalHalfSwitchTime(double lastHalfSwitchTime); //if not set, it won't bring the ZMP at the center of the feet at the end
bool setTerminalHalfSwitchTime(double lastHalfSwitchTime);

bool setPauseConditions(double maxStepTime, double nominalStepTime);

void setPauseActive(bool isPauseActive);

void disablePauseConditions();

[[deprecated("Use unicyclePlanner()->setNavigationPath(path) instead")]]
bool setNavigationPath(const std::vector<UnicycleState> &path);

/**
Expand Down
4 changes: 2 additions & 2 deletions include/UnicycleOptimization.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <iDynTree/Constraint.h>
#include <iDynTree/Cost.h>
#include <iDynTree/OptimalControlProblem.h>
#include <iDynTree/Core/VectorDynSize.h>
#include <iDynTree/Core/VectorFixSize.h>
#include <iDynTree/VectorDynSize.h>
#include <iDynTree/VectorFixSize.h>
#include <cmath>
#include <string>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion include/UnicycleState.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#ifndef UNICYCLE_STATE_H
#define UNICYCLE_STATE_H
#include "iDynTree/Core/VectorFixSize.h"
#include "iDynTree/VectorFixSize.h"

struct UnicycleState
{
Expand Down
2 changes: 1 addition & 1 deletion include/ZMPTrajectoryGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ZMPTrajectoryGenerator {
class ZMPTrajectoryGeneratorImplementation;
std::unique_ptr<ZMPTrajectoryGeneratorImplementation> m_pimpl;

bool computeNewTrajectories(double initTime, double dT, double switchPercentage, double maxStepTime,
bool computeNewTrajectories(double initTime, double dT, double switchPercentage, double maxStepTime, double endSwitchTime,
double nominalStepTime, bool pauseActive, const std::vector<size_t> &mergePoints,
const FootPrint &left, const FootPrint &right,
const std::vector<const Step*>& orderedSteps,
Expand Down
4 changes: 2 additions & 2 deletions src/CoMHeightTrajectoryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <mutex>

#include <CoMHeightTrajectoryGenerator.h>
#include <iDynTree/Core/VectorDynSize.h>
#include <iDynTree/Core/CubicSpline.h>
#include <iDynTree/VectorDynSize.h>
#include <iDynTree/CubicSpline.h>


class CoMHeightTrajectoryGenerator::CoMHeightTrajectoryGeneratorImplementation {
Expand Down
6 changes: 3 additions & 3 deletions src/DCMTrajectoryGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <DCMTrajectoryGenerator.h>
#include <DCMTrajectoryGeneratorHelper.h>
#include <iDynTree/Core/EigenHelpers.h>
#include <iDynTree/EigenHelpers.h>
#include <cassert>
#include <iostream>
#include <cmath>
Expand Down Expand Up @@ -38,7 +38,7 @@ DCMTrajectoryGenerator::DCMTrajectoryGenerator()

}

bool DCMTrajectoryGenerator::computeNewTrajectories(double initTime, double dT, double switchPercentage, double maxStepTime,
bool DCMTrajectoryGenerator::computeNewTrajectories(double initTime, double dT, double switchPercentage, double maxStepTime, double endSwitchTime,
double nominalStepTime, bool pauseActive, const std::vector<const Step *> &orderedSteps,
const std::vector<size_t> &phaseShift, const std::vector<StepPhase> &lFootPhases,
const FootPrint &left, const FootPrint &right)
Expand Down Expand Up @@ -91,7 +91,7 @@ bool DCMTrajectoryGenerator::computeNewTrajectories(double initTime, double dT,
double maxSwitchTime = switchPercentage * maxStepTime;
double nominalSwitchTime = switchPercentage * nominalStepTime;

if (!m_pimpl->helper.setPauseConditions(pauseActive, maxSwitchTime, nominalSwitchTime)) {
if (!m_pimpl->helper.setPauseConditions(pauseActive, maxSwitchTime, nominalSwitchTime, endSwitchTime)) {
std::cerr << "[DCMTrajectoryGenerator::interpolateDCM] Failed to set pause conditions." << std::endl;
return false;
}
Expand Down
Loading
Loading