-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Update modalai fcv2 board support for 1.14 #21653
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ icm42688p -s -b 1 -R 12 start | |
# Internal SPI2 ICM-42688 | ||
icm42688p -s -b 2 -R 12 start | ||
|
||
# Internal I2C mag | ||
bmm150 -I start | ||
# Don't start Internal I2C mag | ||
# bmm150 -I start | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was the internal mag dropped? If nothing else it's useful having it to properly orient the external mag. The common modules from holybro and mro both use an ist8310, but it's mounted differently and we have no way to detect, so doing it at calibration time (relative to an internal) was the least bad option. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I seem to remember that it was giving us some grief but I don't remember exactly what that was so I'll ask around and see what the specific issue was. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the flight test team just said that it was super noisy? Perhaps the idea is that you enable it but set SYS_HAS_MAG and MAG_TYPE parameters to not use it unless you have a secondary unit and then you just use the internal one for reference? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is internal mag used on Pixhawks in general? Just as a reference or as the actual primary source? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how having the internal one enabled helps the calibration figure out the orientation. I just tried calibrating the external compass with and without the internal one enabled and in neither case did it determine the proper rotation of the external compass. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per our discussion I will leave this disabled for now |
||
|
||
# Internal I2C baro | ||
icp201xx -I start |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#include <px4_platform_common/module.h> | ||
|
||
#include "chip.h" | ||
#include "stm32_gpio.h" | ||
#include "board_config.h" | ||
|
||
#include <nuttx/board.h> | ||
#include <arch/board/board.h> | ||
|
||
// v2 | ||
#ifdef CONFIG_ARCH_CHIP_STM32H753II // chip on M0087 | ||
#include "modalai_fc-v2.h" | ||
#define MODALAI_FC_V2 1 | ||
#else | ||
#include "modalai_fc-v1.h" | ||
#endif | ||
|
||
__EXPORT int modalai_main(int argc, char *argv[]); | ||
|
||
int modalai_main(int argc, char *argv[]) | ||
{ | ||
int hw_rev = board_get_hw_revision(); | ||
int hw_ver = board_get_hw_version(); | ||
|
||
eHW_TYPE hw_type = eHwNone; | ||
|
||
#ifdef MODALAI_FC_V2 | ||
|
||
if (hw_rev == 0 && hw_ver == 3) { // (should be hw_rev == 1 && hw_ver == 3) eventually... | ||
hw_type = eM0087; | ||
|
||
} else if (hw_rev == 0 && hw_ver == 3) { | ||
hw_type = eM0079; | ||
|
||
} else { | ||
return -1; | ||
|
||
} | ||
|
||
#else | ||
|
||
if (hw_rev == 6 && hw_ver == 0) { | ||
hw_type = eM0018; | ||
|
||
} else if (hw_rev == 0 && hw_ver == 1) { | ||
hw_type = eM0019; | ||
|
||
} else if (hw_rev == 0 && hw_ver == 2) { | ||
hw_type = eM0051; | ||
|
||
} else { | ||
return -1; | ||
|
||
} | ||
|
||
#endif | ||
|
||
if (argc <= 1) { | ||
#ifdef MODALAI_FC_V2 | ||
modalai_print_usage_v2(); | ||
#else | ||
modalai_print_usage_v1(); | ||
#endif | ||
return 1; | ||
} | ||
|
||
if (!strcmp(argv[1], "led")) { | ||
#ifdef MODALAI_FC_V2 | ||
return modalai_led_test_v2(); | ||
#else | ||
return modalai_led_test_v1(); | ||
#endif | ||
|
||
} else if (!strcmp(argv[1], "con")) { | ||
if (argc <= 2) { | ||
PRINT_MODULE_USAGE_COMMAND("con"); | ||
PRINT_MODULE_USAGE_ARG("<1,4,5,6,7,9,10,12,13>", "Connector ID", false); | ||
PRINT_MODULE_USAGE_ARG("<uint>", "Pin Number", false); | ||
PRINT_MODULE_USAGE_ARG("0 | 1", "<output state> (defaults to 0)", false); | ||
return 1; | ||
} | ||
|
||
uint8_t con = 0; | ||
uint8_t pin = 0; | ||
bool state = false; | ||
|
||
if (argc > 2) { | ||
con = atoi(argv[2]); | ||
} | ||
|
||
if (argc > 3) { | ||
pin = atoi(argv[3]); | ||
} | ||
|
||
if (argc > 4) { | ||
state = atoi(argv[4]); | ||
} | ||
|
||
#ifdef MODALAI_FC_V2 | ||
return modalai_con_gpio_test_v2(con, pin, state); | ||
#else | ||
return modalai_con_gpio_test_v1(con, pin, state); | ||
#endif | ||
|
||
} else if (!strcmp(argv[1], "buzz")) { | ||
|
||
#ifdef MODALAI_FC_V2 | ||
return modalai_buzz_test_v2(hw_type); | ||
#else | ||
return modalai_buzz_test_v1(hw_type); | ||
#endif | ||
|
||
|
||
|
||
} else if (!strcmp(argv[1], "detect")) { | ||
#ifdef MODALAI_FC_V2 | ||
modalai_hw_detect_v2(hw_type); | ||
#else | ||
modalai_hw_detect_v1(hw_type); | ||
#endif | ||
|
||
return 0; | ||
} | ||
|
||
#ifdef MODALAI_FC_V2 | ||
modalai_print_usage_v2(); | ||
#else | ||
modalai_print_usage_v1(); | ||
#endif | ||
return -EINVAL; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would try to keep uavcan by default, there's actually a fair amount of usage and it's growing. I can suggest other modules to skip if flash is the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I need to remove some things so that it fits in flash. UAVCAN takes up a lot of room. But if you have other choices that are better I would love to hear them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added those back in and removed local position estimator and attitude estimator Q