Class: Sensor_msgs::NavSatStatus
- Inherits:
-
ROS::Message
- Object
- ROS::Message
- Sensor_msgs::NavSatStatus
- Defined in:
- lib/sensor_msgs/NavSatStatus.rb
Constant Summary collapse
- STATUS_NO_FIX =
Pseudo-constants
-1
- STATUS_FIX =
0
- STATUS_SBAS_FIX =
1
- STATUS_GBAS_FIX =
2
- SERVICE_GPS =
1
- SERVICE_GLONASS =
2
- SERVICE_COMPASS =
4
- SERVICE_GALILEO =
8
- @@struct_cS =
::ROS::Struct.new("cS")
- @@struct_L =
::ROS::Struct.new("L")
- @@slot_types =
['int8','uint16']
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
-
#status ⇒ Object
Returns the value of attribute status.
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 = {}) ⇒ NavSatStatus
constructor
Constructor.
- #message_definition ⇒ Object
-
#serialize(buff) ⇒ Object
serialize message into buffer.
Constructor Details
#initialize(args = {}) ⇒ NavSatStatus
Constructor. You can set the default values using keyword operators.
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 68 def initialize(args={}) # message fields cannot be None, assign default values for those that are if args[:status] @status = args[:status] else @status = 0 end if args[:service] @service = args[:service] else @service = 0 end end |
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
56 57 58 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 56 def service @service end |
#status ⇒ Object
Returns the value of attribute status.
56 57 58 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 56 def status @status end |
Class Method Details
.md5sum ⇒ Object
8 9 10 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 8 def self.md5sum "331cdbddfa4bc96ffc3b9ad98900a54c" end |
.type ⇒ Object
12 13 14 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 12 def self.type "sensor_msgs/NavSatStatus" end |
Instance Method Details
#_get_types ⇒ String
internal API method
84 85 86 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 84 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
101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 101 def deserialize(str) begin end_point = 0 start = end_point end_point += ROS::Struct::calc_size('cS') (@status, @service,) = @@struct_cS.unpack(str[start..(end_point-1)]) return self rescue => exception raise "message DeserializationError: #{exception}" #most likely buffer underfill end end |
#has_header? ⇒ Boolean
16 17 18 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 16 def has_header? false end |
#message_definition ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 20 def "# Navigation Satellite fix status for any Global Navigation Satellite System # Whether to output an augmented fix is determined by both the fix # type and the last time differential corrections were received. A # fix is valid when status >= STATUS_FIX. int8 STATUS_NO_FIX = -1 # unable to fix position int8 STATUS_FIX = 0 # unaugmented fix int8 STATUS_SBAS_FIX = 1 # with satellite-based augmentation int8 STATUS_GBAS_FIX = 2 # with ground-based augmentation int8 status # Bits defining which Global Navigation Satellite System signals were # used by the receiver. uint16 SERVICE_GPS = 1 uint16 SERVICE_GLONASS = 2 uint16 SERVICE_COMPASS = 4 # includes BeiDou. uint16 SERVICE_GALILEO = 8 uint16 service " end |
#serialize(buff) ⇒ Object
serialize message into buffer
90 91 92 93 94 95 96 97 |
# File 'lib/sensor_msgs/NavSatStatus.rb', line 90 def serialize(buff) begin buff.write(@@struct_cS.pack(@status, @service)) rescue => exception raise "some erro in serialize: #{exception}" end end |