Skip to content

Commit 322b170

Browse files
committed
added error message if canned mixer is used but USE_MOTOR_PARAM is set true
1 parent cacbf2c commit 322b170

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/mixer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,18 @@ void Mixer::init_mixing()
247247
RF_.comm_manager_.log(CommLinkInterface::LogSeverity::LOG_INFO,
248248
"Inverting selected mixing matrix...");
249249
primary_mixer_ = invert_mixer(array_of_mixers_[mixer_choice]);
250+
251+
// If using a canned mixer but the USE_MOTOR_PARAM is set to 1 (true), raise a warning.
252+
// Motor parameters (thus motor speed/voltage calculations) should not be used with the canned
253+
// mixers, since the output will be vanishingly small. Check online documentation for more
254+
// information.
255+
if (!(RF_.params_.get_param_int(PARAM_USE_MOTOR_PARAMETERS) == 0)) {
256+
RF_.comm_manager_.log(CommLinkInterface::LogSeverity::LOG_WARNING,
257+
("USE_MOTOR_PARAM=1, but PRIMARY_MIXER=" + std::to_string(static_cast<unsigned int>(mixer_choice)) + ", which").c_str());
258+
RF_.comm_manager_.log(CommLinkInterface::LogSeverity::LOG_WARNING,
259+
"may cause issues (check docs). Is this correct?");
260+
}
261+
250262
} else {
251263
// Don't invert the fixedwing mixers
252264
primary_mixer_ = *array_of_mixers_[mixer_choice];

0 commit comments

Comments
 (0)