Trj_IteratorAdaptor (FB) ¶ FUNCTION_BLOCK FINAL Trj_IteratorAdaptor Adapts a Trj_Iterator. It will divide the samples of a minimum jerk phase following a maximum jerk phase into smaller samples of length at most Ts / 2^k, Ts / 2^(k-1), … Ts / 2^k_min. (k = maxExpMinJerk, kMin = minExpMinJerk) InOut: Scope Name Type Comment Inout Const tr Trajectory Inout iter Trj_Iterator Input dTs LREAL maxExpMinJerk UDINT The maximum exponent: for minimum jerk, the sample is initially restricted to dTs / 2^maxExpMinJerk. Must be zero or larger. minExpMinJerk UDINT The minimum exponent: for minimum jerk, the sample duration is restricted to dTs / 2^minExpMinJerk. Must be zero or larger. bEnable BOOL Inout dbgData Trj_DebugData scheduleInfo Trj_Sample_ScheduleInfo Output dTCur LREAL dJerkCur LREAL phaseType Trj_PhaseType bDone BOOL wCurEnd DynState bwCurEndValid BOOL
Trj_FindSampleByDuration (FUN) ¶ FUNCTION Trj_FindSampleByDuration : BOOL Searches for the sample that is a duration of dur from the start of the trajectory. If dur is the boundary of two phases/samples, the phase/sample to the right is found. In particular if dur = Trj_Duration FALSE is returned. InOut: Scope Name Type Inout Const trj Trajectory w0 DynState Input dur LREAL Return Trj_FindSampleByDuration BOOL Output iPhase DINT iSample DINT durInSample LREAL wStart DynState phaseType Trj_PhaseType
Trj_GetSample (FUN) ¶ FUNCTION Trj_GetSample : POINTER TO Trj_SampleI Returns the iSample-th sample in the Trajectory’s iPhase-th phase or 0 if there is iPhase-th phase or it has no iSample-th sample. InOut: Scope Name Type Inout Const trj Trajectory Input iPhase DINT iSample DINT Return Trj_GetSample POINTER TO Trj_SampleI
Trj_Init (FUN) ¶ FUNCTION Trj_Init InOut: Scope Name Type Inout tr Trajectory Input t0 LREAL
Trj_Interval_RootFound (FUN) ¶ FUNCTION Trj_Interval_RootFound : BOOL Sets the variables of the interval correctly, assuming that tr_rst is the trajectory starting from iv.w_off that is a root, that is the remaining velocity and acceleration at the end are below the tolerance. Note: we set wEnd.dv and da to exactly zero to avoid numerical problems, see RC-9029. InOut: Scope Name Type Inout errCtx SMRE.ErrorContext iv Trj_Interval Inout Const tr_rst Trajectory Input dTau2 LREAL Return Trj_Interval_RootFound BOOL
Trj_Join1 (FUN) ¶ FUNCTION Trj_Join1 : BOOL Joins a prefix of tr to trDst. Precondition: The number of phases in trDst and nPhases together is at most MAX_TRAJECTORY_PHASES Returns FALSE if the resulting trajectory would be too long (too many phases). InOut: Scope Name Type Inout trDst Trajectory Inout Const tr Trajectory Input nPhases DINT Return Trj_Join1 BOOL
Trj_JoinRange (FUN) ¶ FUNCTION Trj_JoinRange : BOOL Joins a range of a second trajectory to trDst. Precondition: The number of phases in tr and (nEnd-nStart) together is at most MAX_TRAJECTORY_PHASES Returns FALSE if the resulting trajectory would be too long (too many phases). InOut: Scope Name Type Comment Inout trDst Trajectory Inout Const tr Trajectory Input nStart DINT Index of the first phase in tr to copy nEnd DINT Index one past the last phase in tr to copy Return Trj_JoinRange BOOL
Trj_JerkCacheElem (STRUCT) ¶ TYPE Trj_JerkCacheElem : STRUCT InOut: Name Type j LREAL dbgData Trj_DebugData scheduleInfo Trj_Sample_ScheduleInfo
Trj_Join (FUN) ¶ FUNCTION Trj_Join : BOOL Joins two trajectories by adding all phases to trDst. Note: tr1 or tr2 (or both) may be empty. Precondition: The number of phases in tr1 and tr2 together is at most MAX_TRAJECTORY_PHASES Returns FALSE if the resulting trajectory would be too long (too many cycles or too many phases). InOut: Scope Name Type Inout trDst Trajectory Inout Const tr1 Trajectory tr2 Trajectory Return Trj_Join BOOL
Trj_NumSamples (FUN) ¶ FUNCTION Trj_NumSamples : DINT InOut: Scope Name Type Comment Inout Const tr Trajectory Input nPhases DINT Count samples of the first nPhases phases Return Trj_NumSamples DINT