Class: Pr2_controllers_msgs::PointHeadGoal
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Pr2_controllers_msgs::PointHeadGoal
- Defined in:
- lib/pr2_controllers_msgs/PointHeadGoal.rb
Constant Summary collapse
- @@struct_L3 =
::ROS::Struct.new("L3")
- @@struct_d6 =
::ROS::Struct.new("d6")
- @@struct_l2d =
::ROS::Struct.new("l2d")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['geometry_msgs/PointStamped','geometry_msgs/Vector3','string','duration','float64']
Instance Attribute Summary collapse
-
#max_velocity ⇒ Object
Returns the value of attribute max_velocity.
-
#min_duration ⇒ Object
Returns the value of attribute min_duration.
-
#pointing_axis ⇒ Object
Returns the value of attribute pointing_axis.
-
#pointing_frame ⇒ Object
Returns the value of attribute pointing_frame.
-
#target ⇒ Object
Returns the value of attribute target.
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 = {}) ⇒ PointHeadGoal
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ PointHeadGoal
Constructor. You can set the default values using keyword operators.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 90 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:target] @target = args[:target] else @target = Geometry_msgs::PointStamped.new end if args[:pointing_axis] @pointing_axis = args[:pointing_axis] else @pointing_axis = Geometry_msgs::Vector3.new end if args[:pointing_frame] @pointing_frame = args[:pointing_frame] else @pointing_frame = '' end if args[:min_duration] @min_duration = args[:min_duration] else @min_duration = ROS::Duration.new end if args[:max_velocity] @max_velocity = args[:max_velocity] else @max_velocity = 0.0 end end |
Instance Attribute Details
#max_velocity ⇒ Object
Returns the value of attribute max_velocity.
73 74 75 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 73 def max_velocity @max_velocity end |
#min_duration ⇒ Object
Returns the value of attribute min_duration.
73 74 75 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 73 def min_duration @min_duration end |
#pointing_axis ⇒ Object
Returns the value of attribute pointing_axis.
73 74 75 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 73 def pointing_axis @pointing_axis end |
#pointing_frame ⇒ Object
Returns the value of attribute pointing_frame.
73 74 75 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 73 def pointing_frame @pointing_frame end |
#target ⇒ Object
Returns the value of attribute target.
73 74 75 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 73 def target @target end |
Class Method Details
.md5sum ⇒ Object
13 14 15 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 13 def self.md5sum "8b92b1cd5e06c8a94c917dc3209a4c1d" end |
.type ⇒ Object
17 18 19 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 17 def self.type "pr2_controllers_msgs/PointHeadGoal" end |
Instance Method Details
#_get_types ⇒ String
internal API method
121 122 123 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 121 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
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 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 146 def deserialize(str) begin if @target == nil @target = Geometry_msgs::PointStamped.new end if @pointing_axis == nil @pointing_axis = Geometry_msgs::Vector3.new end if @min_duration == nil @min_duration = ROS::Duration.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@target.header.seq, @target.header.stamp.secs, @target.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 @target.header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('d6') (@target.point.x, @target.point.y, @target.point.z, @pointing_axis.x, @pointing_axis.y, @pointing_axis.z,) = @@struct_d6.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 @pointing_frame = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('l2d') (@min_duration.secs, @min_duration.nsecs, @max_velocity,) = @@struct_l2d.unpack(str[start..(end_point-1)]) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
21 22 23 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 21 def has_header? false end |
#message_definition ⇒ Object
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 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 25 def "# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== geometry_msgs/PointStamped target geometry_msgs/Vector3 pointing_axis string pointing_frame duration min_duration float64 max_velocity ================================================================================ MSG: geometry_msgs/PointStamped # This represents a Point with reference coordinate frame and timestamp Header header Point point ================================================================================ 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/Point # This contains the position of a point in free space float64 x float64 y float64 z ================================================================================ MSG: geometry_msgs/Vector3 # This represents a vector in free space. float64 x float64 y float64 z " end |
#serialize(buff) ⇒ Object
serialize message into buffer
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/pr2_controllers_msgs/PointHeadGoal.rb', line 127 def serialize(buff) begin buff.write(@@struct_L3.pack(@target.header.seq, @target.header.stamp.secs, @target.header.stamp.nsecs)) _x = @target.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_d6.pack(@target.point.x, @target.point.y, @target.point.z, @pointing_axis.x, @pointing_axis.y, @pointing_axis.z)) _x = @pointing_frame length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_l2d.pack(@min_duration.secs, @min_duration.nsecs, @max_velocity)) rescue => exception raise "some erro in serialize: #{exception}" end end |