SMACC2
LedPlugin.hh
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20
21
22#ifndef GAZEBO_SMACC_PLUGINS_LEDPLUGIN_HH_
23#define GAZEBO_SMACC_PLUGINS_LEDPLUGIN_HH_
24
25#include <memory>
26
27#include "gazebo/common/Plugin.hh"
28#include "gazebo/physics/physics.hh"
29
30#include "FlashLightPlugin.hh"
31
32namespace smacc2
33{
34 // forward declaration
35 class LedSettingPrivate;
36
38 class GZ_PLUGIN_VISIBLE LedSetting: public FlashLightSetting
39 {
41 public: LedSetting(
42 const sdf::ElementPtr &_sdf,
43 const gazebo::physics::ModelPtr &_model,
44 const gazebo::common::Time &_currentTime,
45 gazebo_ros::Node::SharedPtr rosnode);
46
48 public: virtual ~LedSetting();
49
52 public: virtual void InitPubVisual(
53 const gazebo::transport::PublisherPtr &_pubVisual) final;
54
55 // Documentation inherited.
56 protected: virtual void Flash();
57
58 // Documentation inherited.
59 protected: virtual void Dim();
60
62 private: std::unique_ptr<LedSettingPrivate> dataPtr;
63 };
64
65 // forward declaration
66 class LedPluginPrivate;
67
106 class GZ_PLUGIN_VISIBLE LedPlugin : public FlashLightPlugin
107 {
109 public: LedPlugin();
110
112 public: virtual ~LedPlugin();
113
114 // Documentation inherited.
115 protected: virtual std::shared_ptr<FlashLightSetting> CreateSetting(
116 const sdf::ElementPtr &_sdf,
117 const gazebo::physics::ModelPtr &_model,
118 const gazebo::common::Time &_currentTime,
119 gazebo_ros::Node::SharedPtr node);
120
121 // Documentation inherited.
122 protected: virtual void InitSettingBySpecificData(
123 std::shared_ptr<FlashLightSetting> &_setting);
124
126 private: std::unique_ptr<LedPluginPrivate> dataPtr;
127 };
128}
129#endif
Internal data class to hold individual flash light settings. A setting for each flash light is separa...
A plugin that blinks light and visual elements in a model. In addition to the features of the base pl...
Definition: LedPlugin.hh:107
std::unique_ptr< LedPluginPrivate > dataPtr
Pointer to private data.
Definition: LedPlugin.hh:126
Internal data class to hold individual LED light settings.
Definition: LedPlugin.hh:39
std::unique_ptr< LedSettingPrivate > dataPtr
Pointer to private data.
Definition: LedPlugin.hh:62