From bf0b3c15857f6d9624d9aef5ac569e124d95796d Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 23 Jun 2016 18:39:16 +0200 Subject: [PATCH] More complete ESC feedback, ensure to include a timestamp --- src/drivers/tap_esc/tap_esc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/tap_esc/tap_esc.cpp b/src/drivers/tap_esc/tap_esc.cpp index e4b724bdc3..397dcdd1e5 100644 --- a/src/drivers/tap_esc/tap_esc.cpp +++ b/src/drivers/tap_esc/tap_esc.cpp @@ -155,6 +155,7 @@ TAP_ESC::TAP_ESC(): _outputs_pub(nullptr), _control_subs{ -1}, _esc_feedback_pub(nullptr), + _esc_feedback{}, _mixers(nullptr), _groups_required(0), _groups_subscribed(0), @@ -599,6 +600,7 @@ TAP_ESC::cycle() _esc_feedback.esc[feed_back_data.ESC_ID].esc_rpm = feed_back_data.speed; _esc_feedback.esc[feed_back_data.ESC_ID].esc_voltage = feed_back_data.voltage; _esc_feedback.esc[feed_back_data.ESC_ID].esc_state = feed_back_data.ESC_STATUS; + _esc_feedback.esc[feed_back_data.ESC_ID].esc_vendor = esc_status_s::ESC_VENDOR_TAP; // printf("vol is %d\n",feed_back_data.voltage ); // printf("speed is %d\n",feed_back_data.speed ); @@ -606,6 +608,8 @@ TAP_ESC::cycle() _esc_feedback.counter++; _esc_feedback.esc_count = esc_count; + _esc_feedback.timestamp = hrt_absolute_time(); + orb_publish(ORB_ID(esc_status), _esc_feedback_pub, &_esc_feedback); } }