Skip to main content

test_behavior.hpp File

Included Headers

#include <behaviortree_cpp/blackboard.h> #include <behaviortree_cpp/tree_node.h> #include <moveit_pro_behavior_interface/action_client_behavior_base.hpp> #include <moveit_pro_behavior_interface/behavior_context.hpp> #include <moveit_pro_test_utils/mock_logger.hpp> #include <tf2_eigen/tf2_eigen.hpp> #include <moveit_pro_behavior_interface/impl/test_behavior_impl.hpp>

Namespaces Index

namespacemoveit_pro
namespacetest_utils

Classes Index

classWithBehaviorWithoutContext<BehaviorT>

Adds testing capabilities of Behaviors without context to any test fixture. More...

classWithBehavior<BehaviorT>

Adds testing capabilities of Behaviors with context to any test fixture. More...

classWithActionBehavior<BehaviorT, ClientInterfaceT>
classWrongBehaviorPortsException

Exception thrown by Behavior testing classes when the Behavior does not define exactly the expected ports. More...

Macro Definitions Index

#defineBEGIN_BEHAVIOR_PORT_SETTER_MAP_WITH_ATTRIBUTES(name, attributes)   ...

Begins the definition of a port setter map and adds attributes to its generator function. More...

#defineBEGIN_BEHAVIOR_PORT_SETTER_MAP(name)   BEGIN_BEHAVIOR_PORT_SETTER_MAP_WITH_ATTRIBUTES(name, )

Begins the definition of a port setter map. More...

#defineDEFINE_BEHAVIOR_PORT_SETTER(port_id, default_object)   ...

Defines the port setter for a port ID. More...

#defineDEFINE_OPTIONAL_BEHAVIOR_PORT_SETTER(port_id, default_object)     { port_id, ::moveit_pro::test_utils::PortSetter() },

Defines the port setter for an optional port ID. More...

#defineEND_BEHAVIOR_PORT_SETTER_MAP()   ...

Ends the definition of a port setter map. More...

Macro Definitions

BEGIN_BEHAVIOR_PORT_SETTER_MAP

#define BEGIN_BEHAVIOR_PORT_SETTER_MAP(name)   BEGIN_BEHAVIOR_PORT_SETTER_MAP_WITH_ATTRIBUTES(name, )

Begins the definition of a port setter map.

Must be followed by a instance of END_BEHAVIOR_PORT_SETTER_MAP; there can be instances of DEFINE_BEHAVIOR_PORT_SETTER between the two.

Parameters
name

Name of this port setter map. Must be unique within the file.

Definition at line 242 of file test_behavior.hpp.

BEGIN_BEHAVIOR_PORT_SETTER_MAP_WITH_ATTRIBUTES

#define BEGIN_BEHAVIOR_PORT_SETTER_MAP_WITH_ATTRIBUTES(name, attributes)   ...

Begins the definition of a port setter map and adds attributes to its generator function.

Value
  namespace \   { \   attributes const ::moveit_pro::test_utils::PortSetterMap& name() \   { \     static const auto* port_setter = new ::moveit_pro::test_utils::PortSetterMap \     {

Unless you have a very specific need to add attributes to the function this macro generates, you probably want to use BEGIN_BEHAVIOR_PORT_SETTER_MAP instead. Must be followed by an instance of END_BEHAVIOR_PORT_SETTER_MAP; there can be instances of DEFINE_BEHAVIOR_PORT_SETTER between the two.

Parameters
name

Name of this port setter map. Must be unique within the file.

attributes

Attributes to prefix the generator function with.

Definition at line 229 of file test_behavior.hpp.

DEFINE_BEHAVIOR_PORT_SETTER

#define DEFINE_BEHAVIOR_PORT_SETTER(port_id, default_object)   ...

Defines the port setter for a port ID.

Value
  { port_id, ::moveit_pro::test_utils::PortSetter([](BT::Blackboard& blackboard, const std::string& port_name) { \       blackboard.set(port_name, default_object); \     }) },
Parameters
port_id

ID of the Behavior port to set.

default_object

Value the port will be set to.

Definition at line 249 of file test_behavior.hpp.

DEFINE_OPTIONAL_BEHAVIOR_PORT_SETTER

#define DEFINE_OPTIONAL_BEHAVIOR_PORT_SETTER(port_id, default_object)     { port_id, ::moveit_pro::test_utils::PortSetter() },

Defines the port setter for an optional port ID.

Optional ports are those that can have no value set when the behavior is run, although the behavior still has to create them.

Parameters
port_id

ID of the Behavior port to set.

default_object

Value the port will be set to.

Definition at line 261 of file test_behavior.hpp.

END_BEHAVIOR_PORT_SETTER_MAP

#define END_BEHAVIOR_PORT_SETTER_MAP()   ...

Ends the definition of a port setter map.

Value
  } \   ; \   return *port_setter; \   } \   }

Must be preceded by a instance of BEGIN_BEHAVIOR_PORT_SETTER_MAP*; there can be instances of DEFINE_BEHAVIOR_PORT_SETTER between the two.

Definition at line 269 of file test_behavior.hpp.


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.