Adjustements and improvements in the simulation interface

This commit is contained in:
Lorenz Meier
2016-04-05 19:09:30 -07:00
parent 4d27239bb2
commit 0baa625681
3 changed files with 58 additions and 12 deletions
+8
View File
@@ -165,6 +165,10 @@ static void restore_term(void)
tcsetattr(0, TCSANOW, &orig_term);
}
bool px4_exit_requested(void) {
return _ExitFlag;
}
int main(int argc, char **argv)
{
bool daemon_mode = false;
@@ -237,6 +241,10 @@ int main(int argc, char **argv)
if (infile.is_open()) {
for (string line; getline(infile, line, '\n');) {
if (px4_exit_requested()) {
break;
}
// TODO: this should be true but for that we have to check all startup files
process_line(line, false);
}
+10
View File
@@ -130,6 +130,16 @@ int px4_clock_gettime(clockid_t clk_id, struct timespec *tp)
#endif
/*
* Get system time in us
*/
unsigned long long hrt_system_time(void)
{
struct timespec ts;
px4_clock_gettime(CLOCK_MONOTONIC, &ts);
return ts_to_abstime(&ts) - px4_timestart;
}
/*
* Get absolute time.
*/