YARP
Yet Another Robot Platform
TextureBattery.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef YARP_OVRHEADSET_TEXTUREBATTERY_H
20 #define YARP_OVRHEADSET_TEXTUREBATTERY_H
21 
22 #include <GL/glew.h>
23 #include <OVR_CAPI.h>
24 
25 #include <yarp/os/PeriodicThread.h>
26 
27 #include <array>
28 
29 class TextureStatic;
30 namespace yarp { namespace dev { class PolyDriver; } }
31 namespace yarp { namespace dev { class IBattery; } }
32 
34 {
35 public:
50  };
51 
52  TextureBattery(ovrSession session, bool enabled);
54 
55  ovrSession session;
56 
58 
59  virtual void run();
60 
61 private:
62  std::array<TextureStatic*, 13> textures;
63  BatteryStatus currentStatus;
64 
66  yarp::dev::IBattery* ibat;
67 
68  bool initBatteryClient();
69 };
70 
71 #endif // YARP_OVRHEADSET_TEXTUREBATTERY_H
TextureBattery::BatteryStatusCharging
@ BatteryStatusCharging
Definition: TextureBattery.h:44
TextureBattery::BatteryStatus
BatteryStatus
Definition: TextureBattery.h:36
TextureBattery::BatteryStatusCharging060
@ BatteryStatusCharging060
Definition: TextureBattery.h:46
TextureBattery::BatteryStatusMissing
@ BatteryStatusMissing
Definition: TextureBattery.h:37
TextureBattery::BatteryStatusCharging040
@ BatteryStatusCharging040
Definition: TextureBattery.h:47
TextureBattery::session
ovrSession session
Definition: TextureBattery.h:55
TextureBattery::BatteryStatus100
@ BatteryStatus100
Definition: TextureBattery.h:38
TextureBattery::currentTexture
TextureStatic * currentTexture
Definition: TextureBattery.h:57
TextureBattery::run
virtual void run()
Loop function.
Definition: TextureBattery.cpp:133
TextureBattery::BatteryStatusChargingLow
@ BatteryStatusChargingLow
Definition: TextureBattery.h:49
TextureBattery::BatteryStatus080
@ BatteryStatus080
Definition: TextureBattery.h:39
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
TextureBattery::TextureBattery
TextureBattery(ovrSession session, bool enabled)
Definition: TextureBattery.cpp:40
TextureBattery::BatteryStatusCaution
@ BatteryStatusCaution
Definition: TextureBattery.h:42
yarp::os::PeriodicThread
An abstraction for a periodic thread.
Definition: PeriodicThread.h:25
PeriodicThread.h
TextureBattery::BatteryStatusLow
@ BatteryStatusLow
Definition: TextureBattery.h:43
TextureBattery::BatteryStatus040
@ BatteryStatus040
Definition: TextureBattery.h:41
yarp::dev::IBattery
A generic battery interface.
Definition: IBattery.h:33
TextureBattery::BatteryStatus060
@ BatteryStatus060
Definition: TextureBattery.h:40
TextureStatic
Definition: TextureStatic.h:27
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
TextureBattery::BatteryStatusChargingCaution
@ BatteryStatusChargingCaution
Definition: TextureBattery.h:48
TextureBattery::BatteryStatusCharging080
@ BatteryStatusCharging080
Definition: TextureBattery.h:45
TextureBattery::~TextureBattery
~TextureBattery()
Definition: TextureBattery.cpp:71
TextureBattery
Definition: TextureBattery.h:34