From 3aa7992bf61240b10ad97c329fb68da5d7521a02 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 5 Dec 2024 12:59:15 +0100 Subject: [PATCH] fixup --- src/model/src/ModelTransformers.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/model/src/ModelTransformers.cpp b/src/model/src/ModelTransformers.cpp index 9c69712b1d..6b7babb9c3 100644 --- a/src/model/src/ModelTransformers.cpp +++ b/src/model/src/ModelTransformers.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -283,7 +282,8 @@ void reducedModelAddAdditionalFrames(const Model& fullModel, const FreeFloatingPos& pos, LinkPositions& subModelBase_X_link, const std::unordered_map& newLink_H_oldLink, - const std::optional>& allowedAdditionalFrames) + bool includeAllAdditionalFrames, + const std::vector& allowedAdditionalFrames) { // First compute the transform between each link in the submodel and the submodel base computeTransformToTraversalBaseWithAdditionalTransform(fullModel,linkSubModel,pos.jointPos(),subModelBase_X_link,newLink_H_oldLink); @@ -330,10 +330,10 @@ void reducedModelAddAdditionalFrames(const Model& fullModel, bool shouldWeAddTheAdditionalFrame = true; // Check if we need to add the additional frame or not - if (allowedAdditionalFrames.has_value()) + if (!includeAllAdditionalFrames) { // If allowedAdditionalFrames has a value, we only need to add additional frames specified ther - if (std::find(allowedAdditionalFrames.value().begin(), allowedAdditionalFrames.value().end(), additionalFrameName) == allowedAdditionalFrames.value().end()) + if (std::find(allowedAdditionalFrames.begin(), allowedAdditionalFrames.end(), additionalFrameName) == allowedAdditionalFrames.end()) { shouldWeAddTheAdditionalFrame = false; } @@ -541,7 +541,8 @@ bool createReducedModelAndChangeLinkFrames(const Model& fullModel, // As this quantity is influenced by newLink_H_oldLink, this is passed along reducedModelAddAdditionalFrames(fullModel,reducedModel, linkName,subModels.getTraversal(linkInReducedModel), - jointPos,subModelBase_X_link,newLink_H_oldLink,{}); + jointPos,subModelBase_X_link,newLink_H_oldLink, + includeAllAdditionalFrames,allowedAdditionalFrames); // Lump the visual and collision shapes in the new model reducedModelAddSolidShapes(fullModel,reducedModel,