SMACC2
|
Internal data class to hold individual flash light settings. A setting for each flash light is separately stored in a FlashLightSetting class, which takes care of dynamic specifications such as duration and interval. More...
#include <FlashLightPlugin.hh>
Public Member Functions | |
FlashLightSetting (const sdf::ElementPtr &_sdf, const gazebo::physics::ModelPtr &_model, const gazebo::common::Time &_currentTime, gazebo_ros::Node::SharedPtr node) | |
Constructor. Initialize the setting by the data given to the base plugin. More... | |
virtual | ~FlashLightSetting () |
Destructor. More... | |
virtual void | InitPubLight (const gazebo::transport::PublisherPtr &_pubLight) final |
Set the publisher and send an initial light command. More... | |
virtual void | UpdateLightInEnv (const gazebo::common::Time &_currentTime) final |
Update the light based on the given time. More... | |
virtual const std::string | Name () const final |
Getter of name. More... | |
virtual const gazebo::physics::LinkPtr | Link () const final |
Getter of link. More... | |
virtual void | SwitchOn () final |
Switch on (enable the flashlight). More... | |
virtual void | SwitchOff () final |
Switch off (disable the flashlight). More... | |
virtual void | SetDuration (const double _duration, const int _index) final |
Set the duration time for the specified block. More... | |
virtual void | SetDuration (const double _duration) final |
Set the duration time for all the blocks. More... | |
virtual void | SetInterval (const double _interval, const int _index) final |
Set the interval time for the specified block. More... | |
virtual void | SetInterval (const double _interval) final |
Set the interval time for all the blocks. More... | |
virtual void | SetColor (const ignition::math::Color &_color, const int _index) final |
Set the color for the specified block. More... | |
virtual void | SetColor (const ignition::math::Color &_color) final |
Set the color for all the blocks. More... | |
virtual unsigned int | BlockCount () final |
Get the number of blocks. More... | |
virtual bool | RemoveBlock (const int _index) final |
Remove a specified block. More... | |
virtual void | InsertBlock (const double _duration, const double _interval, const ignition::math::Color &_color, const int _index) final |
Insert a block. Create a block with specified parameters. If the index is out of range, the block will be appended at the end of the list. More... | |
Protected Member Functions | |
virtual void | Flash () |
Flash the light This function is internally used to update the light in the environment. More... | |
virtual void | Dim () |
Dim the light This function is internally used to update the light in the environment. More... | |
virtual ignition::math::Color | CurrentColor () final |
Get the current color of the light. This is to be used by an inheriting class of FlashLightSetting class. More... | |
Private Attributes | |
std::unique_ptr< FlashLightSettingPrivate > | dataPtr |
Pointer to private data. More... | |
Internal data class to hold individual flash light settings. A setting for each flash light is separately stored in a FlashLightSetting class, which takes care of dynamic specifications such as duration and interval.
Definition at line 48 of file FlashLightPlugin.hh.
smacc2::FlashLightSetting::FlashLightSetting | ( | const sdf::ElementPtr & | _sdf, |
const gazebo::physics::ModelPtr & | _model, | ||
const gazebo::common::Time & | _currentTime, | ||
gazebo_ros::Node::SharedPtr | node | ||
) |
Constructor. Initialize the setting by the data given to the base plugin.
[in] | _sdf | SDF data for the setting. |
[in] | _model | The Model pointer holding the light to control. |
[in] | _currentTime | The current time point. |
Definition at line 184 of file FlashLightPlugin.cc.
References dataPtr.
|
virtual |
|
finalvirtual |
Get the number of blocks.
Definition at line 514 of file FlashLightPlugin.cc.
References dataPtr.
|
finalprotectedvirtual |
Get the current color of the light. This is to be used by an inheriting class of FlashLightSetting class.
Definition at line 591 of file FlashLightPlugin.cc.
References dataPtr.
Referenced by smacc2::LedSetting::Flash().
|
protectedvirtual |
Dim the light This function is internally used to update the light in the environment.
Reimplemented in smacc2::LedSetting.
Definition at line 577 of file FlashLightPlugin.cc.
References dataPtr.
Referenced by smacc2::LedSetting::Dim(), and UpdateLightInEnv().
|
protectedvirtual |
Flash the light This function is internally used to update the light in the environment.
Reimplemented in smacc2::LedSetting.
Definition at line 554 of file FlashLightPlugin.cc.
References dataPtr.
Referenced by smacc2::LedSetting::Flash(), and UpdateLightInEnv().
|
finalvirtual |
Set the publisher and send an initial light command.
[in] | _pubLight | The publisher to send a message |
Definition at line 339 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Insert a block. Create a block with specified parameters. If the index is out of range, the block will be appended at the end of the list.
[in] | _duration | The duration for the block. |
[in] | _interval | The interval for the block. |
[in] | _color | The color for the block. |
[in] | _index | The index of the block to be inserted into the list. |
Definition at line 533 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Getter of link.
Definition at line 427 of file FlashLightPlugin.cc.
References dataPtr.
Referenced by smacc2::LedSetting::Dim(), smacc2::LedSetting::Flash(), smacc2::LedSetting::InitPubVisual(), and smacc2::LedSetting::LedSetting().
|
finalvirtual |
Getter of name.
Definition at line 421 of file FlashLightPlugin.cc.
References dataPtr.
Referenced by smacc2::LedSetting::InitPubVisual().
|
finalvirtual |
Remove a specified block.
[in] | _index | Index to the block to remove |
Definition at line 520 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Set the color for all the blocks.
[in] | _color | New color to set. |
Definition at line 505 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Set the color for the specified block.
[in] | _color | New color to set. |
[in] | _index | The index to the block to update. |
Definition at line 491 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Set the duration time for all the blocks.
[in] | _duration | New duration time to set. |
Definition at line 460 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Set the duration time for the specified block.
[in] | _duration | New duration time to set. |
[in] | _index | The index to the block to update. |
Definition at line 447 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Set the interval time for all the blocks.
[in] | _interval | New interval time to set. |
Definition at line 482 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Set the interval time for the specified block.
[in] | _interval | New interval time to set. |
[in] | _index | The index to the block to update. |
Definition at line 469 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Switch off (disable the flashlight).
Definition at line 439 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Switch on (enable the flashlight).
Definition at line 433 of file FlashLightPlugin.cc.
References dataPtr.
|
finalvirtual |
Update the light based on the given time.
[in] | _currentTime | The current point of time to update the lights. |
Definition at line 355 of file FlashLightPlugin.cc.
References dataPtr, Dim(), and Flash().
|
private |
Pointer to private data.
Definition at line 156 of file FlashLightPlugin.hh.
Referenced by BlockCount(), CurrentColor(), Dim(), Flash(), FlashLightSetting(), InitPubLight(), InsertBlock(), Link(), Name(), RemoveBlock(), SetColor(), SetDuration(), SetInterval(), SwitchOff(), SwitchOn(), and UpdateLightInEnv().