Function Karana::Dynamics::Algorithms::stateSpaceGenerator

Function Karana::Dynamics::Algorithms::stateSpaceGenerator#

Function Documentation#

km::StateSpace Karana::Dynamics::Algorithms::stateSpaceGenerator(ModelManager &mm, size_t n_inputs, size_t n_outputs, std::function<void(const km::Vec &x, const km::Vec &u)> u_fn, km::lin_fn y_fn)#

Create generator for linearized state space representation of the system.

Method to create a StateSpace object for creating (A,B,C,D) state space linear system matrices for sub-tree multibody system. The returned state space generation object’s generate(x,u) can be called to compute the state space matrices at the state and input vector set point values about which the linearization should be carried out.

The first two inputs are the size of the inputs and outputs for the state space system. The u_fn argument is a user-defined function that takes (x,u) arguments and sets the appropriate forces, gravity etc values for the in the multibody system for dynamics computations. The y_fn argument takes (x, u, y) arguments and computes the outputs y for the (x, u) and state and input values.

See the Guidance and Control Related Algorithms section for more information.

Parameters:
  • mm – The ModelManager whose SubTree and models will be used to generate the StateSpace.

  • n_inputs – number of inputs

  • n_outputs – number of outputs

  • u_fn – function to evaluate the state derivative value for an input value

  • y_fn – function to evaluate the output value for a given state

Returns:

State space generator instance