tm_get_adcs_est_rate.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. -- Define the dissector function for the new structure
  2. function tm_get_adcs_est_rate(buffer, pinfo, tree, adcs_est_angular_rate, offset)
  3. -- Define ProtoFields for the new structure fields
  4. local f_x_angular_rate = ProtoField.double("adcs_est_angular_rate.f_x_angular_rate", "X Angular Rate", base.DEC)
  5. local f_y_angular_rate = ProtoField.double("adcs_est_angular_rate.f_y_angular_rate", "Y Angular Rate", base.DEC)
  6. local f_z_angular_rate = ProtoField.double("adcs_est_angular_rate.f_z_angular_rate", "Z Angular Rate", base.DEC)
  7. -- Add the fields to the protocol
  8. adcs_est_angular_rate.fields = {
  9. f_x_angular_rate, f_y_angular_rate, f_z_angular_rate
  10. }
  11. local subtree = tree:add(adcs_est_angular_rate, buffer(), "ADCS ESTIMATED ANGULAR RATES")
  12. offset = offset + 4
  13. -- dissect commanded roll angle (2 bytes)
  14. local x_angular_rate = buffer(offset, 8):le_float()
  15. subtree:add(f_x_angular_rate, x_angular_rate):set_text(string.format("Rate Sensor X : %0.6f", x_angular_rate))
  16. offset = offset + 8
  17. -- dissect commanded pitch angle (2 bytes)
  18. local y_angular_rate = buffer(offset, 8):le_float()
  19. subtree:add(f_y_angular_rate, y_angular_rate):set_text(string.format("Rate Sensor Y : %0.6f", y_angular_rate))
  20. offset = offset + 8
  21. -- dissect commanded yaw angle (2 bytes)
  22. local z_angular_rate = buffer(offset, 8):le_float()
  23. subtree:add(f_z_angular_rate, z_angular_rate):set_text(string.format("Rate Sensor Z : %0.6f", z_angular_rate))
  24. offset = offset + 8
  25. end