symforce.opt.objectives.min_max_barrier_objective module#

class MinMaxBarrierObjective[source]#

Bases: TimestepObjective

class Params(x_nominal_lower, x_nominal_upper, error_nominal, dist_zero_to_nominal)[source]#

Bases: object

Fields are the same as symforce.opt.barrier_functions.min_max_power_barrier()

Parameters:
  • x_nominal_lower (float) –

  • x_nominal_upper (float) –

  • error_nominal (float) –

  • dist_zero_to_nominal (float) –

x_nominal_lower#

x-value of the point at which the error is equal to error_nominal on the left-hand side of the barrier function.

Type:

float

x_nominal_upper#

x-value of the point at which the error is equal to error_nominal on the right-hand side of the barrier function.

Type:

float

error_nominal#

Error returned when x equals x_nominal_lower or x_nominal_upper.

Type:

float

dist_zero_to_nominal#

The distance from either of the x_nominal points to the region of zero error. Must be less than half the distance between x_nominal_lower and x_nominal_upper, and must be greater than zero.

Type:

float

x_nominal_lower: float#
x_nominal_upper: float#
error_nominal: float#
dist_zero_to_nominal: float#
class ExtraValues(unwhitened_residual)[source]#

Bases: object

Parameters:

unwhitened_residual (Matrix) –

unwhitened_residual#

The value of each element of the vector after applying the barrier function but before applying the cost scaling.

Type:

symforce.geo.matrix.Matrix

unwhitened_residual: Matrix#
static residual_at_timestep(vector, params, power=1, cost_scaling=1, epsilon=0.0)[source]#

Returns the residual block for the given timestep, where the residual is computed by applying a barrier function to each element of vector, and then optionally scaling the corresponding cost in the overall optimization problem by cost_scaling.

Parameters:
  • vector (Matrix) – Each element of the given vector has a barrier function and scaling applied to it.

  • params (Params) – Parameters defining the barrier function

  • power (float) – Power of the barrier function. Defaults to 1, producing a linear barrier function in the residual, which corresponds to a quadratic cost in the overall optimization problem.

  • cost_scaling (float) – Optional scaling parameter. Corresponds to multiplying the cost in the overall optimization problem by a constant.

  • epsilon (float) –

Return type:

ResidualBlock