The BehaviorContext struct contains shared resources that are common between all instances of Behaviors that inherit from moveit_pro::behaviors::SharedResourcesNode.
More...
#include <behavior_context.hpp>
|
| const std::shared_ptr< rclcpp::Node > | node |
| | A const shared pointer to a RCLCPP Node. This points to an instance of a Node provided when constructing the BehaviorContext.
|
| |
| const std::shared_ptr< rclcpp::CallbackGroup > | callback_group_mutually_exclusive |
| | A const shared pointer mutually-exclusive callback group.
|
| |
| const std::shared_ptr< rclcpp::CallbackGroup > | reentrant_callback_group |
| | A const shared pointer reentrant callback group.
|
| |
| const std::unique_ptr< moveit_pro::behavior::LoggerBase > | logger |
| | A const unique pointer to a logger for reporting messages to the UI.
|
| |
| std::shared_ptr< tf2_ros::Buffer > | transform_buffer_ptr |
| | Transform buffer, listener, and broadcaster to interface with TF.
|
| |
| std::shared_ptr< tf2_ros::TransformListener > | transform_listener_ptr |
| |
| std::shared_ptr< tf2_ros::TransformBroadcaster > | transform_broadcaster_ptr |
| |
| std::shared_ptr< moveit_pro::base::RobotModel > | robot_model |
| | The robot model, may be nullptr if the BehaviorContext was created with load_robot_model=false.
|
| |
| PersistentPublisherCache | persistent_publishers |
| | Cache of publishers (e.g. UI point-cloud snapshots) whose latched samples must outlive the Behavior instance that published them, so a UI that reconnects or reloads after the Objective still receives them.
|
| |
| BoundedRetentionQueue | mtc_introspection_retention |
| | Bounds MTC introspection memory across the process: only the most recently planned MTC tasks keep their introspection data (solutions, failures, and per-candidate planning scenes); older tasks' data is released when a newer task is retained. Without this bound, every MTC planning Subtree's task retains that data until the Objective is unloaded, so Objectives with many planning Subtrees grow memory without limit (issue #22024). PlanMTCTask registers each introspection-enabled task here after planning. The limit is the mtc_introspection_retained_tasks constructor argument (default kMtcIntrospectionRetainedTaskLimit), which the objective server reads from the robot config's objectives.mtc_introspection_retained_tasks key.
|
| |
The BehaviorContext struct contains shared resources that are common between all instances of Behaviors that inherit from moveit_pro::behaviors::SharedResourcesNode.
The BehaviorContext struct won't load a robot model by default. This is to avoid the cost of loading the robot model when it's not actually needed (e.g. tests), or needing to consume a timeout waiting for the model to be available. If a robot model is needed (e.g. when running on an actual robot), set load_robot_model=true when constructing the BehaviorContext. If load_robot_model=true and the robot model fails to load, the BehaviorContext will throw an exception and the program will terminate.
◆ BehaviorContext() [1/4]
◆ BehaviorContext() [2/4]
◆ BehaviorContext() [3/4]
◆ BehaviorContext() [4/4]
| moveit_pro::behaviors::BehaviorContext::BehaviorContext |
( |
BehaviorContext && |
| ) |
|
|
delete |
◆ getModelFrameOrDefault()
| std::string moveit_pro::behaviors::BehaviorContext::getModelFrameOrDefault |
( |
| ) |
const |
The robot model's root frame, or "world" when no robot model was loaded.
Behaviors default their visualization and IK frames to this so they stay correct on robots whose model is not rooted at "world" (e.g. mobile bases rooted at "odom").
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ callback_group_mutually_exclusive
| const std::shared_ptr<rclcpp::CallbackGroup> moveit_pro::behaviors::BehaviorContext::callback_group_mutually_exclusive |
A const shared pointer mutually-exclusive callback group.
Marked const to prevent Behaviors that can access BehaviorContext from changing it.
◆ logger
A const unique pointer to a logger for reporting messages to the UI.
Marked const to prevent Behaviors that can access BehaviorContext from changing it.
◆ mtc_introspection_retention
Bounds MTC introspection memory across the process: only the most recently planned MTC tasks keep their introspection data (solutions, failures, and per-candidate planning scenes); older tasks' data is released when a newer task is retained. Without this bound, every MTC planning Subtree's task retains that data until the Objective is unloaded, so Objectives with many planning Subtrees grow memory without limit (issue #22024). PlanMTCTask registers each introspection-enabled task here after planning. The limit is the mtc_introspection_retained_tasks constructor argument (default kMtcIntrospectionRetainedTaskLimit), which the objective server reads from the robot config's objectives.mtc_introspection_retained_tasks key.
- Warning
- Release callbacks run on whichever thread's retain() call evicted the entry, so a retained task's data can be released from a thread other than the one that planned it. retain() is a synchronization point (see BoundedRetentionQueue): a Behavior must retain a task (via mtc_utils::retainTaskIntrospection) before planning it or reading its retained data, after which no release of that task can run until the queue's full capacity of newer tasks is retained — the only residual race is that many retains completing while the use is still in progress.
◆ node
| const std::shared_ptr<rclcpp::Node> moveit_pro::behaviors::BehaviorContext::node |
A const shared pointer to a RCLCPP Node. This points to an instance of a Node provided when constructing the BehaviorContext.
Marked const to prevent Behaviors that can access BehaviorContext from changing it.
◆ persistent_publishers
Cache of publishers (e.g. UI point-cloud snapshots) whose latched samples must outlive the Behavior instance that published them, so a UI that reconnects or reloads after the Objective still receives them.
◆ reentrant_callback_group
| const std::shared_ptr<rclcpp::CallbackGroup> moveit_pro::behaviors::BehaviorContext::reentrant_callback_group |
A const shared pointer reentrant callback group.
Marked const to prevent Behaviors that can access BehaviorContext from changing it.
◆ robot_model
| std::shared_ptr<moveit_pro::base::RobotModel> moveit_pro::behaviors::BehaviorContext::robot_model |
The robot model, may be nullptr if the BehaviorContext was created with load_robot_model=false.
if load_robot_model=true, this is guaranteed to be a valid pointer.
◆ transform_broadcaster_ptr
| std::shared_ptr<tf2_ros::TransformBroadcaster> moveit_pro::behaviors::BehaviorContext::transform_broadcaster_ptr |
◆ transform_buffer_ptr
| std::shared_ptr<tf2_ros::Buffer> moveit_pro::behaviors::BehaviorContext::transform_buffer_ptr |
Transform buffer, listener, and broadcaster to interface with TF.
◆ transform_listener_ptr
| std::shared_ptr<tf2_ros::TransformListener> moveit_pro::behaviors::BehaviorContext::transform_listener_ptr |
The documentation for this struct was generated from the following files: