Skip to content

Display hygrometer message #2682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ExtLibs/ArduPilot/CurrentState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,18 @@ public float groundspeed
[GroupText("Sensor")]
public float magfield3 => (float)Math.Sqrt(Math.Pow(mx3, 2) + Math.Pow(my3, 2) + Math.Pow(mz3, 2));

// hygrometer
[DisplayText("hygrotemp (cdegC)")]
[GroupText("Sensor")]
public short hygrotemp { get; set; }

[DisplayText("hygrohumi (c%)")]
[GroupText("Sensor")]
public ushort hygrohumi { get; set; }

[GroupText("Sensor")]
public byte hygro_id { get; set; }

//radio
[GroupText("RadioIn")] public float ch1in { get; set; }

Expand Down Expand Up @@ -3186,6 +3198,17 @@ private void Parent_OnPacketReceived(object sender, MAVLink.MAVLinkMessage mavLi
pidachieved = pid.achieved;
}

break;
case (uint)MAVLink.MAVLINK_MSG_ID.HYGROMETER_SENSOR:

{
var hygrometer = mavLinkMessage.ToStructure<MAVLink.mavlink_hygrometer_sensor_t>();

hygrotemp = hygrometer.temperature;
hygrohumi = hygrometer.humidity;
hygro_id = hygrometer.id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is id an index? might need to better filter this if more than one sensor is onboard

Copy link
Contributor Author

@gitfishup gitfishup Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is id an index? might need to better filter this if more than one sensor is onboard

Yes.But how to filter it? Can you give me an example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is id defined? is it a can param?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this ID uses the CAN ID.

}

break;
case (uint)MAVLink.MAVLINK_MSG_ID.VFR_HUD:

Expand Down