mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
[uavcan] Fix unitless actuator range conversion
Input [1000us, 2000us] -> [-1, 1] output.
This commit is contained in:
parent
38bcc50127
commit
4ff589b5a6
@ -53,7 +53,7 @@ UavcanServoController::update_outputs(bool stop_motors, uint16_t outputs[MAX_ACT
|
||||
uavcan::equipment::actuator::Command cmd;
|
||||
cmd.actuator_id = i;
|
||||
cmd.command_type = uavcan::equipment::actuator::Command::COMMAND_TYPE_UNITLESS;
|
||||
cmd.command_value = (float)outputs[i] / 500.f - 1.f; // [-1, 1]
|
||||
cmd.command_value = (float)outputs[i] / 500.f - 3.f; // [1000, 2000] -> [-1, 1]
|
||||
|
||||
msg.commands.push_back(cmd);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user