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

SITL: Document Airspeed Params #25005

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

antholuo
Copy link
Contributor

Unsure how to document ARSPD2 Params

Tools/autotest/common.py Outdated Show resolved Hide resolved
@@ -475,9 +475,28 @@ const AP_Param::GroupInfo SIM::AirspeedParm::var_info[] = {
// @Values: 0:Disabled, 1:Enabled
// @User: Advanced
AP_GROUPINFO("FAIL", 3, SIM::AirspeedParm, fail, 0),
// @Param: ARSPD_FAILP
Copy link
Member

Choose a reason for hiding this comment

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

The prefix is in the wrong spot, This should just be FAILP. The one level up where these are included you add the prefix. Like gripper for example.

// @Group: GRPE_
// @Path: ./SIM_Gripper_EPM.cpp
AP_SUBGROUPINFO(gripper_epm_sim, "GRPE_", 24, SIM, Gripper_EPM),

Then the documentation should work for both airspeed 1 and 2.

@antholuo antholuo force-pushed the aluo/doc/SITL_Params branch 3 times, most recently from d858a2e to e264cfe Compare September 16, 2023 17:36
libraries/SITL/SITL.cpp Outdated Show resolved Hide resolved
@@ -432,8 +439,10 @@ const AP_Param::GroupInfo SIM::var_info3[] = {
// @User: Advanced
AP_GROUPINFO("UART_LOSS", 42, SIM, uart_byte_loss_pct, 0),

// @Group: ARPSD_
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// @Group: ARPSD_
// @Group: ARSPD_

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

OK, so the parser isn't coping with the setup for these parameters, and I don't think it will be easy to make it do so.

It believes that anything that looks like a parameter or group in this file is at the same level. So here we get SIM_PITOT, SIM_FAILP etc etc. The ARSPD group parameter declaration comment is missing @Path, and we can't specify "this file" in there as that's infinite recursion. It's the @path and recursion thing which would tack on ARSPD_ to the parameter name base to get SIM_ARSPD_FAILP.

Easiest fix is to move the definition of const AP_Param::GroupInfo SIM::AirspeedParm::var_info[] = { into a SITL_airspeed.cpp into AP_HAL_SITL/sitl_airspeed.cpp - and I don't think that's a terrible thing. Then just add @Path to point to that file.

@peterbarker peterbarker merged commit 6958316 into ArduPilot:master Oct 4, 2023
84 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants