Function fuse_constraints::marginalizeVariables(const std::string&, const std::vector<fuse_core::UUID>&, const fuse_core::Graph&)

Function Documentation

fuse_core::Transaction fuse_constraints::marginalizeVariables(const std::string &source, const std::vector<fuse_core::UUID> &marginalized_variables, const fuse_core::Graph &graph)

Generate a transaction that, when applied to the graph, will marginalize out the requested variables.

This computes a linear approximation of the marginal information on the non-marginalized variables. The current variable values in the graph are used as the linearization points for the linear approximation. Thus, marginalizing out a variable will introduce linearization errors as the optimal values move away from the fixed linearization points.

This version computes an efficient elimination order using computeEliminationOrder().

Parameters:
  • source[in] The name of the sensor or motion model that generated this constraint

  • marginalized_variables[in] The set of variable UUIDs to marginalize out

  • graph[in] A graph containing the variables and constraints that are connected to at least one marginalized variable. The graph may also contain additional variables and constraints.

Returns:

A transaction object containing the computed marginal constraints to be added, as well as the set of variables and constraints to be removed.