MoveIt Pro Behavior
Core Behaviors for MoveIt Pro
|
This Behavior calculates the running average of incoming Pose Stamped ROS messages. More...
#include <average_pose_stamped.hpp>
Public Member Functions | |
AveragePoseStamped (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > &shared_resources) | |
Constructor for the AveragePoseStamped behavior. | |
BT::NodeStatus | onStart () override |
Adds a Pose Stamped sample to the running average and returns it on a port. | |
BT::NodeStatus | onRunning () override |
Averages the pose. | |
void | onHalted () override |
Public Member Functions inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode > | |
SharedResourcesNode (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) | |
Constructor for SharedResourcesNode. Called by BT::BehaviorTreeFactory when creating a new behavior tree containing this node. | |
Static Public Member Functions | |
static BT::PortsList | providedPorts () |
Implementation of the required providedPorts() function for the AveragePoseStamped Behavior. | |
static BT::KeyValueVector | metadata () |
Additional Inherited Members | |
Protected Attributes inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode > | |
std::shared_ptr< BehaviorContext > | shared_resources_ |
This Behavior calculates the running average of incoming Pose Stamped ROS messages.
Data Port Name | Port Type | Object Type |
---|---|---|
run_continuously | Input | bool |
num_samples | Input | double |
max_distance | Input | double |
max_rotation | Input | double |
pose_sample | Input | geometry_msgs::msg::PoseStamped |
avg_pose | Output | geometry_msgs::msg::PoseStamped |
If the current sample exceeds a "max_distance" or "max_rotation" (specified as input ports) from the current average pose the behavior will return FAILURE. The Behavior will use the last "num_samples" Pose Stamped messages to calculate the average pose.
Notes:
moveit_studio::behaviors::AveragePoseStamped::AveragePoseStamped | ( | const std::string & | name, |
const BT::NodeConfiguration & | config, | ||
const std::shared_ptr< moveit_studio::behaviors::BehaviorContext > & | shared_resources | ||
) |
Constructor for the AveragePoseStamped behavior.
name | The name of a particular instance of this Behavior. This will be set by the behavior tree factory when this Behavior is created within a new behavior tree. |
shared_resources | A shared_ptr to a BehaviorContext that is shared among all SharedResourcesNode Behaviors in the behavior tree. This BehaviorContext is owned by the Studio Agent's ObjectiveServerNode. |
config | This contains runtime configuration info for this Behavior, such as the mapping between the Behavior's data ports on the behavior tree's blackboard. This will be set by the behavior tree factory when this Behavior is created within a new behavior tree. |
An important limitation is that the members of the base Behavior class are not instantiated until after the initialize() function is called, so these classes should not be used within the constructor.
|
static |
|
override |
|
override |
Averages the pose.
|
override |
Adds a Pose Stamped sample to the running average and returns it on a port.
Initializes the position and quaternion states and sets the average pose to the first pose received
|
static |
Implementation of the required providedPorts() function for the AveragePoseStamped Behavior.