interactive_markers.interactive_marker_server module
- class interactive_markers.interactive_marker_server.InteractiveMarkerServer(node, namespace, *, update_pub_qos=rclpy.qos.QoSProfile, feedback_sub_qos=rclpy.qos.QoSProfile)
Bases:
object
A server to one or many clients (e.g. rviz) displaying a set of interactive markers.
- Note: Keep in mind that changes made by calling insert(), erase(), setCallback() etc.
are not applied until calling applyChanges().
- DEFAULT_FEEDBACK_CALLBACK = 255
- applyChanges()
Apply changes made since the last call to this method and broadcast to clients.
- clear()
Clear all markers.
Note: This change will not take effect until you call applyChanges().
- doSetPose(update, name, pose, header)
Schedule a pose update pose without locking.
- erase(name)
Erase the marker with the specified name.
Note: This change will not take effect until you call applyChanges().
- Parameters:
name – Name of the interactive marker.
- Returns:
True if a marker with that name exists, False otherwise.
- get(name)
Get marker by name.
- Parameters:
name – Name of the interactive marker.
- Returns:
Marker if exists, None otherwise.
- getInteractiveMarkersCallback(request, response)
Process a service request to get the current interactive markers.
- insert(marker, *, feedback_callback=None, feedback_type=255)
Add or replace a marker.
Note: Changes to the marker will not take effect until you call applyChanges(). The callback changes immediately.
- Parameters:
marker – The marker to be added or replaced.
feedback_callback – Function to call on the arrival of a feedback message.
feedback_type – Type of feedback for which to call the feedback.
- processFeedback(feedback)
Update marker pose and call user callback.
- publish(update)
Increase the sequence number and publish an update.
- setCallback(name, feedback_callback, feedback_type=255)
Add or replace a callback function for the specified marker.
Note: This change will not take effect until you call applyChanges(). The server will try to call any type-specific callback first. If a callback for the given type already exists, it will be replaced. To unset a callback, pass a value of None.
- Parameters:
name – Name of the interactive marker
feedback_callback – Function to call on the arrival of a feedback message.
feedback_type – Type of feedback for which to call the feedback. Leave this empty to make this the default callback.
- setPose(name, pose, header=std_msgs.msg.Header)
Update the pose of a marker with the specified name.
Note: This change will not take effect until you call applyChanges()
- Parameters:
name – Name of the interactive marker.
pose – The new pose.
header – Header replacement. Leave this empty to use the previous one.
- Returns:
True if a marker with that name exists, False otherwise.
- shutdown()
Shutdown the interactive marker server.
This should be called before the node is destroyed so that the internal ROS entities can be destroyed.
- class interactive_markers.interactive_marker_server.MarkerContext(time)
Bases:
object
Represents a single marker.