53 void enableCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback )
59 if ( state == MenuHandler::CHECKED )
68 ROS_INFO(
"Showing first menu entry");
71 menu_handler.
reApply( *server );
74 server->applyChanges();
77 void modeCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback )
85 menu_handler.
reApply( *server );
86 server->applyChanges();
95 marker.type = Marker::CUBE;
96 marker.scale.x = msg.scale * 0.45;
97 marker.scale.y = msg.scale * 0.45;
98 marker.scale.z = msg.scale * 0.45;
100 marker.color.g = 0.5;
101 marker.color.b = 0.5;
102 marker.color.a = 1.0;
109 InteractiveMarkerControl control;
110 control.always_visible =
true;
111 control.markers.push_back(
makeBox(msg) );
112 msg.controls.push_back( control );
114 return msg.controls.back();
120 int_marker.header.frame_id =
"base_link";
121 int_marker.pose.position.y = -3.0 *
marker_pos++;;
122 int_marker.scale = 1;
130 int_marker.name =
name;
132 InteractiveMarkerControl control;
134 control.interaction_mode = InteractiveMarkerControl::BUTTON;
135 control.always_visible =
true;
137 control.markers.push_back(
makeBox( int_marker ) );
138 int_marker.controls.push_back(control);
140 server->insert( int_marker );
143 void deepCb(
const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback )
145 ROS_INFO(
"The deep sub-menu has been found.");
152 entry = menu_handler.
insert( entry,
"sub" );
159 for (
int i=0; i<5; i++ )
161 std::ostringstream
s;
170 int main(
int argc,
char** argv)
181 menu_handler.
apply( *server,
"marker1" );
182 menu_handler.
apply( *server,
"marker2" );
183 server->applyChanges();
bool getCheckState(EntryHandle handle, CheckState &check_state) const
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool apply(InteractiveMarkerServer &server, const std::string &marker_name)
ROSCPP_DECL void spin(Spinner &spinner)
bool setVisible(EntryHandle handle, bool visible)
bool setCheckState(EntryHandle handle, CheckState check_state)
EntryHandle insert(const std::string &title, const FeedbackCallback &feedback_cb)
bool reApply(InteractiveMarkerServer &server)