MoveIt Pro Behavior Interface  5.2.0
Library for developing custom behaviors for use in MoveIt Pro
moveit_studio::test_utils Namespace Reference

Classes

class  WithBehaviorWithoutContext
 Adds testing capabilities of Behaviors without context to any test fixture. More...
 
class  WithBehavior
 Adds testing capabilities of Behaviors with context to any test fixture. More...
 
class  WithActionBehavior
 
class  WrongBehaviorPortsException
 Exception thrown by Behavior testing classes when the Behavior does not define exactly the expected ports. More...
 

Typedefs

using PortSetter = std::function< void(BT::Blackboard &, const std::string &)>
 A callable that sets a Behavior port in a blackboard. More...
 
using PortSetterMap = std::map< std::string, PortSetter >
 A map associating port names to their setters. More...
 
using PortSetterMapGenerator = const PortSetterMap &(*)(void)
 A function generating a map of port setters. More...
 

Functions

std::set< std::string > getPortIDs (const PortSetterMap &map, bool only_mandatory=false)
 Returns port IDs in a port setter map. More...
 

Variables

constexpr auto kPortNotSetTestsMaxTimeBehaviorIsInRunningStatus = std::chrono::milliseconds(100)
 

Typedef Documentation

◆ PortSetter

using moveit_studio::test_utils::PortSetter = typedef std::function<void(BT::Blackboard&, const std::string&)>

A callable that sets a Behavior port in a blackboard.

◆ PortSetterMap

using moveit_studio::test_utils::PortSetterMap = typedef std::map<std::string, PortSetter>

A map associating port names to their setters.

◆ PortSetterMapGenerator

A function generating a map of port setters.

Setters for input and output ports are passed to the Behavior testing classes and macros to automatically generate port tests.

Function Documentation

◆ getPortIDs()

std::set< std::string > moveit_studio::test_utils::getPortIDs ( const PortSetterMap map,
bool  only_mandatory = false 
)

Returns port IDs in a port setter map.

Parameters
mapThe map from which to retrieve port IDs.
only_mandatoryif true, does not return IDs for optional ports.
Returns
If only_mandatory is false, IDs of all ports in the map; if only_mandatory is true, only IDs of mandatory ports.

Variable Documentation

◆ kPortNotSetTestsMaxTimeBehaviorIsInRunningStatus

constexpr auto moveit_studio::test_utils::kPortNotSetTestsMaxTimeBehaviorIsInRunningStatus = std::chrono::milliseconds(100)
constexpr