Skip to main content

PublishGhostRobotState Class

Publishes a robot state for the 3D Visualizer to render as a translucent ghost robot. More...

Declaration

class moveit_pro::behaviors::PublishGhostRobotState { ... }

Included Headers

#include <publish_ghost_robot_state.hpp>

Base class

classSharedResourcesNode<BehaviorTreeNodeT>

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

Public Constructors Index

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

Public Member Functions Index

BT::NodeStatustick () override

Public Static Functions Index

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

Public Static Attributes Index

static constexpr autokPortIDRobotState = "robot_state"
static constexpr autokPortIDHide = "hide"

Description

Publishes a robot state for the 3D Visualizer to render as a translucent ghost robot.

This Behavior publishes a moveit_msgs::msg::DisplayRobotState message to /display_robot_state, which the MoveIt Pro Desktop App renders alongside the live robot. Use it to preview a single suggested configuration — a candidate pick pose, an IK solution — without planning a trajectory.

The publisher is latched and owned by the BehaviorContext rather than this Behavior, so the ghost survives a Desktop App reload and the next Objective load. Set 'hide' to true to clear a previously published ghost.

info

ClearSnapshot drops every publisher the BehaviorContext owns, this one included, so the retained message goes with it and a Desktop App that reloads afterwards sees no ghost. It does not clear a ghost already on screen — destroying a publisher tells a connected subscriber nothing. Only 'hide' does that.

Returns SUCCESS once the message is published. Returns FAILURE when 'hide' is false and 'robot_state' is unset, names no joints, has mismatched or non-finite values, or when another Behavior already publishes a different message type on this topic.

The 3D Visualizer applies the state on top of the robot's live pose, so a state covering only one planning group leaves the rest of the robot where it is. That re-anchoring happens every time the ghost is drawn, so a partial state renders differently after a reload if the robot moved meanwhile — publish a complete state when the ghost must outlive the run. Other DisplayRobotState consumers differ: the legacy RViz plugin poses unnamed joints from the URDF defaults instead. highlight_links and attached_collision_objects are not rendered.

Data Port NamePort TypeObject Type
robot_stateinputmoveit_msgs::msg::RobotState
hideinputbool

Definition at line 48 of file publish_ghost_robot_state.hpp.

Public Constructors

PublishGhostRobotState()

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

Declaration at line 54 of file publish_ghost_robot_state.hpp, definition at line 109 of file publish_ghost_robot_state.cpp.

Public Member Functions

tick()

BT::NodeStatus moveit_pro::behaviors::PublishGhostRobotState::tick ()

Declaration at line 61 of file publish_ghost_robot_state.hpp, definition at line 131 of file publish_ghost_robot_state.cpp.

Public Static Functions

metadata()

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

Declaration at line 59 of file publish_ghost_robot_state.hpp, definition at line 125 of file publish_ghost_robot_state.cpp.

providedPorts()

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

Declaration at line 57 of file publish_ghost_robot_state.hpp, definition at line 115 of file publish_ghost_robot_state.cpp.

Public Static Attributes

kPortIDHide

constexpr auto moveit_pro::behaviors::PublishGhostRobotState::kPortIDHide = "hide"
constexpr static

Definition at line 52 of file publish_ghost_robot_state.hpp.

kPortIDRobotState

constexpr auto moveit_pro::behaviors::PublishGhostRobotState::kPortIDRobotState = "robot_state"
constexpr static

Definition at line 51 of file publish_ghost_robot_state.hpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.