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

Remove homebrew job from CI #822

Merged
merged 10 commits into from
Apr 5, 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
61 changes: 8 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ env:
vcpkg_robotology_TAG: v0.11.0
YCM_TAG: v0.15.3
YARP_TAG: v3.8.0
iDynTree_TAG: v8.0.0
iDynTree_TAG: 42f2874b729348575aeee723c1775c3425735ef9
CasADi_TAG: 3.5.5.2
manif_TAG: 0.0.4
manif_TAG: 0.0.4.102
matioCpp_TAG: v0.2.0
LieGroupControllers_TAG: v0.2.0
osqp_TAG: v0.6.2
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
strategy:
matrix:
build_type: [Release, Debug]
os: [ubuntu-20.04, windows-2019, macos-latest]
os: [ubuntu-20.04, windows-2019]
fail-fast: false

steps:
Expand Down Expand Up @@ -92,25 +92,6 @@ jobs:
unzip vcpkg-robotology.zip -d C:/
rm vcpkg-robotology.zip

- name: Fixup brew [macOS]
if: matrix.os == 'macos-latest'
run: |
# Unlink and re-link to prevent errors when github mac runner images
# install python outside of brew, for example:
# https://github.com/orgs/Homebrew/discussions/3895
# https://github.com/actions/setup-python/issues/577
# https://github.com/actions/runner-images/issues/6459
# https://github.com/actions/runner-images/issues/6507
# https://github.com/actions/runner-images/issues/2322
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done

- name: Dependencies [macOS]
if: matrix.os == 'macos-latest'
run: |
brew update
brew install ace boost eigen swig qt5 orocos-kdl qhull ipopt cppad pkg-config pybind11 \
libmatio spdlog librealsense nlohmann-json numpy assimp

- name: Dependencies [Ubuntu]
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand Down Expand Up @@ -143,10 +124,6 @@ jobs:
if: startsWith(matrix.os, 'ubuntu')
run: echo "NUM_CORES_FOR_CMAKE_BUILD=`nproc --all`" >> $GITHUB_ENV

- name: Get number of cores to speed up cmake build [macOS]
if: matrix.os == 'macos-latest'
run: echo "NUM_CORES_FOR_CMAKE_BUILD=`sysctl -n hw.logicalcpu`" >> $GITHUB_ENV

- name: Cache Source-based Dependencies
id: cache-source-deps
uses: actions/cache@v3
Expand Down Expand Up @@ -248,7 +225,7 @@ jobs:

# manif
cd ${GITHUB_WORKSPACE}
git clone https://github.com/artivis/manif.git
git clone https://github.com/robotology-dependencies/manif.git
cd manif
git checkout ${manif_TAG}
mkdir build
Expand Down Expand Up @@ -339,8 +316,8 @@ jobs:
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}}

- name: Source-based Dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (startsWith(matrix.os, 'ubuntu') || matrix.os == 'macos-latest')
- name: Source-based Dependencies [Ubuntu]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu')
shell: bash
run: |

Expand Down Expand Up @@ -420,12 +397,12 @@ jobs:

# manif
cd ${GITHUB_WORKSPACE}
git clone https://github.com/artivis/manif.git
git clone https://github.com/robotology-dependencies/manif.git
cd manif
git checkout ${manif_TAG}
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake -DBUILD_PYTHON_BINDINGS:BOOL=ON -DMANIFPY_PKGDIR:PATH=${GITHUB_WORKSPACE}/install/deps/lib/python3/dist-packages -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}}

# matioCpp
Expand Down Expand Up @@ -502,14 +479,6 @@ jobs:

cmake --build . --config ${{ matrix.build_type }} --target install -j${{env.NUM_CORES_FOR_CMAKE_BUILD}}

- name: Install manifpy [Ubuntu/macOS]
if: startsWith(matrix.os, 'ubuntu') || matrix.os == 'macos-latest'
run: |
git clone https://github.com/artivis/manif.git manifpy
cd manifpy
git checkout ${manif_TAG}
python3 -m pip install .

- name: Check Python setup
shell: bash
run: |
Expand Down Expand Up @@ -554,20 +523,6 @@ jobs:
-DENABLE_YarpRobotLoggerDevice:BOOL=ON \
-DFRAMEWORK_RUN_Valgrind_tests:BOOL=ON ..

