Performance: Interactive markers for teleoperation
This concept affects the responsiveness and smoothness of user interactions with robot controls in the browser or GUI, impacting input delay and visual stability.
Jump into concepts and practice - no test required
void onMarkerInteraction() {
updateMarkerPose();
publishMarker();
}
// Only update when user interactswhile (true) { updateMarkerPose(); publishMarker(); ros::Duration(0.01).sleep(); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Continuous high-rate updates | High (many marker redraws) | Many (each update triggers reflow) | High (frequent repaints) | [X] Bad |
| Event-driven updates | Low (only on interaction) | Few (minimal reflows) | Low (less repainting) | [OK] Good |
void processFeedback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback) {
if (feedback->event_type == visualization_msgs::InteractiveMarkerFeedback::POSE_UPDATE) {
geometry_msgs::Pose new_pose = feedback->pose;
// Update robot command with new_pose
}
}
What happens when the user moves the marker?void feedbackCallback(const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback) {
if (feedback->event_type = visualization_msgs::InteractiveMarkerFeedback::POSE_UPDATE) {
// update robot command
}
}
What is the error?