Skip to content
Snippets Groups Projects
Commit 0a0044fc authored by Daniel Agar's avatar Daniel Agar
Browse files

uORB print message add timestamp elapsed

parent f1721719
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,7 @@ topic_fields = ["uint64_t timestamp"]+["%s %s" % (convert_type(field.type), fiel
#include <cstdio>
#include <px4_defines.h>
#include <uORB/topics/@(topic_name).h>
#include <drivers/drv_hrt.h>
@# join all msg files in one line e.g: "float[3] position;float[3] velocity;bool armed"
@# This is used for the logger
......@@ -80,7 +81,7 @@ ORB_DEFINE(@multi_topic, struct @uorb_struct, @(struct_size-padding_end_size), _
void print_message(const @uorb_struct& message)
{
printf(" @(uorb_struct)\n");
printf("\ttimestamp: %" PRIu64 "\n", message.timestamp);
printf("\ttimestamp: %" PRIu64 " (%.6f seconds ago)\n", message.timestamp, hrt_elapsed_time(&message.timestamp) / 1e6);
@[for field in sorted_fields]@
@( px4_printf(field) )
@[end for]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment