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: fix json airspeed #27476

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

eppravitra
Copy link
Contributor

Airspeed calculation for JSON was not quite working because velocity_air_ef was not updated in SIM_JSON.cpp

@eppravitra eppravitra closed this Jul 6, 2024
@eppravitra eppravitra deleted the json-airspeed branch July 6, 2024 16:55
@eppravitra eppravitra restored the json-airspeed branch July 6, 2024 16:57
@eppravitra eppravitra reopened this Jul 6, 2024
@eppravitra
Copy link
Contributor Author

@tridge, Could you please take a look at this? My Gazebo simulation is not working anymore, and I think I've figured out why.

libraries/SITL/SIM_JSON.cpp Outdated Show resolved Hide resolved
libraries/SITL/SIM_JSON.cpp Outdated Show resolved Hide resolved
@eppravitra eppravitra force-pushed the json-airspeed branch 2 times, most recently from c0420d5 to 5093f4e Compare July 7, 2024 00:16
@eppravitra
Copy link
Contributor Author

Thanks for the suggestions @IamPete1. I think you are right about the changes. Could you add bug and DevCall labels to this, since Gazebo sim is broken right now?

Airspeed calculation for JSON was not quite working because velocity_air_ef was not updated in SIM_JSON.cpp

Update libraries/SITL/SIM_JSON.cpp

Co-authored-by: Peter Hall <[email protected]>
Update libraries/SITL/SIM_JSON.cpp

Co-authored-by: Peter Hall <[email protected]>

comment changes

remove redundant airspeed calculation

// airspeed
airspeed = velocity_air_bf.length();
Copy link
Contributor

Choose a reason for hiding this comment

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

I see other backends still updating these; why do we no longer need to do that here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The calculation is already done inside update_eas_airspeed(). If left as it is, the variable airspeed will be
rewritten anyway. I figure it's better to remove the line to avoid confusion.

@peterbarker
Copy link
Contributor

@IamPete1 are you OK with this now?

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@peterbarker Yeah, I think its good to merge.

@peterbarker peterbarker merged commit f3d55d8 into ArduPilot:master Jul 9, 2024
92 checks passed
@peterbarker
Copy link
Contributor

Merged, thanks!

@eppravitra
Copy link
Contributor Author

Thanks!

@eppravitra eppravitra deleted the json-airspeed branch July 10, 2024 02:00
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.

3 participants