Class DCSLoss

Inheritance Relationships

Base Type

  • public fuse_core::Loss

Class Documentation

class DCSLoss : public fuse_core::Loss

The DCS (Dynamic Covariance Scaling) loss function.

This class encapsulates the ceres::DCSLoss class, adding the ability to serialize it and load it dynamically.

The DCS loss is not provided by the Ceres solver, so it is implemented here, based on equation #315 from: http://www2.informatik.uni-freiburg.de/~spinello/agarwalICRA13.pdf (p. 3)

See the Ceres documentation for more details. http://ceres- solver.org/nnls_modeling.html::lossfunction

Public Functions

explicit DCSLoss(const double a = 1.0)

Constructor.

Parameters:

a[in] DCSLoss parameter ‘a’

~DCSLoss() override = default

Destructor.

void initialize(fuse_core::node_interfaces::NodeInterfaces<fuse_core::node_interfaces::Base, fuse_core::node_interfaces::Logging, fuse_core::node_interfaces::Parameters> interfaces, const std::string &name) override

Perform any required post-construction initialization, such as reading from the parameter server.

This will be called on each plugin after construction.

Parameters:
  • interfaces[in] - The node interfaces used to load the parameter

  • name[in] A unique name to initialize this plugin instance, such as from the parameter server.

void print(std::ostream &stream = std::cout) const override

Print a human-readable description of the loss function to the provided stream.

Parameters:

stream[out] The stream to write to. Defaults to stdout.

ceres::LossFunction *lossFunction() const override

Return a raw pointer to a ceres::LossFunction that implements the loss function.

The Ceres interface requires a raw pointer. Ceres will take ownership of the pointer and promises to properly delete the loss function when it is done. Additionally, Fuse promises that the Loss object will outlive any generated loss functions (i.e. the Ceres objects will be destroyed before the Loss Function objects). This guarantee may allow optimizations for the creation of the loss function objects.

Returns:

A base pointer to an instance of a derived ceres::LossFunction.

inline double a() const

Parameter ‘a’ accessor.

Returns:

Parameter ‘a’.

inline void a(const double a)

Parameter ‘a’ mutator.

Parameters:

a[in] Parameter ‘a’.

Friends

friend class boost::serialization::access