Class MotionModel

Inheritance Relationships

Derived Type

Class Documentation

class MotionModel

The interface definition for motion model plugins in the fuse ecosystem.

A model model plugin is responsible for generating constraints that link together timestamps introduced by other sensors in the system.

Subclassed by fuse_core::AsyncMotionModel

Public Functions

virtual ~MotionModel() = default

Destructor.

virtual bool apply(Transaction &transaction) = 0

Augment a transaction object such that all involved timestamps are connected by motion model constraints.

This function will be called by the optimizer (in the Optimizer’s thread) for each received transaction.

Parameters:

transaction[inout] The transaction object that should be augmented with motion model constraints

Returns:

True if the motion models were generated successfully, false otherwise

inline virtual void graphCallback(Graph::ConstSharedPtr)

Function to be executed whenever the optimizer has completed a Graph update.

This method will be called by the optimizer, in the optimizer’s thread, after each Graph update is complete. This generally means that new variables have been inserted into the Graph, and new optimized values are available. To simplify synchronization between the motion models and other consumers of Graph data, the provided Graph object will never be updated by anyone. Thus, only read access to the Graph is provided. Information may be accessed or computed, but it cannot be changed. The optimizer provides the motion models with Graph updates by sending a new Graph object, not by modifying this Graph object.

Parameters:

graph[in] A read-only pointer to the graph object, allowing queries to be performed whenever needed.

virtual void initialize(node_interfaces::NodeInterfaces<ALL_FUSE_CORE_NODE_INTERFACES> interfaces, const std::string &name) = 0

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

This will be called on each plugin after construction, and after the ros node has been initialized. Plugins are encouraged to subnamespace any of their parameters to prevent conflicts and allow the same plugin to be used multiple times with different settings and topics.

Parameters:

name[in] A unique name to give this plugin instance

virtual const std::string &name() const = 0

Get the unique name of this motion model.

inline virtual void start()

Function to be executed whenever the optimizer is ready to receive transactions.

This method will be called by the optimizer, in the optimizer’s thread, once the optimizer has been initialized and is ready to receive transactions. It may also be called as part of a stop-start cycle when the optimizer has been requested to reset itself. This allows the motion model to reset any internal state before the optimizer begins processing after a reset. No calls to apply() will happen before the optimizer calls start().

inline virtual void stop()

Function to be executed whenever the optimizer is no longer ready to receive transactions.

This method will be called by the optimizer, in the optimizer’s thread, before the optimizer shutdowns. It may also be called as part of a stop-start cycle when the optimizer has been requested to reset itself. This allows the motion model to reset any internal state before the optimizer begins processing after a reset. No calls to apply() will happen until start() has been called again.

Protected Functions

MotionModel() = default

Default Constructor.