Skip to content
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

mavlink: include differential pressure in fields updated bit shift #9296

Merged
merged 1 commit into from
Apr 16, 2018
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
12 changes: 10 additions & 2 deletions src/modules/mavlink/mavlink_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ class MavlinkStreamHighresIMU : public MavlinkStream
uint64_t _gyro_timestamp;
uint64_t _mag_timestamp;
uint64_t _baro_timestamp;
uint64_t _dpres_timestamp;

/* do not allow top copying this class */
MavlinkStreamHighresIMU(MavlinkStreamHighresIMU &);
Expand All @@ -682,7 +683,8 @@ class MavlinkStreamHighresIMU : public MavlinkStream
_accel_timestamp(0),
_gyro_timestamp(0),
_mag_timestamp(0),
_baro_timestamp(0)
_baro_timestamp(0),
_dpres_timestamp(0)
{}

bool send(const hrt_abstime t)
Expand Down Expand Up @@ -717,7 +719,7 @@ class MavlinkStreamHighresIMU : public MavlinkStream
_air_data_sub->update(&air_data);

if (_baro_timestamp != air_data.timestamp) {
/* mark last group dimensions as changed */
/* mark fourth group (baro fields) dimensions as changed */
fields_updated |= (1 << 9) | (1 << 11) | (1 << 12);
_baro_timestamp = air_data.timestamp;
}
Expand All @@ -728,6 +730,12 @@ class MavlinkStreamHighresIMU : public MavlinkStream
differential_pressure_s differential_pressure = {};
_differential_pressure_sub->update(&differential_pressure);

if (_dpres_timestamp != differential_pressure.timestamp) {
/* mark fourth group (dpres field) dimensions as changed */
fields_updated |= (1 << 10);
_dpres_timestamp = differential_pressure.timestamp;
}

mavlink_highres_imu_t msg = {};

msg.time_usec = sensor.timestamp;
Expand Down