Skip to content
Snippets Groups Projects
Commit bf0b3c15 authored by Lorenz Meier's avatar Lorenz Meier
Browse files

More complete ESC feedback, ensure to include a timestamp

parent 34c0d3e9
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
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