Main Page · Modules · All Classes · Class Hierarchy
MAMouthController.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 <boost/shared_ptr.hpp>
25 
26 #include <MCThreadLocalData.hpp>
27 
28 #include "core/MAValueGenerators.hpp"
29 #include "types/MABodyTypes.hpp"
30 #include "MAController.hpp"
31 
32 class MADevice;
33 class MAMouthController;
34 class MARobotState;
35 
41 namespace MA
42 {
45 }
46 
52 {
53 public:
57  virtual ~MAMouthController();
58 
59 private:
60  virtual void UpdateRobotState(MARobotState& state) override;
61 
62 public:
63  virtual MA::DeviceList GetMotors() const override;
64  bool IsMovingMouth() const;
65  MA_DECLARE_TRANSITION(CloseMouth, IsMouthClosed)
66  MA_DECLARE_TRANSITION_ACTION(Speaking)
67  MA_DECLARE_TRANSITION_ACTION(Burp)
68  void Stop();
69  bool IsPowerOn() const;
70  void SetPower(bool new_state);
71 
72 protected:
73  void RegisterDeviceUpdates();
74  void NotifyDeviceUpdate(MADevice& device);
75  MAGeneratorBase* CreateGenerator(const MAMouthOpened& feature, int msec,
77  virtual MA::DeviceGeneratorsMap GetSkitTransitionGenerators(MA::SkitBaseSPtr skit) override;
78  MA::DeviceGeneratorsMap ApplyGenerators(MAGeneratorContainer& container, bool clear);
79 
81  boost::shared_ptr<MADevice> Mouth;
82  /*
83  * Closed-opened position of the mouth
84  * 0 - Closed 100 - Opened
85  */
86  MAMouthOpened MouthOpened;
87 };
88 
boost::shared_ptr< MADevice > Mouth
Mouth.
Base class for the controllers.
Device class.
Definition: MADevice.hpp:57
Mouth controller class.
Generator container class.
Base class for generators.
A wrapper class to cover boost::thread_specific_ptr/folly::ThreadLocal API on certain targets...
The opened-closed position of the mouth.
Robot state.