Skip to content

Conversation

dayjaby
Copy link
Contributor

@dayjaby dayjaby commented Mar 1, 2020

Describe problem solved by this pull request
mavros expects SCALED_PRESSURE at the moment to send the barometer temperature. With this PR, PX4 is able to send SCALED_PRESSURE/SCALED_PRESSURE2/SCALED_PRESSURE3.

Describe your solution
We subscribe directly to sensor_baro and forward the absolute pressure and temperature.

Describe possible alternatives
The template can be removed if SCALED_PRESSURE would contain a sensor index, similar to mavlink/rfcs#13.

Test data / coverage

make px4_sitl_default gazebo_standard_vtol
mavlink stream -u 18570 -s SCALED_PRESSURE -r 50

image

@dagar
Copy link
Member

dagar commented Mar 2, 2020

The change looks good, it's just pushing px4_fmu-v2 over the flash limit. Let me see what we can do.

@dagar dagar self-requested a review March 2, 2020 18:28
@dayjaby
Copy link
Contributor Author

dayjaby commented Mar 2, 2020

The change looks good, it's just pushing px4_fmu-v2 over the flash limit. Let me see what we can do.

With the new commit, I could reduce the size a bit by adding a constexpr qualifier to get_name_static and get_id_static. I also commented out SCALED_PRESSURE2 and SCALED_PRESSURE3, as my goal at the moment is to get the barometric temperature via mavros which needs only SCALED_PRESSURE. They can easily be added later.

Before this PR:

Memory region         Used Size  Region Size  %age Used
           flash:     1656085 B      2032 KB     79.59%
            sram:       31796 B       192 KB     16.17%
          ccsram:          0 GB        64 KB      0.00%

Without the latest commit:

Memory region         Used Size  Region Size  %age Used
           flash:     1656277 B      2032 KB     79.60%
            sram:       31796 B       192 KB     16.17%
          ccsram:          0 GB        64 KB      0.00%

With the latest commit:

Memory region         Used Size  Region Size  %age Used
           flash:     1655621 B      2032 KB     79.57%
            sram:       31796 B       192 KB     16.17%
          ccsram:          0 GB        64 KB      0.00%

and constexpr for get_id_static and get_name_static in mavlink streams
@dayjaby dayjaby force-pushed the pr-mavlink_stream_scaled_pressure branch from 1429713 to b7da78e Compare March 2, 2020 21:56
@dagar
Copy link
Member

dagar commented Mar 2, 2020

Nice one! Looks like it now more than pays for itself on fmu-v2.

@dagar dagar merged commit ff4ec31 into PX4:master Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants