Class InteractiveMarker

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

  • public QObject

Class Documentation

class InteractiveMarker : public QObject

Public Types

using SharedPtr = std::shared_ptr<InteractiveMarker>

Public Functions

InteractiveMarker(Ogre::SceneNode *scene_node, rviz_common::DisplayContext *context)
virtual ~InteractiveMarker()
bool processMessage(const visualization_msgs::msg::InteractiveMarker &message)

Reset contents to reflect the data from a new message.

Returns:

true if successful, false otherwise.

void processMessage(const visualization_msgs::msg::InteractiveMarkerPose &message)

Reset contents to reflect the data from a new message.

Returns:

true if successful, false otherwise.

void update()

Called every frame update.

void setPose(Ogre::Vector3 position, Ogre::Quaternion orientation, const std::string &control_name)

Directly set the pose relative to the parent frame.

If publish is set to true, then the change is published.

void translate(Ogre::Vector3 delta_position, const std::string &control_name)
void rotate(Ogre::Quaternion delta_orientation, const std::string &control_name)
void requestPoseUpdate(Ogre::Vector3 position, Ogre::Quaternion orientation)

Schedule a pose reset once dragging is finished.

void startDragging()
void stopDragging()
inline const Ogre::Vector3 &getPosition()
inline const Ogre::Quaternion &getOrientation()
inline float getSize()
inline const std::string &getReferenceFrame()
inline const std::string &getName()
void setShowDescription(bool show)

Show name above marker.

void setShowAxes(bool show)

Show axes in origin.

void setShowVisualAids(bool show)

Show visual helpers while dragging.

bool handleMouseEvent(rviz_common::ViewportMouseEvent &event, const std::string &control_name)
Returns:

true if the mouse event was intercepted, false if it was ignored.

bool handle3DCursorEvent(rviz_common::ViewportMouseEvent &event, const Ogre::Vector3 &cursor_pos, const Ogre::Quaternion &cursor_rot, const std::string &control_name)

Supports selection and menu events from a 3D cursor.

Parameters:
Returns:

true if the cursor event was intercepted, false if it was ignored.

void showMenu(rviz_common::ViewportMouseEvent &event, const std::string &control_name, const Ogre::Vector3 &three_d_point, bool valid_point)

Pop up the context menu for this marker.

Parameters:
  • event – A struct holding certain event data (see full description on InteractiveMarkerControl::handle3DCursorEvent).

  • control_name – The name of the InteractiveMarkerControl that was selected.

  • three_d_point – The world-relative position associated with this mouse-click or cursor event.

  • valid_point – true if three_d_point is valid (e.g. if the mouse ray was successfully intersected with marker geometry).

void publishFeedback(visualization_msgs::msg::InteractiveMarkerFeedback &feedback, bool mouse_point_valid = false, const Ogre::Vector3 &mouse_point_rel_world = Ogre::Vector3(0, 0, 0))

Publish the current marker pose and name.

inline bool hasMenu()
inline std::shared_ptr<QMenu> getMenu()
Returns:

A shared_ptr to the QMenu owned by this InteractiveMarker.

Signals

void userFeedback(visualization_msgs::msg::InteractiveMarkerFeedback &feedback)
void statusUpdate(rviz_common::properties::StatusProperty::Level level, const std::string &name, const std::string &text)

Protected Slots

void handleMenuSelect(int menu_item_id)