- name: Configure [macOS]
if: matrix.os == 'macos-latest'
shell: bash
run: |
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=ON \
-DPython3_ROOT_DIR=$(python -c "import sys; print(sys.prefix)") -DFRAMEWORK_USE_Python3:BOOL=ON -DFRAMEWORK_USE_pybind11:BOOL=ON \
-DFRAMEWORK_TEST_PYTHON_BINDINGS:BOOL=OFF \
-DBUILD_TESTING:BOOL=ON ..

- name: Check build if some dependencies are not enabled [Ubuntu]
if: github.event_name != 'push' && github.event_name != 'release' && matrix.os == 'ubuntu-20.04'
shell: bash
Expand Down
20 changes: 13 additions & 7 deletions src/IK/tests/QPFixedBaseInverseKinematicsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using namespace BipedalLocomotion::Conversions;
using namespace std::chrono_literals;

constexpr auto robotVelocity = "robotVelocity";
constexpr std::chrono::nanoseconds dT = 5ms;
constexpr std::chrono::nanoseconds dT = 10ms;

struct InverseKinematicsAndTasks
{
Expand All @@ -62,7 +62,7 @@ struct System

std::shared_ptr<IParametersHandler> createParameterHandler()
{
constexpr double gain = 0.5;
constexpr double gain = 20.0;

auto parameterHandler = std::make_shared<StdImplementation>();
parameterHandler->setParameter("robot_velocity_variable_name", robotVelocity);
Expand Down Expand Up @@ -110,7 +110,6 @@ InverseKinematicsAndTasks createIK(std::shared_ptr<IParametersHandler> handler,

out.regularizationTask = std::make_shared<JointTrackingTask>();


REQUIRE(out.regularizationTask->setKinDyn(kinDyn));
REQUIRE(out.regularizationTask->initialize(handler->getGroup("REGULARIZATION_TASK")));
REQUIRE(out.ik->addTask(out.regularizationTask,
Expand Down Expand Up @@ -189,15 +188,18 @@ System getSystem(std::shared_ptr<iDynTree::KinDynComputations> kinDyn)
Eigen::VectorXd jointPositions(kinDyn->getNrOfDegreesOfFreedom());
Eigen::Vector3d gravity;

REQUIRE(kinDyn->getRobotState(basePose, jointPositions, baseVelocity, jointVelocities, gravity));
REQUIRE(kinDyn->getRobotState(basePose, //
jointPositions,
baseVelocity,
jointVelocities,
gravity));

// perturb the joint position
for (int i = 0; i < kinDyn->getNrOfDegreesOfFreedom(); i++)
{
jointPositions[i] += distribution(generator);
}


out.dynamics = std::make_shared<FloatingBaseSystemKinematics>();
out.dynamics->setState({basePose.topRightCorner<3, 1>(),
toManifRot(basePose.topLeftCorner<3, 3>()),
Expand Down Expand Up @@ -226,7 +228,11 @@ TEST_CASE("QP-IK")
DYNAMIC_SECTION("Model with " << numberOfJoints << " joints")
{
// create the model
const iDynTree::Model model = iDynTree::getRandomModel(numberOfJoints);
constexpr std::size_t nrOfAdditionalFrames = 10;
constexpr bool onlyRevoluteJoints = true;
const iDynTree::Model model = iDynTree::getRandomChain(numberOfJoints,
nrOfAdditionalFrames,
onlyRevoluteJoints);
REQUIRE(kinDyn->loadRobotModel(model));

const auto desiredSetPoints = getDesiredReference(kinDyn, numberOfJoints);
Expand All @@ -251,7 +257,7 @@ TEST_CASE("QP-IK")
REQUIRE(ikAndTasks.regularizationTask->setSetPoint(desiredSetPoints.joints));

// propagate the inverse kinematics for
constexpr std::size_t iterations = 10;
constexpr std::size_t iterations = 20;
Eigen::Vector3d gravity;
gravity << 0, 0, -9.81;
Eigen::Matrix4d baseTransform = Eigen::Matrix4d::Identity();
Expand Down
39 changes: 28 additions & 11 deletions src/IK/tests/QPInverseKinematicsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,31 +320,33 @@ inline std::string customInt2string(int i)
return ss.str();
}

// Workaround for https://github.com/ami-iit/bipedal-locomotion-framework/issues/799
inline iDynTree::Model customGetRandomModelWithNoPrismaticJoints(unsigned int nrOfJoints, size_t nrOfAdditionalFrames = 10, bool onlyRevoluteJoints=false)
// Workaround for https://github.com/ami-iit/bipedal-locomotion-framework/issues/799 and
// https://github.com/robotology/idyntree/pull/1171
inline iDynTree::Model customGetRandomModelWithNoPrismaticJoints(unsigned int nrOfJoints,
size_t nrOfAdditionalFrames = 10,
bool onlyRevoluteJoints = false)
{
iDynTree::Model model;

model.addLink("baseLink", iDynTree::getRandomLink());

for(unsigned int i=0; i < nrOfJoints; i++)
for (unsigned int i = 0; i < nrOfJoints; i++)
{
std::string parentLink = iDynTree::getRandomLinkOfModel(model);
std::string linkName = "link" + customInt2string(i);
iDynTree::addRandomLinkToModel(model,parentLink,linkName,onlyRevoluteJoints);
iDynTree::addRandomLinkToModel(model, parentLink, linkName, onlyRevoluteJoints);
}

for(unsigned int i=0; i < nrOfAdditionalFrames; i++)
for (unsigned int i = 0; i < nrOfAdditionalFrames; i++)
{
std::string parentLink = iDynTree::getRandomLinkOfModel(model);
std::string frameName = "additionalFrame" + customInt2string(i);
iDynTree::addRandomAdditionalFrameToModel(model,parentLink,frameName);
iDynTree::addRandomAdditionalFrameToModel(model, parentLink, frameName);
}

return model;
}


TEST_CASE("QP-IK")
{
auto kinDyn = std::make_shared<iDynTree::KinDynComputations>();
Expand All @@ -365,7 +367,10 @@ TEST_CASE("QP-IK")
// create the model
size_t nrOfAdditionalFrames = 10;
bool onlyRevoluteJoints = true;
const iDynTree::Model model = customGetRandomModelWithNoPrismaticJoints(numberOfJoints,nrOfAdditionalFrames,onlyRevoluteJoints);
const iDynTree::Model model
= customGetRandomModelWithNoPrismaticJoints(numberOfJoints,
nrOfAdditionalFrames,
onlyRevoluteJoints);
REQUIRE(kinDyn->loadRobotModel(model));

const auto desiredSetPoints = getDesiredReference(kinDyn, numberOfJoints);
Expand Down Expand Up @@ -499,7 +504,11 @@ TEST_CASE("QP-IK [With strict limits]")
constexpr std::size_t numberOfJoints = 30;

// create the model
const iDynTree::Model model = iDynTree::getRandomModel(numberOfJoints);
size_t nrOfAdditionalFrames = 10;
bool onlyRevoluteJoints = true;
const iDynTree::Model model = customGetRandomModelWithNoPrismaticJoints(numberOfJoints,
nrOfAdditionalFrames,
onlyRevoluteJoints);
REQUIRE(kinDyn->loadRobotModel(model));

const auto desiredSetPoints = getDesiredReference(kinDyn, numberOfJoints);
Expand Down Expand Up @@ -629,7 +638,11 @@ TEST_CASE("QP-IK [With builder]")
constexpr std::size_t numberOfJoints = 30;

// create the model
const iDynTree::Model model = iDynTree::getRandomModel(numberOfJoints);
size_t nrOfAdditionalFrames = 10;
bool onlyRevoluteJoints = true;
const iDynTree::Model model = customGetRandomModelWithNoPrismaticJoints(numberOfJoints,
nrOfAdditionalFrames,
onlyRevoluteJoints);
REQUIRE(kinDyn->loadRobotModel(model));

// VariableHandler and IK params
Expand Down Expand Up @@ -782,7 +795,11 @@ TEST_CASE("QP-IK [Distance and Gravity tasks]")
constexpr std::size_t numberOfJoints = 30;

// create the model
const iDynTree::Model model = iDynTree::getRandomModel(numberOfJoints);
size_t nrOfAdditionalFrames = 10;
bool onlyRevoluteJoints = true;
const iDynTree::Model model = customGetRandomModelWithNoPrismaticJoints(numberOfJoints,
nrOfAdditionalFrames,
onlyRevoluteJoints);
REQUIRE(kinDyn->loadRobotModel(model));

const auto desiredSetPoints = getDesiredReference(kinDyn, numberOfJoints);
Expand Down
Loading