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

Fly-By-Wire A Flightmode #33

Closed
wants to merge 10 commits into from
Closed

Conversation

antimonyB
Copy link
Contributor

Description

What was completed, changed, or updated?

Adding flightmode to attitude manager for Fly-By-Wire A.


Why was this done (if applicable)?


Testing

What manual tests were used to validate the code?


What unit tests were used to validate the code?


Documentation

Milestone number and name:

Link to Asana task:

Link to Confluence documentation:


Reminders

  • Add reviewers to the PR

  • Mention the PR in the appropriate discord channel

@antimonyB antimonyB changed the title Am/flightmode fbwa Fly-By-Wire A Flightmode Oct 18, 2023
@antimonyB antimonyB changed the base branch from main to AM/input-mapping October 18, 2023 00:47
FBWA::FBWA()
{
//Get PID tuning data from config
config::ControlTuning_t tuningData = config::flightmodes[config::FM_FBWA_IDX].tuningData;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a reasonable way to get the config data for the appropriate flightmode?


AttitudeManagerInput FBWA::run(const AttitudeManagerInput& input) {
// Get latest attitude from sensor fusion
SensorFusionOutput currentState = AttitudeManager::getSensorFusionData();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calling this here instead of receiving an argument because some flightmodes don't need sensor fusion.

if(tuningData.PIDValues.pitchPID.isEnabled)
{
output.pitch = pitchPID_->execute(targetPitch, currentState.pitch);
output.pitch = AttitudeManager::attitudeDegreesToPercent(output.pitch);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I assume AM input/output are percentages while sensor fusion output gives angles in degrees?

@antholuo
Copy link
Member

Closing as old

@antholuo antholuo closed this Apr 23, 2024
@DerekTang04 DerekTang04 deleted the AM/flightmode-FBWA branch May 6, 2024 22:10
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