Skip to main content

PublishVelocityForceCommand Class

Publishes a velocity force command to the velocity force controller at a fixed rate. More...

Declaration​

class moveit_pro::behaviors::PublishVelocityForceCommand { ... }

Included Headers​

#include <publish_velocity_force_command.hpp>

Base class​

classSharedResourcesNode<BehaviorTreeNodeT>

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

Public Member Typedefs Index​

usingVelocityForceCommand = moveit_pro_controllers_msgs::msg::VelocityForceCommand

Public Constructors Index​

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

Public Member Functions Index​

BT::NodeStatusonStart () override
BT::NodeStatusonRunning () override
voidonHalted () override

Private Member Functions Index​

voidpublishCommand ()
std::optional< std::string >updateCommand ()
voidstopPublishing ()

Private Member Attributes Index​

std::mutexcommand_mutex_
rclcpp::TimerBase::SharedPtrtimer_
VelocityForceCommandcommand_
boolpublishing_stopped_ = false
std::shared_ptr< rclcpp::Publisher< moveit_pro_controllers_msgs::msg::VelocityForceCommand > >command_publisher_
boolwarned_twist_stamped_deprecated_ = false
boolwarned_wrench_stamped_deprecated_ = false
boolwarned_no_control_axes_ = false

Public Static Functions Index​

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

Description​

Publishes a velocity force command to the velocity force controller at a fixed rate.

By default the controller interprets the twist and wrench in its configured ee_frame (see the velocity_force_controller config). Set control_frame_id to a robot-model link (e.g. the world or base link) to express the references in that frame instead, for world-relative motion that stays fixed as the end-effector rotates; this Behavior does not transform between frames itself. Wire either the unstamped twist / wrench ports (recommended) or the legacy twist_stamped / wrench_stamped ports (deprecated, header.frame_id is ignored). Use UnpackTwistStampedMessage / UnpackWrenchStampedMessage to bridge from stamped sources.

Each published command carries the time the Behavior Tree last refreshed it, not the time the timer published it, so a tree that stops ticking lets the controller's command_timeout stop the robot. The controller ages the stamp of the last command it received, so the stall the stream tolerates is command_timeout less one publish period and one tick period — about 90 ms at the defaults, not the whole timeout. Lowering publish_rate shortens it.

Data Port NamePort TypeObject Type
velocity_force_controller_command_topicinputstd::string
velocity_controlled_axesinputstd::vector<int>
force_controlled_axesinputstd::vector<int>
wrench_gaininputdouble
twistinputgeometry_msgs::msg::Twist
wrenchinputgeometry_msgs::msg::Wrench
twist_stampedinputgeometry_msgs::msg::TwistStamped
wrench_stampedinputgeometry_msgs::msg::WrenchStamped
publish_rateinputint
control_frame_idinputstd::string

Definition at line 55 of file publish_velocity_force_command.hpp.

Public Member Typedefs​

VelocityForceCommand​

using moveit_pro::behaviors::PublishVelocityForceCommand::VelocityForceCommand = moveit_pro_controllers_msgs::msg::VelocityForceCommand

Definition at line 58 of file publish_velocity_force_command.hpp.

Public Constructors​

PublishVelocityForceCommand()​

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

Declaration at line 60 of file publish_velocity_force_command.hpp, definition at line 49 of file publish_velocity_force_command.cpp.

Public Member Functions​

onHalted()​

void moveit_pro::behaviors::PublishVelocityForceCommand::onHalted ()

Declaration at line 74 of file publish_velocity_force_command.hpp, definition at line 333 of file publish_velocity_force_command.cpp.

onRunning()​

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

Declaration at line 71 of file publish_velocity_force_command.hpp, definition at line 307 of file publish_velocity_force_command.cpp.

onStart()​

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

Declaration at line 68 of file publish_velocity_force_command.hpp, definition at line 253 of file publish_velocity_force_command.cpp.

Private Member Functions​

publishCommand()​

void moveit_pro::behaviors::PublishVelocityForceCommand::publishCommand ()

Declaration at line 78 of file publish_velocity_force_command.hpp, definition at line 295 of file publish_velocity_force_command.cpp.

stopPublishing()​

void moveit_pro::behaviors::PublishVelocityForceCommand::stopPublishing ()

Declaration at line 85 of file publish_velocity_force_command.hpp, definition at line 319 of file publish_velocity_force_command.cpp.

updateCommand()​

std::optional< std::string > moveit_pro::behaviors::PublishVelocityForceCommand::updateCommand ()

Declaration at line 81 of file publish_velocity_force_command.hpp, definition at line 107 of file publish_velocity_force_command.cpp.

Private Member Attributes​

command_​

VelocityForceCommand moveit_pro::behaviors::PublishVelocityForceCommand::command_

Definition at line 89 of file publish_velocity_force_command.hpp.

command_mutex_​

std::mutex moveit_pro::behaviors::PublishVelocityForceCommand::command_mutex_

Definition at line 87 of file publish_velocity_force_command.hpp.

command_publisher_​

std::shared_ptr<rclcpp::Publisher<moveit_pro_controllers_msgs::msg::VelocityForceCommand> > moveit_pro::behaviors::PublishVelocityForceCommand::command_publisher_

Definition at line 93 of file publish_velocity_force_command.hpp.

publishing_stopped_​

bool moveit_pro::behaviors::PublishVelocityForceCommand::publishing_stopped_ = false

Definition at line 92 of file publish_velocity_force_command.hpp.

timer_​

rclcpp::TimerBase::SharedPtr moveit_pro::behaviors::PublishVelocityForceCommand::timer_

Definition at line 88 of file publish_velocity_force_command.hpp.

warned_no_control_axes_​

bool moveit_pro::behaviors::PublishVelocityForceCommand::warned_no_control_axes_ = false

Definition at line 99 of file publish_velocity_force_command.hpp.

warned_twist_stamped_deprecated_​

bool moveit_pro::behaviors::PublishVelocityForceCommand::warned_twist_stamped_deprecated_ = false

Definition at line 97 of file publish_velocity_force_command.hpp.

warned_wrench_stamped_deprecated_​

bool moveit_pro::behaviors::PublishVelocityForceCommand::warned_wrench_stamped_deprecated_ = false

Definition at line 98 of file publish_velocity_force_command.hpp.

Public Static Functions​

metadata()​

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

Declaration at line 65 of file publish_velocity_force_command.hpp, definition at line 101 of file publish_velocity_force_command.cpp.

providedPorts()​

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

Declaration at line 63 of file publish_velocity_force_command.hpp, definition at line 56 of file publish_velocity_force_command.cpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.