mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 03:04:07 +08:00
Removing extra UAVCAN perfcounters
This commit is contained in:
parent
4b8feb03cf
commit
ae0e2d7209
@ -56,17 +56,12 @@ UavcanEscController::UavcanEscController(uavcan::INode &node) :
|
||||
if (_perfcnt_scaling_error == nullptr) {
|
||||
errx(1, "uavcan: couldn't allocate _perfcnt_scaling_error");
|
||||
}
|
||||
|
||||
if (_perfcnt_broadcast_elapsed == nullptr) {
|
||||
errx(1, "uavcan: couldn't allocate _perfcnt_broadcast_elapsed");
|
||||
}
|
||||
}
|
||||
|
||||
UavcanEscController::~UavcanEscController()
|
||||
{
|
||||
perf_free(_perfcnt_invalid_input);
|
||||
perf_free(_perfcnt_scaling_error);
|
||||
perf_free(_perfcnt_broadcast_elapsed);
|
||||
}
|
||||
|
||||
int UavcanEscController::init()
|
||||
@ -141,9 +136,7 @@ void UavcanEscController::update_outputs(float *outputs, unsigned num_outputs)
|
||||
* Publish the command message to the bus
|
||||
* Note that for a quadrotor it takes one CAN frame
|
||||
*/
|
||||
perf_begin(_perfcnt_broadcast_elapsed);
|
||||
(void)_uavcan_pub_raw_cmd.broadcast(msg);
|
||||
perf_end(_perfcnt_broadcast_elapsed);
|
||||
}
|
||||
|
||||
void UavcanEscController::arm_all_escs(bool arm)
|
||||
|
||||
@ -109,5 +109,4 @@ private:
|
||||
*/
|
||||
perf_counter_t _perfcnt_invalid_input = perf_alloc(PC_COUNT, "uavcan_esc_invalid_input");
|
||||
perf_counter_t _perfcnt_scaling_error = perf_alloc(PC_COUNT, "uavcan_esc_scaling_error");
|
||||
perf_counter_t _perfcnt_broadcast_elapsed = perf_alloc(PC_ELAPSED, "uavcan_esc_broadcast_elapsed");
|
||||
};
|
||||
|
||||
@ -93,10 +93,6 @@ UavcanNode::UavcanNode(uavcan::ICanDriver &can_driver, uavcan::ISystemClock &sys
|
||||
if (_perfcnt_esc_mixer_total_elapsed == nullptr) {
|
||||
errx(1, "uavcan: couldn't allocate _perfcnt_esc_mixer_total_elapsed");
|
||||
}
|
||||
|
||||
if (_perfcnt_esc_mixer_subscriptions == nullptr) {
|
||||
errx(1, "uavcan: couldn't allocate _perfcnt_esc_mixer_subscriptions");
|
||||
}
|
||||
}
|
||||
|
||||
UavcanNode::~UavcanNode()
|
||||
@ -138,7 +134,6 @@ UavcanNode::~UavcanNode()
|
||||
perf_free(_perfcnt_node_spin_elapsed);
|
||||
perf_free(_perfcnt_esc_mixer_output_elapsed);
|
||||
perf_free(_perfcnt_esc_mixer_total_elapsed);
|
||||
perf_free(_perfcnt_esc_mixer_subscriptions);
|
||||
}
|
||||
|
||||
int UavcanNode::start(uavcan::NodeID node_id, uint32_t bitrate)
|
||||
@ -527,7 +522,6 @@ UavcanNode::arm_actuators(bool arm)
|
||||
void
|
||||
UavcanNode::subscribe()
|
||||
{
|
||||
perf_count(_perfcnt_esc_mixer_subscriptions);
|
||||
// Subscribe/unsubscribe to required actuator control groups
|
||||
uint32_t sub_groups = _groups_required & ~_groups_subscribed;
|
||||
uint32_t unsub_groups = _groups_subscribed & ~_groups_required;
|
||||
|
||||
@ -146,5 +146,4 @@ private:
|
||||
perf_counter_t _perfcnt_node_spin_elapsed = perf_alloc(PC_ELAPSED, "uavcan_node_spin_elapsed");
|
||||
perf_counter_t _perfcnt_esc_mixer_output_elapsed = perf_alloc(PC_ELAPSED, "uavcan_esc_mixer_output_elapsed");
|
||||
perf_counter_t _perfcnt_esc_mixer_total_elapsed = perf_alloc(PC_ELAPSED, "uavcan_esc_mixer_total_elapsed");
|
||||
perf_counter_t _perfcnt_esc_mixer_subscriptions = perf_alloc(PC_COUNT, "uavcan_esc_mixer_subscriptions");
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user