From c91548ef177880df4d595fc5a072df07762d2836 Mon Sep 17 00:00:00 2001 From: Alejandro Lopez Gestoso <alopez@iri.upc.edu> Date: Thu, 8 Jul 2021 14:39:50 +0000 Subject: [PATCH] [WORK IN PROGRESS] Updated documentation --- README.md | 18 +++++++++++++----- include/iri_async_action.h | 2 +- include/iri_bt_factory.h | 2 +- src/iri_async_action.cpp | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 87144a2..8cc3999 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,21 @@ IRI BehaviorTree ## Description -It's a library to adapt the [behaviortree](https://github.com/BehaviorTree/BehaviorTree.CPP) library to the use -of [IRI modules](https://gitlab.iri.upc.edu/labrobotica/ros/iri_core/iri_ros_tools). +This library is intendend to expand the [behaviortree](https://github.com/BehaviorTree/BehaviorTree.CPP) library to provide the following new features: +* It provides a way to implement an Asynchronous Action throught a callback function instead of having to create an inherited class. -It provides the possibility of creating asynchronous actions without the need of creating a class. Its *tick* -function is called from the main thread. There isn't implemented any *halt* function. + This is acomplished with the definition of the new class **IriAsyncActionNode**. This class is exactly the same that **SimpleActionNode** provided by the original library but with the possibility of returning the *RUNNING* state. Another difference with the original Asynchronous action is that no *halt* function can be implemented. + +* It provides a way to register this new Asynchronous actions. + + This is acomplished with the definition of the new class **IriBehaviorTreeFactory**. This class jus implements the *registerIriAsyncAction* function to register any *IriAsyncActionNode* in the same way a *SimpleActionNode* would be registered using *registerSimpleAction*. + +* It also provides a set of basic BehaviorTree nodes (BT nodes) and the function to register them. + + This is acomplished with the definition of a new class **IriBehaviorTreeBasicNodes** that implements this basic BT nodes and provides a function called *init* to register these BT nodes. + +These new features allow us to adapt the use of BehaviorTrees to the IRI framework and to add a BehaviorTree wrapper for the [IRI modules](https://gitlab.iri.upc.edu/labrobotica/ros/iri_core/iri_ros_tools#iri-ros-modules). -Additionally, it provides some basic common BT nodes. ## ROS dependencies diff --git a/include/iri_async_action.h b/include/iri_async_action.h index f573038..95609b7 100644 --- a/include/iri_async_action.h +++ b/include/iri_async_action.h @@ -37,4 +37,4 @@ class IriAsyncActionNode : public BT::ActionNodeBase TickFunctor tick_functor_; }; -#endif \ No newline at end of file +#endif diff --git a/include/iri_bt_factory.h b/include/iri_bt_factory.h index e2be447..e271826 100644 --- a/include/iri_bt_factory.h +++ b/include/iri_bt_factory.h @@ -25,4 +25,4 @@ class IriBehaviorTreeFactory : public BT::BehaviorTreeFactory BT::PortsList ports = {}); }; -#endif \ No newline at end of file +#endif diff --git a/src/iri_async_action.cpp b/src/iri_async_action.cpp index 3084895..2a2eb86 100644 --- a/src/iri_async_action.cpp +++ b/src/iri_async_action.cpp @@ -28,4 +28,4 @@ BT::NodeStatus IriAsyncActionNode::tick() setStatus(status); } return status; -} \ No newline at end of file +} -- GitLab