Class: Nav_msgs::GetPlanRequest
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Nav_msgs::GetPlanRequest
- Defined in:
- lib/nav_msgs/GetPlan.rb
Constant Summary collapse
- @@struct_L3 =
::ROS::Struct.new("L3")
- @@struct_d7L3 =
::ROS::Struct.new("d7L3")
- @@struct_d7f =
::ROS::Struct.new("d7f")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['geometry_msgs/PoseStamped','geometry_msgs/PoseStamped','float32']
Instance Attribute Summary collapse
-
#goal ⇒ Object
Returns the value of attribute goal.
-
#start ⇒ Object
Returns the value of attribute start.
-
#tolerance ⇒ Object
Returns the value of attribute tolerance.
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 = {}) ⇒ GetPlanRequest
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ GetPlanRequest
Constructor. You can set the default values using keyword operators.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/nav_msgs/GetPlan.rb', line 101 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:start] @start = args[:start] else @start = Geometry_msgs::PoseStamped.new end if args[:goal] @goal = args[:goal] else @goal = Geometry_msgs::PoseStamped.new end if args[:tolerance] @tolerance = args[:tolerance] else @tolerance = 0.0 end end |
Instance Attribute Details
#goal ⇒ Object
Returns the value of attribute goal.
86 87 88 |
# File 'lib/nav_msgs/GetPlan.rb', line 86 def goal @goal end |
#start ⇒ Object
Returns the value of attribute start.
86 87 88 |
# File 'lib/nav_msgs/GetPlan.rb', line 86 def start @start end |
#tolerance ⇒ Object
Returns the value of attribute tolerance.
86 87 88 |
# File 'lib/nav_msgs/GetPlan.rb', line 86 def tolerance @tolerance end |
Class Method Details
.md5sum ⇒ Object
13 14 15 |
# File 'lib/nav_msgs/GetPlan.rb', line 13 def self.md5sum "e25a43e0752bcca599a8c2eef8282df8" end |
.type ⇒ Object
17 18 19 |
# File 'lib/nav_msgs/GetPlan.rb', line 17 def self.type "nav_msgs/GetPlanRequest" end |
Instance Method Details
#_get_types ⇒ String
internal API method
122 123 124 |
# File 'lib/nav_msgs/GetPlan.rb', line 122 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
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 |
# File 'lib/nav_msgs/GetPlan.rb', line 147 def deserialize(str) begin if @start == nil @start = Geometry_msgs::PoseStamped.new end if @goal == nil @goal = Geometry_msgs::PoseStamped.new end end_point = 0 start = end_point end_point += ROS::Struct::calc_size('L3') (@start.header.seq, @start.header.stamp.secs, @start.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 @start.header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('d7L3') (@start.pose.position.x, @start.pose.position.y, @start.pose.position.z, @start.pose.orientation.x, @start.pose.orientation.y, @start.pose.orientation.z, @start.pose.orientation.w, @goal.header.seq, @goal.header.stamp.secs, @goal.header.stamp.nsecs,) = @@struct_d7L3.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 @goal.header.frame_id = str[start..(end_point-1)] start = end_point end_point += ROS::Struct::calc_size('d7f') (@goal.pose.position.x, @goal.pose.position.y, @goal.pose.position.z, @goal.pose.orientation.x, @goal.pose.orientation.y, @goal.pose.orientation.z, @goal.pose.orientation.w, @tolerance,) = @@struct_d7f.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/nav_msgs/GetPlan.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 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/nav_msgs/GetPlan.rb', line 25 def " geometry_msgs/PoseStamped start geometry_msgs/PoseStamped goal float32 tolerance ================================================================================ MSG: geometry_msgs/PoseStamped # A Pose with reference coordinate frame and timestamp Header header Pose pose ================================================================================ 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
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/nav_msgs/GetPlan.rb', line 128 def serialize(buff) begin buff.write(@@struct_L3.pack(@start.header.seq, @start.header.stamp.secs, @start.header.stamp.nsecs)) _x = @start.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_d7L3.pack(@start.pose.position.x, @start.pose.position.y, @start.pose.position.z, @start.pose.orientation.x, @start.pose.orientation.y, @start.pose.orientation.z, @start.pose.orientation.w, @goal.header.seq, @goal.header.stamp.secs, @goal.header.stamp.nsecs)) _x = @goal.header.frame_id length = _x.length buff.write([length, _x].pack("La#{length}")) buff.write(@@struct_d7f.pack(@goal.pose.position.x, @goal.pose.position.y, @goal.pose.position.z, @goal.pose.orientation.x, @goal.pose.orientation.y, @goal.pose.orientation.z, @goal.pose.orientation.w, @tolerance)) rescue => exception raise "some erro in serialize: #{exception}" end end |