Skip to main content

ForceExceedsThreshold Class

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...

Declaration

class moveit_pro::behaviors::ForceExceedsThreshold { ... }

Included Headers

#include <force_exceeds_threshold.hpp>

Base class

classSharedResourcesNode<BehaviorTreeNodeT>

The SharedResourcesNode class provides a BehaviorContext object when constructing a BehaviorTree.Cpp node. More...

Public Constructors Index

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

Public Member Functions Index

BT::NodeStatusonStart () override

Initializes the wrench topic subscriber based on the provided parameters. More...

BT::NodeStatusonRunning () override

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

voidonHalted () override

Stops the wrench topic subscriber. More...

voidaddWrenchReading (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...

Private Member Attributes Index

rclcpp::Subscription< geometry_msgs::msg::WrenchStamped >::SharedPtrwrench_subscription_

A ROS subscriber to the topic containing the force to measure. More...

geometry_msgs::msg::TransformStampedtform_ft_sensor_to_hand_

Set to the transform between the force/torque sensor frame and the hand frame at the start of servo motion. More...

std::atomic< bool >wrench_exceeded_threshold_ { false }

Set to True once the measured wrench exceeds the threshold described by the FORCE_THRESHOLD. More...

std::size_tnum_times_wrench_exceeded_threshold_ { 0 }

Counter for how many times the wrench value from the robot arm force sensor has exceeded the threshold. This is a simple way to prevent a single spurious reading from the sensor from stopping the force-limited motion. More...

Public Static Functions Index

static BT::PortsListprovidedPorts ()
static BT::KeyValueVectormetadata ()

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 NamePort TypeObject Type
wrench_topic_nameInputstd::string
hand_frame_nameInputstd::string
wrench_frame_nameInputstd::string
minimum_consecutive_wrench_valuesInputstd::size_t
force_thresholdInputdouble

Definition at line 46 of file force_exceeds_threshold.hpp.

Public Constructors

ForceExceedsThreshold()

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

Declaration at line 49 of file force_exceeds_threshold.hpp, definition at line 46 of file force_exceeds_threshold.cpp.

Public Member Functions

addWrenchReading()

void moveit_pro::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
msg

Latest WrenchStamped message.

force_threshold

The maximum force threshold to compare the measured wrench against.

minimum_consecutive_wrench_values

The minimum consecutive number of times the measured force needs to exceed the force_threshold value and set wrench_exceeded_threshold_ to True.

Declaration at line 81 of file force_exceeds_threshold.hpp, definition at line 149 of file force_exceeds_threshold.cpp.

onHalted()

void moveit_pro::behaviors::ForceExceedsThreshold::onHalted ()

Stops the wrench topic subscriber.

Declaration at line 71 of file force_exceeds_threshold.hpp, definition at line 144 of file force_exceeds_threshold.cpp.

onRunning()

BT::NodeStatus moveit_pro::behaviors::ForceExceedsThreshold::onRunning ()

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.

Declaration at line 66 of file force_exceeds_threshold.hpp, definition at line 139 of file force_exceeds_threshold.cpp.

onStart()

BT::NodeStatus moveit_pro::behaviors::ForceExceedsThreshold::onStart ()

Initializes the wrench topic subscriber based on the provided parameters.

Returns

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

Declaration at line 60 of file force_exceeds_threshold.hpp, definition at line 77 of file force_exceeds_threshold.cpp.

Private Member Attributes

num_times_wrench_exceeded_threshold_

std::size_t moveit_pro::behaviors::ForceExceedsThreshold::num_times_wrench_exceeded_threshold_ { 0 }

Counter for how many times the wrench value from the robot arm force sensor has exceeded the threshold. This is a simple way to prevent a single spurious reading from the sensor from stopping the force-limited motion.

Definition at line 104 of file force_exceeds_threshold.hpp.

tform_ft_sensor_to_hand_

geometry_msgs::msg::TransformStamped moveit_pro::behaviors::ForceExceedsThreshold::tform_ft_sensor_to_hand_

Set to the transform between the force/torque sensor frame and the hand frame at the start of servo motion.

Definition at line 93 of file force_exceeds_threshold.hpp.

wrench_exceeded_threshold_

std::atomic<bool> moveit_pro::behaviors::ForceExceedsThreshold::wrench_exceeded_threshold_ { false }

Set to True once the measured wrench exceeds the threshold described by the FORCE_THRESHOLD.

Definition at line 98 of file force_exceeds_threshold.hpp.

wrench_subscription_

rclcpp::Subscription<geometry_msgs::msg::WrenchStamped>::SharedPtr moveit_pro::behaviors::ForceExceedsThreshold::wrench_subscription_

A ROS subscriber to the topic containing the force to measure.

Definition at line 88 of file force_exceeds_threshold.hpp.

Public Static Functions

metadata()

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

Declaration at line 54 of file force_exceeds_threshold.hpp, definition at line 71 of file force_exceeds_threshold.cpp.

providedPorts()

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

Declaration at line 52 of file force_exceeds_threshold.hpp, definition at line 52 of file force_exceeds_threshold.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.