Compare commits

...

1 Commits

Author SHA1 Message Date
Niklas Hauser 4ff589b5a6 [uavcan] Fix unitless actuator range conversion
Input [1000us, 2000us] -> [-1, 1] output.
2025-05-28 11:17:11 +02:00
+1 -1
View File
@@ -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);
}