MCPcopy Create free account
hub / github.com/CopterExpress/clover / handleLedsMsg

Method handleLedsMsg

clover_simulation/src/sim_leds.cpp:182–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void led_controller::LedController::handleLedsMsg(const led_msgs::LEDStateArrayConstPtr& leds)
183{
184 std::lock_guard<std::mutex> lock(registryMutex);
185 for(const auto& led : leds->leds)
186 {
187 if (led.index < registeredLeds.size())
188 {
189 auto color = GazeboColor(led.r / 255.0f, led.g / 255.0f, led.b / 255.0f);
190 auto ledPlugin = registeredLeds[led.index];
191 if (ledPlugin) ledPlugin->SetColor(color);
192 }
193 }
194}
195
196GZ_REGISTER_VISUAL_PLUGIN(sim_led::LedVisualPlugin);

Callers

nothing calls this directly

Calls 1

SetColorMethod · 0.80

Tested by

no test coverage detected