mc_control::CompletionCriteria Struct Reference

#include <mc_control/CompletionCriteria.h>

Public Member Functions

bool completed (const mc_tasks::MetaTask &task)
 
void configure (const mc_tasks::MetaTask &task, double dt, const mc_rtc::Configuration &config)
 
const std::string & output () const
 

Detailed Description

A generic MetaTask completion criteria

Possible criteria:

  • eval() norm is below a certain threshold
  • speed() norm is below a certain threshold
  • a given timeout (provided in seconds) has elapsed since the start

The default criteria is always satisfied (i.e. no criteria)

These criteria can be combined with AND and OR

Example:

# 5 seconds timeout
{
"timeout": 5.0
}
# eval().norm() < 1e-3 || timeout 20s
{
"OR": [
{ "eval": 1e-3 },
{ "timeout": 20.0 }
]
}
# ( eval().norm() < 1e-3 && speed().norm() < 1e-6 ) || timeout 30s
{
"OR": [
{
"AND": [
{ "eval": 1e-3 },
{ "speed": 1e-6 }
]
},
{ "timeout": 30.0 }
]
}

Member Function Documentation

◆ completed()

bool mc_control::CompletionCriteria::completed ( const mc_tasks::MetaTask task)

Given a task returns true if that task fits the completion criteria

◆ configure()

void mc_control::CompletionCriteria::configure ( const mc_tasks::MetaTask task,
double  dt,
const mc_rtc::Configuration config 
)

Given a MetaTask and a Configuration, generate the criteria

◆ output()

const std::string& mc_control::CompletionCriteria::output ( ) const

Returns the criteria that achieved the completion


The documentation for this struct was generated from the following file: