Added a self test feature to the VOXL 2 muorb module (#20307)

* Removed exit after dsp signature generation.
* First full test suite
* Cleaned up the muorb tests
* Improved VOXL 2 self test trigger in startup file
* Removed unneeded include file
This commit is contained in:
Eric Katzfey
2022-09-26 13:25:24 -07:00
committed by GitHub
parent 7bc79b491f
commit a5bfc3fbc2
11 changed files with 309 additions and 22 deletions
+8 -12
View File
@@ -38,7 +38,7 @@ extern "C" { __EXPORT int muorb_main(int argc, char *argv[]); }
static void usage()
{
PX4_INFO("Usage: muorb 'start', 'stop', 'status'");
PX4_INFO("Usage: muorb 'start', 'test', 'stop', 'status'");
}
static bool enable_debug = false;
@@ -53,19 +53,15 @@ muorb_main(int argc, char *argv[])
// TODO: Add an optional start parameter to control debug messages
if (!strcmp(argv[1], "start")) {
if (uORB::AppsProtobufChannel::isInstance()) {
PX4_WARN("muorb already started");
// Register the protobuf channel with UORB.
uORB::AppsProtobufChannel *channel = uORB::AppsProtobufChannel::GetInstance();
} else {
// Register the protobuf channel with UORB.
uORB::AppsProtobufChannel *channel = uORB::AppsProtobufChannel::GetInstance();
if (channel && channel->Initialize(enable_debug)) { return OK; }
if (channel) {
if (channel->Initialize(enable_debug)) {
return OK;
}
}
}
} else if (!strcmp(argv[1], "test")) {
uORB::AppsProtobufChannel *channel = uORB::AppsProtobufChannel::GetInstance();
if (channel && channel->Initialize(enable_debug) && channel->Test()) { return OK; }
} else if (!strcmp(argv[1], "stop")) {
if (uORB::AppsProtobufChannel::isInstance() == false) {