MoveIt Pro Behavior
Core Behaviors for MoveIt Pro
moveit_studio::behaviors::ForceExceedsThreshold Class Referencefinal

Monitors wrench messages published to topic, and returns SUCCESS if the magnitude of the wrench measurements exceeds a force threshold for a minimum number of consecutive readings. More...

#include <force_exceeds_threshold.hpp>

Inheritance diagram for moveit_studio::behaviors::ForceExceedsThreshold:
Collaboration diagram for moveit_studio::behaviors::ForceExceedsThreshold:

Public Member Functions

 ForceExceedsThreshold (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources)
 
BT::NodeStatus onStart () override
 Initializes the wrench topic subscriber based on the provided parameters. More...
 
BT::NodeStatus onRunning () override
 Monitors the force tracking state until a terminal state is reached. More...
 
void onHalted () override
 Stops the wrench topic subscriber. More...
 
void addWrenchReading (const geometry_msgs::msg::WrenchStamped::SharedPtr msg, const double force_threshold, const std::size_t minimum_consecutive_wrench_values)
 Transforms measured wrench to the specified hand frame using tform_ft_sensor_to_hand_, compares it to the provided bounds, and sets wrench_exceeded_threshold_ to True if the measured wrench is outside the bounds. More...
 
- 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. More...
 

Static Public Member Functions

static BT::PortsList providedPorts ()
 
static BT::KeyValueVector metadata ()
 

Additional Inherited Members

- Protected Attributes inherited from moveit_studio::behaviors::SharedResourcesNode< BT::StatefulActionNode >
std::shared_ptr< BehaviorContextshared_resources_
 

Detailed Description

Monitors wrench messages published to topic, and returns SUCCESS if the magnitude of the wrench measurements exceeds a force threshold for a minimum number of consecutive readings.

Data Port Name Port Type Object Type
wrench_topic_name Input std::string
hand_frame_name Input std::string
wrench_frame_name Input std::string
minimum_consecutive_wrench_values Input std::size_t
force_threshold Input double

Constructor & Destructor Documentation

◆ ForceExceedsThreshold()

moveit_studio::behaviors::ForceExceedsThreshold::ForceExceedsThreshold ( const std::string &  name,
const BT::NodeConfiguration &  config,
const std::shared_ptr< BehaviorContext > &  shared_resources 
)

Member Function Documentation

◆ addWrenchReading()

void moveit_studio::behaviors::ForceExceedsThreshold::addWrenchReading ( const geometry_msgs::msg::WrenchStamped::SharedPtr  msg,
const double  force_threshold,
const std::size_t  minimum_consecutive_wrench_values 
)

Transforms measured wrench to the specified hand frame using tform_ft_sensor_to_hand_, compares it to the provided bounds, and sets wrench_exceeded_threshold_ to True if the measured wrench is outside the bounds.

Parameters
msgLatest WrenchStamped message.
force_thresholdThe maximum force threshold to compare the measured wrench against.
minimum_consecutive_wrench_valuesThe minimum consecutive number of times the measured force needs to exceed the force_threshold value and set wrench_exceeded_threshold_ to True.

◆ metadata()

BT::KeyValueVector moveit_studio::behaviors::ForceExceedsThreshold::metadata ( )
static

◆ onHalted()

void moveit_studio::behaviors::ForceExceedsThreshold::onHalted ( )
override

Stops the wrench topic subscriber.

◆ onRunning()

BT::NodeStatus moveit_studio::behaviors::ForceExceedsThreshold::onRunning ( )
override

Monitors the force tracking state until a terminal state is reached.

Returns
SUCCESS if the force has exceeded threshold for the number of specified consecutive samples, else RUNNING.

◆ onStart()

BT::NodeStatus moveit_studio::behaviors::ForceExceedsThreshold::onStart ( )
override

Initializes the wrench topic subscriber based on the provided parameters.

Returns
RUNNING if the Behavior initialized correctly, FAILURE if it did not.

◆ providedPorts()

BT::PortsList moveit_studio::behaviors::ForceExceedsThreshold::providedPorts ( )
static

The documentation for this class was generated from the following files: