Gazebo Sim
API Reference
10.4.0
insert_drive_file
Tutorials
library_books
Classes
toc
Namespaces
insert_drive_file
Files
launch
Gazebo Website
Index
List
Hierarchy
Members: All
Members: Functions
Members: Variables
Members: Typedefs
Members: Enumerations
Members: Enumerator
List
Members
Functions
Typedefs
Variables
Enumerations
Enumerator
src
gz-sim
src
systems
battery_plugin
LinearBatteryPlugin.hh
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2019 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 GZ_SIM_SYSTEMS_LINEAR_BATTERY_PLUGIN_HH_
19
#define GZ_SIM_SYSTEMS_LINEAR_BATTERY_PLUGIN_HH_
20
21
#include <string>
22
#include <map>
23
#include <memory>
24
25
#include <
gz/common/Battery.hh
>
26
27
#include "
gz/sim/System.hh
"
28
29
namespace
gz
30
{
31
namespace
sim
32
{
33
// Inline bracket to help doxygen filtering.
34
inline
namespace
GZ_SIM_VERSION_NAMESPACE {
35
namespace
systems
36
{
37
// Forward declaration
38
class
LinearBatteryPluginPrivate;
39
72
73
class
LinearBatteryPlugin
74
:
public
System
,
75
public
ISystemConfigure
,
76
public
ISystemPreUpdate
,
77
public
ISystemUpdate
,
78
public
ISystemPostUpdate
,
79
public
ISystemReset
80
{
82
public
:
LinearBatteryPlugin
();
83
85
public
:
~LinearBatteryPlugin
()
override
;
86
87
// Documentation inherited
88
public
:
void
Configure
(
const
Entity
&_entity,
89
const
std::shared_ptr<const sdf::Element>
&_sdf,
90
EntityComponentManager
&_ecm,
91
EventManager
&_eventMgr)
final
;
92
94
public
:
void
PreUpdate
(
95
const
gz::sim::UpdateInfo
&_info,
96
gz::sim::EntityComponentManager
&_ecm)
override
;
97
99
public
:
void
Update
(
const
UpdateInfo
&_info,
100
EntityComponentManager
&_ecm)
final
;
101
103
public
:
void
PostUpdate
(
104
const
UpdateInfo
&_info,
105
const
EntityComponentManager
&_ecm)
override
;
106
108
public
:
void
Reset
(
const
UpdateInfo
&_info,
109
EntityComponentManager
&_ecm)
override
;
110
114
private
:
double
OnUpdateVoltage(
const
common::Battery
*_battery);
115
117
private
:
std::unique_ptr<LinearBatteryPluginPrivate>
dataPtr;
118
};
119
}
120
}
121
}
122
}
123
124
#endif