BipedalLocomotion::ML::MANN class

MANN is a class that allows to perform the inference of an onnx implementing Mode-Adaptive Neural Networks (MANN).

The network was originally proposed in [H. Zhang, S. Starke, T. Komura, and J. Saito, “Mode-adaptive neural networks for quadruped motion control,” ACM Trans. Graph., vol. 37, no. 4, pp. 1–11, 2018.](https://doi.org/10.1145/3197517.3201366) This class uses onnxruntime to perform inference and it has been tested with an onnx model generated from https://github.com/ami-iit/mann-pytorch

Base classes

template<class _Input, class _Output>
class BipedalLocomotion::System::Advanceable<MANNInput, MANNOutput>
Basic class that represents a discrete system.

Constructors, destructors, conversion operators

MANN()
Constructor.
~MANN()
Destructor.

Public functions

auto initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> paramHandler) -> bool override
Initialize the network.
auto setInput(const MANNInput& input) -> bool override
Set the input of the network.
auto advance() -> bool override
Perform one step of the inference given the input set.
auto getOutput() const -> const MANNOutput& override
Get the output of the network once advance has been called.
auto isOutputValid() const -> bool override
Check if the output of the network is valid.

Function documentation

BipedalLocomotion::ML::MANN::~MANN()

Destructor.

It is required by the pimpl implementation.

bool BipedalLocomotion::ML::MANN::initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> paramHandler) override

Initialize the network.

Parameters
paramHandler pointer to the parameters handler.
Returns True in case of success, false otherwise.

bool BipedalLocomotion::ML::MANN::setInput(const MANNInput& input) override

Set the input of the network.

Parameters
input the struct containing all the inputs of the network.
Returns true if case of success, false otherwise.

bool BipedalLocomotion::ML::MANN::advance() override

Perform one step of the inference given the input set.

Returns true if case of success, false otherwise.

const MANNOutput& BipedalLocomotion::ML::MANN::getOutput() const override

Get the output of the network once advance has been called.

Returns the output of the network.

bool BipedalLocomotion::ML::MANN::isOutputValid() const override

Check if the output of the network is valid.

Returns true if it is valid, false otherwise.