Skip to content

Commit

Permalink
Add workaround to permit to take in input const signal in Simulink au…
Browse files Browse the repository at this point in the history
…togenerated code (#85)
  • Loading branch information
traversaro authored Sep 26, 2024
1 parent dc9c91a commit 36d8f52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion matlab/BlockFactory.tlc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{%<i>, {%<rows>, %<cols>}, blockfactory::core::Port::DataType::DOUBLE},
static_cast<void*>(%<address>));
const_cast<void*>(static_cast<const void*>(%<address>)));
%endforeach

// Outputs
Expand Down

0 comments on commit 36d8f52

Please sign in to comment.