From 36d8f52dce216213a201a2e971803a76de579ec4 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 26 Sep 2024 11:33:37 +0200 Subject: [PATCH] Add workaround to permit to take in input const signal in Simulink autogenerated code (#85) --- matlab/BlockFactory.tlc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matlab/BlockFactory.tlc b/matlab/BlockFactory.tlc index 07253da..96f71e0 100644 --- a/matlab/BlockFactory.tlc +++ b/matlab/BlockFactory.tlc @@ -202,9 +202,10 @@ %endif %%assign width = LibBlockInputSignalWidth(i) %assign address = LibBlockInputSignalAddr(i, "", "", 0) + // The const_cast is a workaround to solve https://github.com/robotology/blockfactory/issues/81 blockInfo->setInputPort( {%, {%, %}, blockfactory::core::Port::DataType::DOUBLE}, - static_cast(%
)); + const_cast(static_cast(%
))); %endforeach // Outputs