Skip to content

Conversation

@jonyMarino
Copy link
Contributor

Fixes: #

About

This pull request makes a small change to the way control signals are returned in the ArduCopterApi::GetControlSignals method. Instead of copying the entire vector, it now returns a vector containing only a single control output value.

  • Changed ArduCopterApi::GetControlSignals in arducopter_api.cpp to return a vector with a single element (the mapped control output), rather than copying the entire vector.

How Has This Been Tested?

Screenshots and videos (if appropriate):

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug in the ArduCopterApi::GetControlSignals method where the vector constructor was being used incorrectly. The old code attempted to use a float value as the size parameter for the vector constructor, which would create an empty or incorrectly-sized vector. The fix aligns the implementation with other controller APIs (MavLinkApi, ManualControllerApi, MatlabControllerApi, SimpleFlightApi) by using the two-parameter vector constructor to create a single-element vector containing the control output value.

Key changes:

  • Fixed vector instantiation in GetControlSignals to use std::vector<float>(1, value) instead of std::vector<float>(value)
  • Minor whitespace adjustment at end of file

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jonyMarino jonyMarino merged commit 3f4db4b into main Dec 2, 2025
2 checks passed
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