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
Included Headers
Base class
| class | SharedResourcesNode<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::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... | |
Private Member Attributes Index
| rclcpp::Subscription< geometry_msgs::msg::WrenchStamped >::SharedPtr | wrench_subscription_ |
|
A ROS subscriber to the topic containing the force to measure. More... | |
| geometry_msgs::msg::TransformStamped | 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. 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_t | 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. More... | |
Public Static Functions Index
| static BT::PortsList | providedPorts () |
| static BT::KeyValueVector | metadata () |
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 |
Definition at line 46 of file force_exceeds_threshold.hpp.
Public Constructors
ForceExceedsThreshold()
|
Declaration at line 49 of file force_exceeds_threshold.hpp, definition at line 46 of file force_exceeds_threshold.cpp.
Public Member Functions
addWrenchReading()
|
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()
|
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()
|
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()
|
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_
|
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_
|
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_
|
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_
|
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()
| static |
Declaration at line 54 of file force_exceeds_threshold.hpp, definition at line 71 of file force_exceeds_threshold.cpp.
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.