Skip to content

Commit 14fc11d

Browse files
committed
esc_telemetry.cpp: Remove the limits class and dynamically create multiple ESC instances
1 parent 03fdc99 commit 14fc11d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mavros_extras/src/plugins/esc_telemetry.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,14 @@ struct Limits {
113113
}
114114
};
115115

116-
class ESCDiag //: public diagnostic_updater::DiagnosticTask
116+
class ESCDiag : public diagnostic_updater::DiagnosticTask
117117
{
118118
public:
119-
ESCDiag(const std::string& name, const Limits& lim_):
120-
//diagnostic_updater::DiagnosticTask(name),
121-
lim(lim_)
119+
ESCDiag(const std::string& name):
120+
diagnostic_updater::DiagnosticTask(name)
122121
{}
123122

124-
const Limits& lim;
123+
void run(diagnostic_updater::DiagnosticStatusWrapper &stat) override {};
125124
};
126125

127126
/**
@@ -266,7 +265,7 @@ class ESCTelemetryPlugin : public plugin::PluginBase
266265
}
267266
ROS_INFO("%d ESCs detected", _esc_count);
268267
for (uint i = 0; i < _esc_count; ++i) {
269-
v.emplace_back(utils::format("ESC%u", i), *lim);
268+
v.emplace_back(utils::format("ESC%u", i));
270269
}
271270
}
272271

0 commit comments

Comments
 (0)