4 Copyright (c) 2011, Willow Garage, Inc. 7 Redistribution and use in source and binary forms, with or without 8 modification, are permitted provided that the following conditions are met: 10 * Redistributions of source code must retain the above copyright 11 notice, this list of conditions and the following disclaimer. 12 * Redistributions in binary form must reproduce the above copyright 13 notice, this list of conditions and the following disclaimer in the 14 documentation and/or other materials provided with the distribution. 15 * Neither the name of the Willow Garage, Inc. nor the names of its 16 contributors may be used to endorse or promote products derived from 17 this software without specific prior written permission. 19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 POSSIBILITY OF SUCH DAMAGE. 38 p = feedback.pose.position
39 print feedback.marker_name +
" is now at " + str(p.x) +
", " + str(p.y) +
", " + str(p.z)
41 if __name__==
"__main__":
42 rospy.init_node(
"simple_marker")
48 int_marker = InteractiveMarker()
49 int_marker.header.frame_id =
"base_link" 50 int_marker.name =
"my_marker" 51 int_marker.description =
"Simple 1-DOF Control" 55 box_marker.type = Marker.CUBE
56 box_marker.scale.x = 0.45
57 box_marker.scale.y = 0.45
58 box_marker.scale.z = 0.45
59 box_marker.color.r = 0.0
60 box_marker.color.g = 0.5
61 box_marker.color.b = 0.5
62 box_marker.color.a = 1.0
65 box_control = InteractiveMarkerControl()
66 box_control.always_visible =
True 67 box_control.markers.append( box_marker )
70 int_marker.controls.append( box_control )
75 rotate_control = InteractiveMarkerControl()
76 rotate_control.name =
"move_x" 77 rotate_control.interaction_mode = InteractiveMarkerControl.MOVE_AXIS
80 int_marker.controls.append(rotate_control);
84 server.insert(int_marker, processFeedback)
def processFeedback(feedback)