Main Page · Modules · All Classes · Class Hierarchy
MATorsoController.hpp
1 /*
2  * This file is part of the AiBO+ project
3  *
4  * Copyright (C) 2005-2016 Csaba Kertész (csaba.kertesz@gmail.com)
5  *
6  * AiBO+ is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * AiBO+ is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
19  *
20  */
21 
22 #pragma once
23 
24 #include "MAController.hpp"
25 
26 #include <MCThreadLocalData.hpp>
27 
28 #include <boost/scoped_ptr.hpp>
29 
30 class MADevice;
31 template<typename T>
32 class MANum;
33 class MATorsoController;
34 
40 namespace MA
41 {
44 }
45 
50 {
51 public:
55  virtual ~MATorsoController();
56 
57 protected:
58  virtual void UpdateRobotState(MARobotState& state) override;
59  virtual MA::DeviceGeneratorsMap GetSkitTransitionGenerators(MA::SkitBaseSPtr skit) override;
60  void SetAccelRawHighresValues(MANum<int>& value, MADevice& device) const;
61  void SetAccelDegreeHighresValues(MANum<int>& value, MADevice& device) const;
62 
63 public:
64  virtual MA::DeviceList GetMotors() const override;
65  virtual void RequestRestart();
66  virtual void RequestShutdown();
67  virtual void RequestDebugMode();
68  virtual int GetFreeMemory() const;
69 
70 protected:
72  boost::scoped_ptr<MADevice> WifiSwitch;
74  boost::scoped_ptr<MADevice> BackRButton;
76  boost::scoped_ptr<MADevice> BackMButton;
78  boost::scoped_ptr<MADevice> BackFButton;
80  boost::scoped_ptr<MADevice> AccelX;
82  boost::scoped_ptr<MADevice> AccelY;
84  boost::scoped_ptr<MADevice> AccelZ;
86  boost::scoped_ptr<MADevice> InfraNear;
88  boost::scoped_ptr<MADevice> InfraFar;
90  boost::scoped_ptr<MADevice> InfraChest;
91 };
92 
boost::scoped_ptr< MADevice > BackFButton
Touchsensor on the back (fore)
boost::scoped_ptr< MADevice > InfraNear
Infrared sensor (near)
boost::scoped_ptr< MADevice > BackMButton
Touchsensor on the back (middle)
boost::scoped_ptr< MADevice > AccelX
Accelerometer sensor (X dimension)
boost::scoped_ptr< MADevice > InfraChest
Infrared sensor (chest)
boost::scoped_ptr< MADevice > WifiSwitch
Wireless switch.
Base class for the controllers.
Device class.
Definition: MADevice.hpp:57
boost::scoped_ptr< MADevice > AccelZ
Accelerometer sensor (Z dimension)
boost::scoped_ptr< MADevice > InfraFar
Infrared sensor (far)
This class represents a number with bound check.
boost::scoped_ptr< MADevice > AccelY
Accelerometer sensor (Y dimension)
boost::scoped_ptr< MADevice > BackRButton
Touchsensor on the back (rear)
A wrapper class to cover boost::thread_specific_ptr/folly::ThreadLocal API on certain targets...
Torso controller class.
Robot state.