mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 05:13:34 +08:00
Merge remote-tracking branch 'upstream/master' into dev_ros
Conflicts: src/lib/mathlib/math/Matrix.hpp src/modules/mc_att_control/mc_att_control_main.cpp src/modules/uORB/topics/vehicle_status.h src/platforms/px4_includes.h
This commit is contained in:
@@ -66,20 +66,18 @@ nshterm_main(int argc, char *argv[])
|
||||
int fd = -1;
|
||||
int armed_fd = orb_subscribe(ORB_ID(actuator_armed));
|
||||
struct actuator_armed_s armed;
|
||||
/* we assume the system does not provide arming status feedback */
|
||||
bool armed_updated = false;
|
||||
|
||||
/* try the first 30 seconds or if arming system is ready */
|
||||
while ((retries < 300) || armed_updated) {
|
||||
/* try to bring up the console - stop doing so if the system gets armed */
|
||||
while (true) {
|
||||
|
||||
/* abort if an arming topic is published and system is armed */
|
||||
bool updated = false;
|
||||
if (orb_check(armed_fd, &updated)) {
|
||||
orb_check(armed_fd, &updated);
|
||||
if (updated) {
|
||||
/* the system is now providing arming status feedback.
|
||||
* instead of timing out, we resort to abort bringing
|
||||
* up the terminal.
|
||||
*/
|
||||
armed_updated = true;
|
||||
orb_copy(ORB_ID(actuator_armed), armed_fd, &armed);
|
||||
|
||||
if (armed.armed) {
|
||||
@@ -92,6 +90,7 @@ nshterm_main(int argc, char *argv[])
|
||||
/* which may not be ready immediately. */
|
||||
fd = open(argv[1], O_RDWR);
|
||||
if (fd != -1) {
|
||||
close(armed_fd);
|
||||
break;
|
||||
}
|
||||
usleep(100000);
|
||||
@@ -116,7 +115,7 @@ nshterm_main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Set ONLCR flag (which appends a CR for every LF) */
|
||||
uart_config.c_oflag |= (ONLCR | OPOST/* | OCRNL*/);
|
||||
uart_config.c_oflag |= (ONLCR | OPOST);
|
||||
|
||||
if ((termios_state = tcsetattr(fd, TCSANOW, &uart_config)) < 0) {
|
||||
warnx("ERR set config %s\n", argv[1]);
|
||||
|
||||
@@ -35,5 +35,5 @@ SRCS = test_adc.c \
|
||||
test_mount.c \
|
||||
test_mtd.c
|
||||
|
||||
EXTRACXXFLAGS = -Wframe-larger-than=2500
|
||||
EXTRACXXFLAGS = -Wframe-larger-than=2500 -Wno-float-equal -Wno-double-promotion
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ using namespace math;
|
||||
|
||||
int test_mathlib(int argc, char *argv[])
|
||||
{
|
||||
int rc = 0;
|
||||
warnx("testing mathlib");
|
||||
|
||||
{
|
||||
@@ -156,5 +157,53 @@ int test_mathlib(int argc, char *argv[])
|
||||
TEST_OP("Matrix<10, 10> * Matrix<10, 10>", m1 * m2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
{
|
||||
// test nonsymmetric +, -, +=, -=
|
||||
|
||||
float data1[2][3] = {{1,2,3},{4,5,6}};
|
||||
float data2[2][3] = {{2,4,6},{8,10,12}};
|
||||
float data3[2][3] = {{3,6,9},{12,15,18}};
|
||||
|
||||
Matrix<2, 3> m1(data1);
|
||||
Matrix<2, 3> m2(data2);
|
||||
Matrix<2, 3> m3(data3);
|
||||
|
||||
if (m1 + m2 != m3) {
|
||||
warnx("Matrix<2, 3> + Matrix<2, 3> failed!");
|
||||
(m1 + m2).print();
|
||||
printf("!=\n");
|
||||
m3.print();
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
if (m3 - m2 != m1) {
|
||||
warnx("Matrix<2, 3> - Matrix<2, 3> failed!");
|
||||
(m3 - m2).print();
|
||||
printf("!=\n");
|
||||
m1.print();
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
m1 += m2;
|
||||
if (m1 != m3) {
|
||||
warnx("Matrix<2, 3> += Matrix<2, 3> failed!");
|
||||
m1.print();
|
||||
printf("!=\n");
|
||||
m3.print();
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
m1 -= m2;
|
||||
Matrix<2, 3> m1_orig(data1);
|
||||
if (m1 != m1_orig) {
|
||||
warnx("Matrix<2, 3> -= Matrix<2, 3> failed!");
|
||||
m1.print();
|
||||
printf("!=\n");
|
||||
m1_orig.print();
|
||||
rc = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user