BatteryPrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 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 #ifndef _GAZEBO_BATTERY_PRIVATE_HH_
18 #define _GAZEBO_BATTERY_PRIVATE_HH_
19 
20 #include <string>
21 #include <map>
22 #include <functional>
23 #include <mutex>
25 
26 namespace gazebo
27 {
28  namespace common
29  {
33  {
35  public: double initVoltage;
36 
38  public: double realVoltage;
39 
41  public: std::map<uint32_t, double> powerLoads;
42 
44  public: uint32_t powerLoadCounter;
45 
48  public: std::function<double (const BatteryPtr)> updateFunc;
49 
51  public: std::string name;
52 
54  public: std::mutex powerLoadsMutex;
55  };
56  }
57 }
58 #endif
uint32_t powerLoadCounter
Counter used to produce unique consumer (powerload) ids.
Definition: BatteryPrivate.hh:44
std::string name
Name of the battery.
Definition: BatteryPrivate.hh:51
double initVoltage
Initial voltage in volts.
Definition: BatteryPrivate.hh:35
std::mutex powerLoadsMutex
Mutex that protects the powerLoads map.
Definition: BatteryPrivate.hh:54
double realVoltage
Real voltage in volts.
Definition: BatteryPrivate.hh:38
std::map< uint32_t, double > powerLoads
Map of unique consumer ID to power loads in watts.
Definition: BatteryPrivate.hh:41
std::function< double(const BatteryPtr)> updateFunc
The function used to to update the real voltage.
Definition: BatteryPrivate.hh:48
Definition: BatteryPrivate.hh:32