LedPlugin.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17
18#ifndef GAZEBO_PLUGINS_LEDPLUGIN_HH_
19#define GAZEBO_PLUGINS_LEDPLUGIN_HH_
20
21#include <memory>
22
24#include "gazebo/physics/physics.hh"
25
26#include "FlashLightPlugin.hh"
27
28namespace gazebo
29{
30 // forward declaration
31 class LedSettingPrivate;
32
34 class GZ_PLUGIN_VISIBLE LedSetting: public FlashLightSetting
35 {
37 public: LedSetting(
38 const sdf::ElementPtr &_sdf,
39 const physics::ModelPtr &_model,
40 const common::Time &_currentTime);
41
43 public: virtual ~LedSetting();
44
47 public: virtual void InitPubVisual(
48 const transport::PublisherPtr &_pubVisual) final;
49
50 // Documentation inherited.
51 protected: virtual void Flash();
52
53 // Documentation inherited.
54 protected: virtual void Dim();
55
57 private: std::unique_ptr<LedSettingPrivate> dataPtr;
58 };
59
60 // forward declaration
61 class LedPluginPrivate;
62
101 class GZ_PLUGIN_VISIBLE LedPlugin : public FlashLightPlugin
102 {
104 public: LedPlugin();
105
107 public: virtual ~LedPlugin();
108
109 // Documentation inherited.
110 protected: virtual std::shared_ptr<FlashLightSetting> CreateSetting(
111 const sdf::ElementPtr &_sdf,
112 const physics::ModelPtr &_model,
113 const common::Time &_currentTime);
114
115 // Documentation inherited.
116 protected: virtual void InitSettingBySpecificData(
117 std::shared_ptr<FlashLightSetting> &_setting);
118
120 private: std::unique_ptr<LedPluginPrivate> dataPtr;
121 };
122}
123#endif
A plugin that blinks a light component in the model.
Definition FlashLightPlugin.hh:230
Internal data class to hold individual flash light settings.
Definition FlashLightPlugin.hh:39
A plugin that blinks light and visual elements in a model.
Definition LedPlugin.hh:102
LedPlugin()
Constructor.
virtual std::shared_ptr< FlashLightSetting > CreateSetting(const sdf::ElementPtr &_sdf, const physics::ModelPtr &_model, const common::Time &_currentTime)
Create an object of setting.
virtual ~LedPlugin()
Destructor.
virtual void InitSettingBySpecificData(std::shared_ptr< FlashLightSetting > &_setting)
Initialize the additional part of an object of setting.
Internal data class to hold individual LED light settings.
Definition LedPlugin.hh:35
virtual ~LedSetting()
Destructor.
LedSetting(const sdf::ElementPtr &_sdf, const physics::ModelPtr &_model, const common::Time &_currentTime)
Constructor.
virtual void Dim()
Dim the light This function is internally used to update the light in the environment.
virtual void Flash()
Flash the light This function is internally used to update the light in the environment.
virtual void InitPubVisual(const transport::PublisherPtr &_pubVisual) final
Set the publisher and send an initial visual command.
A Time class, can be used to hold wall- or sim-time.
Definition Time.hh:48
boost::shared_ptr< Model > ModelPtr
Definition PhysicsTypes.hh:93
boost::shared_ptr< Publisher > PublisherPtr
Definition TransportTypes.hh:49
Forward declarations for the common classes.
Definition Animation.hh:27