Class: MAVLink::Log::SysStatus

Inherits:
Message
  • Object
show all
Defined in:
lib/mavlink/log/messages.rb

Constant Summary collapse

ID =
1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_payload) ⇒ SysStatus

Returns a new instance of SysStatus.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/mavlink/log/messages.rb', line 48

def initialize(raw_payload)
  @onboard_control_sensors_present = raw_payload[0..3].unpack('L<')[0]  #
  @onboard_control_sensors_enabled = raw_payload[4..7].unpack('L<')[0]  #
  @onboard_control_sensors_health = raw_payload[8..11].unpack('L<')[0]  #
  @load = raw_payload[12..13].unpack('S<')[0] / 10.0                    # 0%..100%
  @voltage_battery = raw_payload[14..15].unpack('S<')[0] / 1000.0       # V
  @current_battery = raw_payload[16..17].unpack('s<')[0] / 100.0        # A (-1: not measured)
  @battery_remaining = raw_payload[18].unpack('C')[0]                   # 0%..100% (-1: not measured)
  @drop_rate_comm = raw_payload[19..20].unpack('S<')[0] / 100           # 0%..100% (bad packet %age)
  @errors_comm = raw_payload[21..22].unpack('S<')[0]                    # bad packet count
  @errors_count1 = raw_payload[23..24].unpack('S<')[0]                  #
  @errors_count2 = raw_payload[25..26].unpack('S<')[0]                  #
  @errors_count3 = raw_payload[27..28].unpack('S<')[0]                  #
  @errors_count4 = raw_payload[29..30].unpack('S<')[0]                  #
end

Instance Attribute Details

#battery_remainingObject

Returns the value of attribute battery_remaining.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def battery_remaining
  @battery_remaining
end

#current_batteryObject

Returns the value of attribute current_battery.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def current_battery
  @current_battery
end

#drop_rate_commObject

Returns the value of attribute drop_rate_comm.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def drop_rate_comm
  @drop_rate_comm
end

#errors_commObject

Returns the value of attribute errors_comm.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def errors_comm
  @errors_comm
end

#errors_count1Object

Returns the value of attribute errors_count1.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def errors_count1
  @errors_count1
end

#errors_count2Object

Returns the value of attribute errors_count2.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def errors_count2
  @errors_count2
end

#errors_count3Object

Returns the value of attribute errors_count3.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def errors_count3
  @errors_count3
end

#errors_count4Object

Returns the value of attribute errors_count4.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def errors_count4
  @errors_count4
end

#loadObject

Returns the value of attribute load.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def load
  @load
end

#onboard_control_sensors_enabledObject

Returns the value of attribute onboard_control_sensors_enabled.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def onboard_control_sensors_enabled
  @onboard_control_sensors_enabled
end

#onboard_control_sensors_healthObject

Returns the value of attribute onboard_control_sensors_health.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def onboard_control_sensors_health
  @onboard_control_sensors_health
end

#onboard_control_sensors_presentObject

Returns the value of attribute onboard_control_sensors_present.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def onboard_control_sensors_present
  @onboard_control_sensors_present
end

#voltage_batteryObject

Returns the value of attribute voltage_battery.



43
44
45
# File 'lib/mavlink/log/messages.rb', line 43

def voltage_battery
  @voltage_battery
end