NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
BigPuppyController.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
19 #ifndef BIGPUPPY_CONTROLLER_H
20 #define BIGPUPPY_CONTROLLER_H
21 
31 //this library
32 #include "core/tgObserver.h"
33 
34 #include "sensors/tgDataObserver.h"
35 
36 //Forward Declarations
37 class BigPuppy;
38 
39 class BigPuppyController : public tgObserver<BigPuppy>
40 {
41 public:
42 
43  //I really don't think I need a preferred length here, since there will be many different lengths, decided in onSetup()
44  BigPuppyController(double timestep);
45 
46  ~BigPuppyController() {}
47 
48  virtual void onSetup(BigPuppy& subject);
49 
50  virtual void onStep(BigPuppy& subject, double dt);
51 
52  virtual void onTeardown(BigPuppy& subject);
53 
54 private:
55 
56  double m_totalTime;
57  double dt;
58 
59  //May need functions for setting target lengths of different muscle groups...
60  virtual void moveAllMotors(BigPuppy& subject, double dt);
61 
62  //For setting muscle lengths:
63  void setBicepTargetLength(BigPuppy& subject, double dt);
64  void setFrontTricepTargetLength(BigPuppy& subject, double dt);
65  void setRearTricepTargetLength(BigPuppy& subject, double dt);
66  void setLegToAbdomenTargetLength(BigPuppy& subject, double dt);
67  void setRightShoulderTargetLength(BigPuppy& subject, double dt);
68 
69 };
70 #endif //BIGPUPPY_CONTROLLER_H
virtual void onStep(BigPuppy &subject, double dt)
Definition of tgObserver class.
virtual void onSetup(BigPuppy &subject)
virtual void onTeardown(BigPuppy &subject)
Definition of tgObserver class.