Go to the documentation of this file.00001
00059
00060
00061
00062
00063
00064
00065
00066
00067 #include "interactive_markers.h"
00068
00069 using namespace Slam;
00070
00071 InteractiveMarkers::InteractiveMarkers():
00072 server_("slam_markers")
00073 {
00074
00075 }
00076
00077 template<typename OBJECT_CONTEXT>
00078 void InteractiveMarkers<OBJECT_CONTEXT>::createNode(Node<OBJECT_CONTEXT>::Ptr node)
00079 {
00080
00081
00082 visualization_msgs::InteractiveMarker int_marker;
00083 int_marker.header.frame_id = "/base_link";
00084 int_marker.name = "my_marker";
00085 int_marker.description = "Simple 1-DOF Control";
00086
00087
00088 visualization_msgs::Marker box_marker;
00089 box_marker.type = visualization_msgs::Marker::CUBE;
00090 box_marker.scale.x = 0.45;
00091 box_marker.scale.y = 0.45;
00092 box_marker.scale.z = 0.45;
00093 box_marker.color.r = 0.5;
00094 box_marker.color.g = 0.5;
00095 box_marker.color.b = 0.5;
00096 box_marker.color.a = 1.0;
00097
00098
00099 visualization_msgs::InteractiveMarkerControl box_control;
00100 box_control.always_visible = true;
00101 box_control.markers.push_back( box_marker );
00102
00103
00104 int_marker.controls.push_back( box_control );
00105
00106
00107
00108
00109 visualization_msgs::InteractiveMarkerControl rotate_control;
00110 rotate_control.name = "move_x";
00111 rotate_control.interaction_mode =
00112 visualization_msgs::InteractiveMarkerControl::MOVE_AXIS;
00113
00114
00115 int_marker.controls.push_back(rotate_control);
00116
00117
00118
00119 server.insert(int_marker, &processFeedback);
00120
00121
00122 server.applyChanges();
00123 }
00124
00125 int main(int argc, char** argv)
00126 {
00127
00128
00129 ros::spin();
00130 }