Skip to content

Commit d99d41f

Browse files
committed
Modified the plugin start/stop order, moving the sensors last
1 parent bbac22e commit d99d41f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

fuse_optimizers/src/fixed_lag_smoother.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ void FixedLagSmoother::processQueue(fuse_core::Transaction& transaction, const r
438438

439439
bool FixedLagSmoother::resetServiceCallback(std_srvs::Empty::Request&, std_srvs::Empty::Response&)
440440
{
441+
ROS_INFO_STREAM("Resetting optimizer.");
441442
stop();
442443
start();
443444

@@ -469,7 +470,7 @@ void FixedLagSmoother::start()
469470
startPlugins();
470471
// Test for auto-start
471472
autostart();
472-
ROS_INFO_STREAM("Starting optimizer complete.");
473+
ROS_INFO_STREAM("Started optimizer.");
473474
}
474475

475476
void FixedLagSmoother::stop()
@@ -501,7 +502,7 @@ void FixedLagSmoother::stop()
501502
timestamp_tracking_.clear();
502503
lag_expiration_ = ros::Time(0, 0);
503504
}
504-
ROS_INFO_STREAM("Optimizer stopping complete.");
505+
ROS_INFO_STREAM("Stopped Optimizer.");
505506
}
506507

507508
void FixedLagSmoother::transactionCallback(

fuse_optimizers/src/optimizer.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ void Optimizer::clearCallbacks()
437437

438438
void Optimizer::startPlugins()
439439
{
440+
for (const auto& name_plugin : publishers_)
441+
{
442+
name_plugin.second->start();
443+
}
440444
for (const auto& name_plugin : motion_models_)
441445
{
442446
name_plugin.second->start();
@@ -445,20 +449,12 @@ void Optimizer::startPlugins()
445449
{
446450
name_plugin.second.model->start();
447451
}
448-
for (const auto& name_plugin : publishers_)
449-
{
450-
name_plugin.second->start();
451-
}
452452

453453
diagnostic_updater_.force_update();
454454
}
455455

456456
void Optimizer::stopPlugins()
457457
{
458-
for (const auto& name_plugin : publishers_)
459-
{
460-
name_plugin.second->stop();
461-
}
462458
for (const auto& name_plugin : sensor_models_)
463459
{
464460
name_plugin.second.model->stop();
@@ -467,6 +463,10 @@ void Optimizer::stopPlugins()
467463
{
468464
name_plugin.second->stop();
469465
}
466+
for (const auto& name_plugin : publishers_)
467+
{
468+
name_plugin.second->stop();
469+
}
470470

471471
diagnostic_updater_.force_update();
472472
}

0 commit comments

Comments
 (0)