Drives a mobile base's velocity command topic from the base jog commands the MoveIt Pro Desktop App publishes during teleoperation. More...
Declaration
class moveit_pro::behaviors::BaseJog { ... }
#include <base_jog.hpp>
Base class
Public Constructors Index
| BaseJog (const std::string &name, const BT::NodeConfiguration &config, const std::shared_ptr< BehaviorContext > &shared_resources) |
|
Constructor for the BaseJog Behavior. More...
|
|
Public Member Functions Index
| BT::NodeStatus | onStart () override |
|
Reads the base_jog settings, then creates the jog command subscription and, unless the topic is unchanged, the twist publisher. More...
|
|
| BT::NodeStatus | onRunning () override |
|
Publishes the latest command, restamped and clamped, when a new one arrived since the last tick, or one zero twist when commands stopped while the base was moving. More...
|
|
| void | onHalted () override |
|
Drops the subscription and publishes one zero twist. More...
|
|
Private Member Functions Index
| void | publishTwist (const geometry_msgs::msg::Twist &twist) const |
|
Publishes a twist on the output topic, stamped now. More...
|
|
Private Member Attributes Index
Public Static Functions Index
Description
Drives a mobile base's velocity command topic from the base jog commands the MoveIt Pro Desktop App publishes during teleoperation.
Reads the base's planning group and speed limits from the robot config's moveit_params.base_jog file, which the objective server holds as its base_jog.* parameters. Subscribes to /base_jog/<planning_group> (geometry_msgs::msg::TwistStamped) and, for every new command, publishes linear x and angular z clamped by internal::clampPlanarTwist() as a geometry_msgs::msg::TwistStamped on cmd_vel_topic, in the base's body frame (header.frame_id left empty) and stamped with the current time (the browser's stamp is not forwarded, because base controllers drop commands older than their timeout). It publishes nothing until a command arrives and does not repeat a command. When commands stop for 0.25 s while the base is moving, it publishes one zero twist, and halting publishes one too. It does no collision checking, does not activate the base controller (run SwitchController first), and warns once per run when nothing subscribes to cmd_vel_topic.
Returns RUNNING until halted; it never returns SUCCESS. Returns FAILURE when the port is missing, the robot config defines no complete base_jog file, a velocity limit is not finite and greater than 0, or a topic name is invalid.
| Data Port Name | Port Type | Object Type |
|---|
| cmd_vel_topic | input | std::string |
Definition at line 77 of file base_jog.hpp.
Public Constructors
BaseJog()
| moveit_pro::behaviors::BaseJog::BaseJog (const std::string & name, const BT::NodeConfiguration & config, const std::shared_ptr< BehaviorContext > & shared_resources) |
|
Constructor for the BaseJog Behavior.
- Parameters
-
| name | Name of the node. Must match the name used for this node in the behavior tree definition file (the .xml file). |
| config | Node configuration. Only used here because the BehaviorTree.CPP expects constructor signature with name and config first before custom constructor parameters. |
| shared_resources | Provides access to common resources such as the node handle and failure logger that are shared between all the behaviors that inherit from moveit_pro::behaviors::SharedResourcesNode. |
Declaration at line 89 of file base_jog.hpp, definition at line 160 of file base_jog.cpp.
Public Member Functions
onHalted()
| void moveit_pro::behaviors::BaseJog::onHalted () |
|
Drops the subscription and publishes one zero twist.
Declaration at line 109 of file base_jog.hpp, definition at line 260 of file base_jog.cpp.
onRunning()
| BT::NodeStatus moveit_pro::behaviors::BaseJog::onRunning () |
|
Publishes the latest command, restamped and clamped, when a new one arrived since the last tick, or one zero twist when commands stopped while the base was moving.
Declaration at line 106 of file base_jog.hpp, definition at line 227 of file base_jog.cpp.
onStart()
| BT::NodeStatus moveit_pro::behaviors::BaseJog::onStart () |
|
Reads the base_jog settings, then creates the jog command subscription and, unless the topic is unchanged, the twist publisher.
Declaration at line 100 of file base_jog.hpp, definition at line 180 of file base_jog.cpp.
Private Member Functions
publishTwist()
| void moveit_pro::behaviors::BaseJog::publishTwist (const geometry_msgs::msg::Twist & twist) |
|
Publishes a twist on the output topic, stamped now.
Declaration at line 123 of file base_jog.hpp, definition at line 270 of file base_jog.cpp.
Private Member Attributes
base_moving_
| bool moveit_pro::behaviors::BaseJog::base_moving_ = false |
|
cmd_vel_publisher_
| rclcpp::Publisher<geometry_msgs::msg::TwistStamped>::SharedPtr moveit_pro::behaviors::BaseJog::cmd_vel_publisher_ |
|
cmd_vel_topic_
| std::string moveit_pro::behaviors::BaseJog::cmd_vel_topic_ |
|
command_slot_
| std::shared_ptr<CommandSlot> moveit_pro::behaviors::BaseJog::command_slot_ |
|
command_subscription_
| rclcpp::Subscription<geometry_msgs::msg::TwistStamped>::SharedPtr moveit_pro::behaviors::BaseJog::command_subscription_ |
|
last_command_time_
| std::chrono::steady_clock::time_point moveit_pro::behaviors::BaseJog::last_command_time_ |
|
max_angular_velocity_
| double moveit_pro::behaviors::BaseJog::max_angular_velocity_ = 0.0 |
|
max_linear_velocity_
| double moveit_pro::behaviors::BaseJog::max_linear_velocity_ = 0.0 |
|
warned_no_subscriber_
| bool moveit_pro::behaviors::BaseJog::warned_no_subscriber_ = false |
|
Public Static Functions
metadata()
| BT::KeyValueVector moveit_pro::behaviors::BaseJog::metadata () |
|
static
|
providedPorts()
| BT::PortsList moveit_pro::behaviors::BaseJog::providedPorts () |
|
static
|
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.