Skip to content

Commit

Permalink
Code generation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iwoodsawyer committed Feb 28, 2024
1 parent 7621d1c commit 4a946a2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Binary file modified motiongen_pos.slx
Binary file not shown.
Binary file modified motiongen_vel.slx
Binary file not shown.
16 changes: 8 additions & 8 deletions sfun_motiongen.tlc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

%<LibAddToModelSources("brake")>
%<LibAddToModelSources("position_first_step1")>
%<LibAddToModelSources("position_first_step2.")>
%<LibAddToModelSources("position_first_step2")>
%<LibAddToModelSources("position_second_step1")>
%<LibAddToModelSources("position_second_step2")>
%<LibAddToModelSources("position_third_step1")>
Expand Down Expand Up @@ -44,7 +44,7 @@
%% start and every time an enabled subsystem is re-enabled.

%% Reset the IWork flag to 1 when values need to be reinitialized.
%<LibBlockPWork(BlockInit, "", "", 0)> = 1;
%<LibBlockIWork(BlockInit, "", "", 0)> = 1;
}
%endfunction

Expand All @@ -62,7 +62,7 @@
auto *IP = new ruckig::InputParameter<ruckig::DynamicDOFs>( ndofs );
auto *OP = new ruckig::OutputParameter<ruckig::DynamicDOFs>( ndofs );

const char* control = %<SFcnParamSettings.ControlInterface>;
const char* control = "%<SFcnParamSettings.ControlInterface>";
if (strcmp(control,"POSITION") == 0){
IP->control_interface = ruckig::ControlInterface::Position;
}
Expand All @@ -73,7 +73,7 @@
IP->control_interface = ruckig::ControlInterface::Position;
}

const char* sync = %<SFcnParamSettings.Synchronization>;
const char* sync = "%<SFcnParamSettings.Synchronization>";
if (strcmp(sync,"NO_SYNCHRONIZATION") == 0){
IP->synchronization = ruckig::Synchronization::None;
}
Expand All @@ -90,7 +90,7 @@
IP->synchronization = ruckig::Synchronization::Time;
}

const char* duration = %<SFcnParamSettings.DurationDiscretization>;
const char* duration = "%<SFcnParamSettings.DurationDiscretization>";
if (strcmp(duration,"CONTINUOUS") == 0){
IP->duration_discretization = ruckig::DurationDiscretization::Continuous;
}
Expand All @@ -116,7 +116,7 @@
/* %<Type> Block: %<Name> */
{
%% Initialize values if the IWork vector flag is true.
if (%<LibBlockPWork(BlockInit, "", "", 0)> == 1) {
if (%<LibBlockIWork(BlockInit, "", "", 0)> == 1) {
const int_T ndofs = static_cast<int_T>(%<SFcnParamSettings.NumberOfDoFs>);
for (int_T dof=0; dof < ndofs; dof++)
{
Expand All @@ -125,11 +125,11 @@
(%<LibBlockOutputSignalAddr(2, "", "", 0)>)[dof] = (%<LibBlockInputSignalAddr(5, "", "", 0)>)[dof];
}

%<LibBlockPWork(BlockInit, "", "", 0)> = 0;
%<LibBlockIWork(BlockInit, "", "", 0)> = 0;
}
else {
%% Retrieve C++ object from the pointers vector
auto *OP = static_cast<ruckig::OutputParameter<ruckig::DynamicDOFs> *>(%<LibBlockPWork(RMLPositionOutputParameters, "", "", 0)>);
auto *OP = static_cast<ruckig::OutputParameter<ruckig::DynamicDOFs> *>(%<LibBlockPWork(OutputParameter, "", "", 0)>);

const int_T ndofs = static_cast<int_T>(%<SFcnParamSettings.NumberOfDoFs>);
for (int_T dof=0; dof < ndofs; dof++)
Expand Down

0 comments on commit 4a946a2

Please sign in to comment.