From cc4583cf6007151049bf3ba80015757bc0207e5f Mon Sep 17 00:00:00 2001 From: Megane Millan Date: Tue, 9 Jul 2024 14:04:44 +0200 Subject: [PATCH] [Joint] Modify default behaviour and return const --- include/pinocchio/multibody/joint/joint-helical.hpp | 5 +++-- include/pinocchio/multibody/joint/joint-prismatic.hpp | 5 +++-- .../pinocchio/multibody/joint/joint-revolute-unbounded.hpp | 5 +++-- include/pinocchio/multibody/joint/joint-revolute.hpp | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/pinocchio/multibody/joint/joint-helical.hpp b/include/pinocchio/multibody/joint/joint-helical.hpp index 255f28d301..dc92b2fb44 100644 --- a/include/pinocchio/multibody/joint/joint-helical.hpp +++ b/include/pinocchio/multibody/joint/joint-helical.hpp @@ -925,7 +925,7 @@ namespace pinocchio return classname(); } - Vector3 getMotionAxis() + Vector3 getMotionAxis() const { switch (axis) { @@ -936,7 +936,8 @@ namespace pinocchio case 2: return Vector3::UnitZ(); default: - return Vector3::Zero(); + assert(false && "must never happen"); + break; } } diff --git a/include/pinocchio/multibody/joint/joint-prismatic.hpp b/include/pinocchio/multibody/joint/joint-prismatic.hpp index 7512600b06..2a8233cbfc 100644 --- a/include/pinocchio/multibody/joint/joint-prismatic.hpp +++ b/include/pinocchio/multibody/joint/joint-prismatic.hpp @@ -744,7 +744,7 @@ namespace pinocchio return classname(); } - Vector3 getMotionAxis() + Vector3 getMotionAxis() const { switch (axis) { @@ -755,7 +755,8 @@ namespace pinocchio case 2: return Vector3::UnitZ(); default: - return Vector3::Zero(); + assert(false && "must never happen"); + break; } } diff --git a/include/pinocchio/multibody/joint/joint-revolute-unbounded.hpp b/include/pinocchio/multibody/joint/joint-revolute-unbounded.hpp index cb9aafe0b4..fb635e4319 100644 --- a/include/pinocchio/multibody/joint/joint-revolute-unbounded.hpp +++ b/include/pinocchio/multibody/joint/joint-revolute-unbounded.hpp @@ -202,7 +202,7 @@ namespace pinocchio return classname(); } - Vector3 getMotionAxis() + Vector3 getMotionAxis() const { switch (axis) { @@ -213,7 +213,8 @@ namespace pinocchio case 2: return Vector3::UnitZ(); default: - return Vector3::Zero(); + assert(false && "must never happen"); + break; } } diff --git a/include/pinocchio/multibody/joint/joint-revolute.hpp b/include/pinocchio/multibody/joint/joint-revolute.hpp index b50b520f3f..9eaeeebe62 100644 --- a/include/pinocchio/multibody/joint/joint-revolute.hpp +++ b/include/pinocchio/multibody/joint/joint-revolute.hpp @@ -840,7 +840,7 @@ namespace pinocchio return classname(); } - Vector3 getMotionAxis() + Vector3 getMotionAxis() const { switch (axis) { @@ -851,7 +851,8 @@ namespace pinocchio case 2: return Vector3::UnitZ(); default: - return Vector3::Zero(); + assert(false && "must never happen"); + break; } }