mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 13:23:33 +08:00
simulator: Add output so user knows that the simulator / system is waiting for data
This commit is contained in:
@@ -128,6 +128,7 @@ int Simulator::start(int argc, char *argv[])
|
|||||||
PX4_WARN("Simulator creation failed");
|
PX4_WARN("Simulator creation failed");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -400,6 +400,7 @@ void Simulator::pollForMAVLinkMessages(bool publish)
|
|||||||
// wait for first data from simulator and respond with first controls
|
// wait for first data from simulator and respond with first controls
|
||||||
// this is important for the UDP communication to work
|
// this is important for the UDP communication to work
|
||||||
int pret = -1;
|
int pret = -1;
|
||||||
|
PX4_WARN("Waiting for initial data on UDP.. Please connect the simulator first.");
|
||||||
while (pret <= 0) {
|
while (pret <= 0) {
|
||||||
pret = ::poll(&fds[0], (sizeof(fds[0])/sizeof(fds[0])), 100);
|
pret = ::poll(&fds[0], (sizeof(fds[0])/sizeof(fds[0])), 100);
|
||||||
}
|
}
|
||||||
@@ -535,9 +536,9 @@ int openUart(const char *uart_name, int baud)
|
|||||||
|
|
||||||
/* Try to set baud rate */
|
/* Try to set baud rate */
|
||||||
struct termios uart_config;
|
struct termios uart_config;
|
||||||
memset(&uart_config, 0, sizeof(uart_config));
|
memset(&uart_config, 0, sizeof(uart_config));
|
||||||
|
|
||||||
int termios_state;
|
int termios_state;
|
||||||
|
|
||||||
/* Back up the original uart configuration to restore it after exit */
|
/* Back up the original uart configuration to restore it after exit */
|
||||||
if ((termios_state = tcgetattr(uart_fd, &uart_config)) < 0) {
|
if ((termios_state = tcgetattr(uart_fd, &uart_config)) < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user