34 #include <boost/bind.hpp>
35 #include <boost/make_shared.hpp>
49 EntryHandle handle =
doInsert( title, visualization_msgs::MenuEntry::FEEDBACK,
"", feedback_cb );
55 const uint8_t command_type,
56 const std::string &command )
67 boost::unordered_map<EntryHandle, EntryContext>::iterator parent_context =
72 EntryHandle handle =
doInsert( title, visualization_msgs::MenuEntry::FEEDBACK,
"", feedback_cb );
73 parent_context->second.sub_entries.push_back( handle );
79 const uint8_t command_type,
80 const std::string &command )
82 boost::unordered_map<EntryHandle, EntryContext>::iterator parent_context =
88 parent_context->second.sub_entries.push_back( handle );
95 boost::unordered_map<EntryHandle, EntryContext>::iterator context =
103 context->second.visible = visible;
110 boost::unordered_map<EntryHandle, EntryContext>::iterator context =
118 context->second.check_state = check_state;
125 boost::unordered_map<EntryHandle, EntryContext>::const_iterator context =
134 check_state = context->second.check_state;
141 visualization_msgs::InteractiveMarker int_marker;
143 if ( !
server.get( marker_name, int_marker ) )
150 int_marker.menu_entries.clear();
154 server.insert( int_marker );
161 std::vector<visualization_msgs::MenuEntry>& entries_out,
164 for (
unsigned t = 0;
t < handles_in.size();
t++ )
167 boost::unordered_map<EntryHandle, EntryContext>::iterator context_it =
172 ROS_ERROR(
"Internal error: context handle not found! This is a bug in MenuHandler." );
183 entries_out.push_back(
makeEntry( context, handle, parent_handle ));
200 std::set<std::string>::iterator next_it = it;
209 const uint8_t command_type,
210 const std::string &command,
217 context.
title = title;
230 visualization_msgs::MenuEntry menu_entry;
235 menu_entry.title = context.
title;
238 menu_entry.title =
"[x] "+context.
title;
241 menu_entry.title =
"[ ] "+context.
title;
245 menu_entry.command = context.
command;
247 menu_entry.id = handle;
248 menu_entry.parent_id = parent_handle;
256 boost::unordered_map<EntryHandle, EntryContext>::iterator context =
261 context->second.feedback_cb( feedback );
267 boost::unordered_map<EntryHandle, EntryContext>::const_iterator context =
275 title = context->second.title;