49 for (
unsigned c = 0; c < msg.controls.size(); c++)
52 for (
unsigned m = 0; m < msg.controls[c].markers.size(); m++)
57 valid = valid &&
validateFloats(msg.controls[c].markers[m].points);
67 for (
size_t c = 0; c < marker.controls.size(); ++c)
71 for (
size_t m = 0; m < marker.controls[c].markers.size(); ++m)
86 ros::message_traits::datatype<visualization_msgs::InteractiveMarkerUpdate>(),
87 "visualization_msgs::InteractiveMarkerUpdate topic to subscribe to.",
this,
92 "Whether or not to show the descriptions of each Interactive Marker.",
this,
96 new BoolProperty(
"Show Axes",
false,
"Whether or not to show the axes of each Interactive Marker.",
100 "Show Visual Aids",
false,
101 "Whether or not to show visual helpers while moving/rotating Interactive Markers.",
this,
104 "Enable Transparency",
true,
105 "Whether or not to allow transparency for auto-completed markers (e.g. rings and arrows).",
this,
119 boost::placeholders::_2, boost::placeholders::_3));
147 size_t idx = update_topic.find(
"/update");
148 if (idx != std::string::npos)
165 std::string feedback_topic =
topic_ns_ +
"/feedback";
167 update_nh_.
advertise<visualization_msgs::InteractiveMarkerFeedback>(feedback_topic, 100,
false);
178 const std::string& name,
179 const std::string& text)
198 M_StringToStringToIMPtr::iterator server_it;
201 M_StringToIMPtr::iterator im_it;
202 for (im_it = server_it->second.begin(); im_it != server_it->second.end(); im_it++)
204 im_it->second->update(wall_dt);
219 return im_map_it->second;
223 const std::string& server_id,
224 const std::vector<visualization_msgs::InteractiveMarker>& markers)
228 for (
size_t i = 0; i < markers.size(); i++)
230 const visualization_msgs::InteractiveMarker& marker = markers[i];
243 "Interactive marker '%s' contains unnormalized quaternions. "
244 "This warning will only be output once but may be true for others; "
245 "enable DEBUG messages for ros.rviz.quaternions to see more details.",
246 marker.name.c_str());
247 ROS_DEBUG_NAMED(
"quaternions",
"Interactive marker '%s' contains unnormalized quaternions.",
248 marker.name.c_str());
250 ROS_DEBUG(
"Processing interactive marker '%s'. %d", marker.name.c_str(), (
int)marker.controls.size());
252 std::map<std::string, IMPtr>::iterator int_marker_entry = im_map.find(marker.name);
254 if (int_marker_entry == im_map.end())
266 if (int_marker_entry->second->processMessage(marker))
281 const std::vector<std::string>& erases)
285 for (
size_t i = 0; i < erases.size(); i++)
287 im_map.erase(erases[i]);
293 const std::string& server_id,
294 const std::vector<visualization_msgs::InteractiveMarkerPose>& marker_poses)
298 for (
size_t i = 0; i < marker_poses.size(); i++)
300 const visualization_msgs::InteractiveMarkerPose& marker_pose = marker_poses[i];
311 "Pose message contains invalid quaternions (length not equal to 1)!");
315 std::map<std::string, IMPtr>::iterator int_marker_entry = im_map.find(marker_pose.name);
317 if (int_marker_entry != im_map.end())
319 int_marker_entry->second->processMessage(marker_pose);
324 "Pose received for non-existing marker '" + marker_pose.name);
351 const std::string& server_id,
352 const std::string& msg)
375 M_StringToStringToIMPtr::iterator server_it;
378 M_StringToIMPtr::iterator im_it;
379 for (im_it = server_it->second.begin(); im_it != server_it->second.end(); im_it++)
381 im_it->second->setShowDescription(
show);
390 M_StringToStringToIMPtr::iterator server_it;
393 M_StringToIMPtr::iterator im_it;
394 for (im_it = server_it->second.begin(); im_it != server_it->second.end(); im_it++)
396 im_it->second->setShowAxes(
show);
405 M_StringToStringToIMPtr::iterator server_it;
408 M_StringToIMPtr::iterator im_it;
409 for (im_it = server_it->second.begin(); im_it != server_it->second.end(); im_it++)
411 im_it->second->setShowVisualAids(
show);