mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 19:13:35 +08:00
logger: introduce optional topics
The current practice of adding topics to the default set isn't scalable, as it affects all setups. By making sure topics are advertised on init, logger can just discard topics that don't exist. This does not work for all topics, so topics are specifically marked as optional. It can be extended to more topics later on though. This reduces the list of topics by ~35 on a pixracer configured as quad, and reduces RAM usage by ~1KB.
This commit is contained in:
@@ -99,6 +99,7 @@ CameraCapture::CameraCapture() :
|
||||
}
|
||||
}
|
||||
|
||||
_trigger_pub.advertise();
|
||||
}
|
||||
|
||||
CameraCapture::~CameraCapture()
|
||||
|
||||
@@ -264,6 +264,8 @@ void DShot::init_telemetry(const char *device)
|
||||
}
|
||||
}
|
||||
|
||||
_telemetry->esc_status_pub.advertise();
|
||||
|
||||
int ret = _telemetry->handler.init(device);
|
||||
|
||||
if (ret != 0) {
|
||||
|
||||
@@ -538,6 +538,8 @@ int PX4IO::init()
|
||||
_mixing_output.setMaxTopicUpdateRate(MIN_TOPIC_UPDATE_INTERVAL);
|
||||
}
|
||||
|
||||
_px4io_status_pub.advertise();
|
||||
|
||||
update_params();
|
||||
|
||||
ScheduleNow();
|
||||
|
||||
@@ -57,6 +57,8 @@ int PCF8583::init()
|
||||
// start measurement
|
||||
resetCounter();
|
||||
|
||||
_rpm_pub.advertise();
|
||||
|
||||
ScheduleOnInterval(_param_pcf8583_pool.get());
|
||||
|
||||
return PX4_OK;
|
||||
|
||||
@@ -72,6 +72,7 @@ UavcanEscController::init()
|
||||
// ESC status will be relayed from UAVCAN bus into ORB at this rate
|
||||
_orb_timer.setCallback(TimerCbBinder(this, &UavcanEscController::orb_pub_timer_cb));
|
||||
_orb_timer.startPeriodic(uavcan::MonotonicDuration::fromMSec(1000 / ESC_STATUS_UPDATE_RATE_HZ));
|
||||
_esc_status_pub.advertise();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user