Previously the STEAM implementation for WNOA and WNOJ were completely separate. The goal of this pull request is to
a) Reduce unnecessary code duplication by using inheritance and templating.
b) Allow for easy swapping between both motion priors. We can do this by defining one SteamTrajInterfaceBase class everywhere we our STEAM trajectory. We can then assign either a SteamTrajInterface (WNOA) or SteamCATrajInterface (WNOJ) object. Function calls to the base object will then call the appropriate functions.
For example:
SteamTrajInterface derived(...); // define WNOA steam traj
SteamTrajInterfaceBase *base = &derived;
base->functionCall(); // will call the WNOA version
To use WNOJ, we can simply change the first line
SteamCATrajInterface derived(...); // define WNOJ steam traj
SteamTrajInterfaceBase *base = &derived;
base->functionCall(); // will call the WNOJ version
This is good because everywhere else the steam trajectory is defined in the code base such as arguments to functions or members of other classes, we can simply define a SteamTrajInterfaceBase object and won't need to change that for each motion prior.
Previously the STEAM implementation for WNOA and WNOJ were completely separate. The goal of this pull request is to a) Reduce unnecessary code duplication by using inheritance and templating. b) Allow for easy swapping between both motion priors. We can do this by defining one SteamTrajInterfaceBase class everywhere we our STEAM trajectory. We can then assign either a SteamTrajInterface (WNOA) or SteamCATrajInterface (WNOJ) object. Function calls to the base object will then call the appropriate functions.
For example:
To use WNOJ, we can simply change the first line
This is good because everywhere else the steam trajectory is defined in the code base such as arguments to functions or members of other classes, we can simply define a SteamTrajInterfaceBase object and won't need to change that for each motion prior.