|
| 1 | +#pragma once |
| 2 | + |
| 3 | +#include <behaviortree_cpp/action_node.h> |
| 4 | +#include <moveit_pro_behavior_interface/get_required_ports.hpp> |
| 5 | + |
| 6 | +namespace convert_odom_to_pose_stamped |
| 7 | +{ |
| 8 | +/** |
| 9 | + * @brief TODO(...) |
| 10 | + */ |
| 11 | +class ConvertOdomToPoseStamped : public BT::SyncActionNode |
| 12 | +{ |
| 13 | +public: |
| 14 | + /** |
| 15 | + * @brief Constructor for the convert_odom_to_pose_stamped behavior. |
| 16 | + * @param name The name of a particular instance of this Behavior. This will be set by the behavior tree factory when |
| 17 | + * this Behavior is created within a new behavior tree. |
| 18 | + * @param config This contains runtime configuration info for this Behavior, such as the mapping between the |
| 19 | + * Behavior's data ports on the behavior tree's blackboard. This will be set by the behavior tree factory when this |
| 20 | + * Behavior is created within a new behavior tree. |
| 21 | + * @details An important limitation is that the members of the base Behavior class are not instantiated until after |
| 22 | + * the initialize() function is called, so these classes should not be used within the constructor. |
| 23 | + */ |
| 24 | + ConvertOdomToPoseStamped(const std::string& name, const BT::NodeConfiguration& config); |
| 25 | + |
| 26 | + /** |
| 27 | + * @brief Implementation of the required providedPorts() function for the convert_odom_to_pose_stamped Behavior. |
| 28 | + * @details The BehaviorTree.CPP library requires that Behaviors must implement a static function named |
| 29 | + * providedPorts() which defines their input and output ports. If the Behavior does not use any ports, this function |
| 30 | + * must return an empty BT::PortsList. This function returns a list of ports with their names and port info, which is |
| 31 | + * used internally by the behavior tree. |
| 32 | + * @return convert_odom_to_pose_stamped does not expose any ports, so this function returns an empty list. |
| 33 | + */ |
| 34 | + static BT::PortsList providedPorts(); |
| 35 | + |
| 36 | + /** |
| 37 | + * @brief Implementation of the metadata() function for displaying metadata, such as Behavior description and |
| 38 | + * subcategory, in the MoveIt Studio Developer Tool. |
| 39 | + * @return A BT::KeyValueVector containing the Behavior metadata. |
| 40 | + */ |
| 41 | + static BT::KeyValueVector metadata(); |
| 42 | + |
| 43 | + /** |
| 44 | + * @brief Implementation of BT::SyncActionNode::tick() for ConvertOdomToPoseStamped. |
| 45 | + * @details This function is where the Behavior performs its work when the behavior tree is being run. Since |
| 46 | + * ConvertOdomToPoseStamped is derived from BT::SyncActionNode, it is very important that its tick() function always |
| 47 | + * finishes very quickly. If tick() blocks before returning, it will block execution of the entire behavior tree, |
| 48 | + * which may have undesirable consequences for other Behaviors that require a fast update rate to work correctly. |
| 49 | + */ |
| 50 | + BT::NodeStatus tick() override; |
| 51 | +}; |
| 52 | +} // namespace convert_odom_to_pose_stamped |
0 commit comments