Class: Visualization_msgs::InteractiveMarkerFeedback
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Visualization_msgs::InteractiveMarkerFeedback
- Defined in:
- lib/visualization_msgs/InteractiveMarkerFeedback.rb
Constant Summary collapse
- KEEP_ALIVE =
Pseudo-constants
0
- POSE_UPDATE =
1
- MENU_SELECT =
2
- BUTTON_CLICK =
3
- MOUSE_DOWN =
4
- MOUSE_UP =
5
- @@struct_L3 =
::ROS::Struct.new("L3")
- @@struct_Cd7Ld3C =
::ROS::Struct.new("Cd7Ld3C")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['Header','string','string','string','uint8','geometry_msgs/Pose','uint32','geometry_msgs/Point','bool']
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#control_name ⇒ Object
Returns the value of attribute control_name.
-
#event_type ⇒ Object
Returns the value of attribute event_type.
-
#header ⇒ Object
Returns the value of attribute header.
-
#marker_name ⇒ Object
Returns the value of attribute marker_name.
-
#menu_entry_id ⇒ Object
Returns the value of attribute menu_entry_id.
-
#mouse_point ⇒ Object
Returns the value of attribute mouse_point.
-
#mouse_point_valid ⇒ Object
Returns the value of attribute mouse_point_valid.
-
#pose ⇒ Object
Returns the value of attribute pose.
Class Method Summary collapse
Instance Method Summary collapse
-
#_get_types ⇒ String
internal API method.
-
#deserialize(str) ⇒ Object
unpack serialized message in str into this message instance @param [String] str: byte array of serialized message.
- #has_header? ⇒ Boolean
-
#initialize(args = {}) ⇒ InteractiveMarkerFeedback
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ InteractiveMarkerFeedback
Constructor. You can set the default values using keyword operators.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 138 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:header] @header = args[:header] else @header = Std_msgs::Header.new end if args[:client_id] @client_id = args[:client_id] else @client_id = '' end if args[:marker_name] @marker_name = args[:marker_name] else @marker_name = '' end if args[:control_name] @control_name = args[:control_name] else @control_name = '' end if args[:event_type] @event_type = args[:event_type] else @event_type = 0 end if args[:pose] @pose = args[:pose] else @pose = Geometry_msgs::Pose.new end if args[:menu_entry_id] @menu_entry_id = args[:menu_entry_id] else @menu_entry_id = 0 end if args[:mouse_point] @mouse_point = args[:mouse_point] else @mouse_point = Geometry_msgs::Point.new end if args[:mouse_point_valid] @mouse_point_valid = args[:mouse_point_valid] else @mouse_point_valid = false end end |
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def client_id @client_id end |
#control_name ⇒ Object
Returns the value of attribute control_name.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def control_name @control_name end |
#event_type ⇒ Object
Returns the value of attribute event_type.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def event_type @event_type end |
#header ⇒ Object
Returns the value of attribute header.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def header @header end |
#marker_name ⇒ Object
Returns the value of attribute marker_name.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def marker_name @marker_name end |
#menu_entry_id ⇒ Object
Returns the value of attribute menu_entry_id.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def @menu_entry_id end |
#mouse_point ⇒ Object
Returns the value of attribute mouse_point.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def mouse_point @mouse_point end |
#mouse_point_valid ⇒ Object
Returns the value of attribute mouse_point_valid.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def mouse_point_valid @mouse_point_valid end |
#pose ⇒ Object
Returns the value of attribute pose.
118 119 120 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 118 def pose @pose end |
Class Method Details
.md5sum ⇒ Object
12 13 14 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 12 def self.md5sum "ab0f1eee058667e28c19ff3ffc3f4b78" end |
.type ⇒ Object
16 17 18 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 16 def self.type "visualization_msgs/InteractiveMarkerFeedback" end |
Instance Method Details
#_get_types ⇒ String
internal API method
189 190 191 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 189 def _get_types @slot_types end |
#deserialize(str) ⇒ Object
unpack serialized message in str into this message instance
@param [String] str: byte array of serialized message
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 219 def deserialize(str) begin if @header == nil @header = Std_msgs::Header.new end if @pose == nil @pose = Geometry_msgs::Pose.new end if @mouse_point == nil @mouse_point = Geometry_msgs::Point.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@header.seq, @header.stamp.secs, @header.stamp.nsecs,) = @@struct_L3.unpack(str[start..(end_point-1)]) start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length @header.frame_id = str[start..(end_point-1)] start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length @client_id = str[start..(end_point-1)] start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length @marker_name = str[start..(end_point-1)] start = end_point end_point += 4 (length,) = @@struct_L.unpack(str[start..(end_point-1)]) start = end_point end_point += length @control_name = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('Cd7Ld3C') (@event_type, @pose.position.x, @pose.position.y, @pose.position.z, @pose.orientation.x, @pose.orientation.y, @pose.orientation.z, @pose.orientation.w, @menu_entry_id, @mouse_point.x, @mouse_point.y, @mouse_point.z, @mouse_point_valid,) = @@struct_Cd7Ld3C.unpack(str[start..(end_point-1)]) @mouse_point_valid = bool(@mouse_point_valid) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
20 21 22 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 20 def has_header? true end |
#message_definition ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 24 def "# Time/frame info. Header header # Identifying string. Must be unique in the topic namespace. string client_id # Feedback message sent back from the GUI, e.g. # when the status of an interactive marker was modified by the user. # Specifies which interactive marker and control this message refers to string marker_name string control_name # Type of the event # KEEP_ALIVE: sent while dragging to keep up control of the marker # MENU_SELECT: a menu entry has been selected # BUTTON_CLICK: a button control has been clicked # POSE_UPDATE: the pose has been changed using one of the controls uint8 KEEP_ALIVE = 0 uint8 POSE_UPDATE = 1 uint8 MENU_SELECT = 2 uint8 BUTTON_CLICK = 3 uint8 MOUSE_DOWN = 4 uint8 MOUSE_UP = 5 uint8 event_type # Current pose of the marker # Note: Has to be valid for all feedback types. geometry_msgs/Pose pose # Contains the ID of the selected menu entry # Only valid for MENU_SELECT events. uint32 menu_entry_id # If event_type is BUTTON_CLICK, MOUSE_DOWN, or MOUSE_UP, mouse_point # may contain the 3 dimensional position of the event on the # control. If it does, mouse_point_valid will be true. mouse_point # will be relative to the frame listed in the header. geometry_msgs/Point mouse_point bool mouse_point_valid ================================================================================ MSG: std_msgs/Header # Standard metadata for higher-level stamped data types. # This is generally used to communicate timestamped data # in a particular coordinate frame. # # sequence ID: consecutively increasing ID uint32 seq #Two-integer timestamp that is expressed as: # * stamp.secs: seconds (stamp_secs) since epoch # * stamp.nsecs: nanoseconds since stamp_secs # time-handling sugar is provided by the client library time stamp #Frame this data is associated with # 0: no frame # 1: global frame string frame_id ================================================================================ MSG: geometry_msgs/Pose # A representation of pose in free space, composed of postion and orientation. Point position Quaternion orientation ================================================================================ MSG: geometry_msgs/Point # This contains the position of a point in free space float64 x float64 y float64 z ================================================================================ MSG: geometry_msgs/Quaternion # This represents an orientation in free space in quaternion form. float64 x float64 y float64 z float64 w " end |
#serialize(buff) ⇒ Object
serialize message into buffer
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/visualization_msgs/InteractiveMarkerFeedback.rb', line 195 def serialize(buff) begin buff.write(@@struct_L3.pack(@header.seq, @header.stamp.secs, @header.stamp.nsecs)) _x = @header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) _x = @client_id length = _x.length buff.write([length, _x].pack("La#{length}")) _x = @marker_name length = _x.length buff.write([length, _x].pack("La#{length}")) _x = @control_name length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_Cd7Ld3C.pack(@event_type, @pose.position.x, @pose.position.y, @pose.position.z, @pose.orientation.x, @pose.orientation.y, @pose.orientation.z, @pose.orientation.w, @menu_entry_id, @mouse_point.x, @mouse_point.y, @mouse_point.z, @mouse_point_valid)) rescue => exception raise "some erro in serialize: #{exception}" end end |