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

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, const fuse_constraints::UuidOrdering &elimination_order)

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 allows the user to provide their own elimination order. The marginalized_variables must occur before any other variables in that elimination order.

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.

  • elimination_order[in] An sequential ordering of at least the marginalized variables

Returns:

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