From e857c46230f28bc4e0fa971436ea0a293b3e6c88 Mon Sep 17 00:00:00 2001 From: arthur Date: Tue, 7 Nov 2023 14:00:32 +0100 Subject: [PATCH 1/2] Bug Fix : pair-collision.hxx, changing the method to check the pair_id with collisionPair.size() --- include/crocoddyl/multibody/residuals/pair-collision.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crocoddyl/multibody/residuals/pair-collision.hxx b/include/crocoddyl/multibody/residuals/pair-collision.hxx index faca6720e4..e54981accc 100644 --- a/include/crocoddyl/multibody/residuals/pair-collision.hxx +++ b/include/crocoddyl/multibody/residuals/pair-collision.hxx @@ -26,7 +26,7 @@ ResidualModelPairCollisionTpl::ResidualModelPairCollisionTpl( geom_model_(geom_model), pair_id_(pair_id), joint_id_(joint_id) { - if (static_cast(geom_model->ngeoms) <= pair_id) { + if (static_cast(geom_model->collisionPairs.size()) <= pair_id) { throw_pretty( "Invalid argument: " << "the pair index is wrong (it does not exist in the geometry model)"); From 117b730e6f129d1a9cdf6f25195b494c5506cf16 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:19:07 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/crocoddyl/multibody/residuals/pair-collision.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/crocoddyl/multibody/residuals/pair-collision.hxx b/include/crocoddyl/multibody/residuals/pair-collision.hxx index e54981accc..19ba1ffff7 100644 --- a/include/crocoddyl/multibody/residuals/pair-collision.hxx +++ b/include/crocoddyl/multibody/residuals/pair-collision.hxx @@ -26,7 +26,8 @@ ResidualModelPairCollisionTpl::ResidualModelPairCollisionTpl( geom_model_(geom_model), pair_id_(pair_id), joint_id_(joint_id) { - if (static_cast(geom_model->collisionPairs.size()) <= pair_id) { + if (static_cast(geom_model->collisionPairs.size()) <= + pair_id) { throw_pretty( "Invalid argument: " << "the pair index is wrong (it does not exist in the geometry model)");