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

CAN: support sending actuators as PWM #21702

Merged
merged 3 commits into from Sep 13, 2022
Merged

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Sep 12, 2022

This makes debugging CAN servo setups easier
image

{
#if HAL_PWM_COUNT > 0
const SRV_Channel::Aux_servo_function_t function = SRV_Channel::Aux_servo_function_t(SRV_Channel::k_rcin1 + actuator_id - 1);
SRV_Channels::set_output_pwm(function, uint16_t(command_value+0.5));
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the magic 0.5 for?

Copy link
Member

Choose a reason for hiding this comment

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

Rounding float to int I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep

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

@tridge tridge merged commit 18e8c2d into ArduPilot:master Sep 13, 2022
@tridge tridge added this to Pending in Plane 4.3 Oct 1, 2022
@tridge tridge moved this from Pending to Merged in Plane 4.3 Oct 1, 2022
@rmackay9 rmackay9 added this to 4.3.0-beta2 in Copter 4.3 Oct 4, 2022
@tridge tridge moved this from beta1 to beta2 in Plane 4.3 Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AP_Periph WikiNeeded needs wiki update
Projects
Copter 4.3
4.3.0-beta2
Development

Successfully merging this pull request may close these issues.

None yet

5 participants