dynamics2d_footbot_model.h
Go to the documentation of this file.
1 
7 #ifndef DYNAMICS2D_FOOTBOT_MODEL_H
8 #define DYNAMICS2D_FOOTBOT_MODEL_H
9 
10 namespace argos {
11  class CDynamics2DDifferentialSteeringControl;
12  class CDynamics2DGripper;
13  class CDynamics2DGrippable;
14 }
15 
16 #include <argos3/plugins/simulator/physics_engines/dynamics2d/dynamics2d_multi_body_object_model.h>
17 #include <argos3/plugins/simulator/physics_engines/dynamics2d/dynamics2d_differentialsteering_control.h>
18 #include <argos3/plugins/robots/foot-bot/simulator/footbot_entity.h>
19 
20 namespace argos {
21 
23 
24  public:
25 
27  CFootBotEntity& c_entity);
28  virtual ~CDynamics2DFootBotModel();
29 
30  virtual void MoveTo(const CVector3& c_position,
31  const CQuaternion& c_orientation);
32 
33  virtual void Reset();
34 
35  virtual void CalculateBoundingBox();
36 
37  virtual void UpdateFromEntityStatus();
38 
39  void UpdateOriginAnchor(SAnchor& s_anchor);
40 
41  void UpdateTurretAnchor(SAnchor& s_anchor);
42 
43  void UpdatePerspectiveCameraAnchor(SAnchor& s_anchor);
44 
45  inline cpBody* GetActualBaseBody() {
46  return m_ptActualBaseBody;
47  }
48 
49  inline const cpBody* GetActualBaseBody() const {
50  return m_ptActualBaseBody;
51  }
52 
53  inline cpBody* GetActualGripperBody() {
54  return m_ptActualGripperBody;
55  }
56 
57  inline const cpBody* GetActualGripperBody() const {
58  return m_ptActualGripperBody;
59  }
60 
61  private:
62 
63  void TurretPassiveToActive();
64  void TurretActiveToPassive();
65 
66  private:
67 
68  CFootBotEntity& m_cFootBotEntity;
69  CWheeledEntity& m_cWheeledEntity;
70  CGripperEquippedEntity& m_cGripperEntity;
71 
73  CDynamics2DGripper* m_pcGripper;
74  CDynamics2DGrippable* m_pcGrippable;
75 
76  cpFloat m_fMass;
77  cpShape* m_ptBaseShape;
78  cpBody* m_ptActualBaseBody;
79  cpBody* m_ptActualGripperBody;
80  cpBody* m_ptControlGripperBody;
81  cpConstraint* m_ptGripperControlAngularMotion;
82  cpConstraint* m_ptBaseGripperLinearMotion;
83  cpConstraint* m_ptBaseGripperAngularMotion;
84 
85  const Real* m_fCurrentWheelVelocity;
86 
87  UInt8 m_unLastTurretMode;
88  Real m_fPreviousTurretAngleError;
89 
90  };
91 
92 }
93 
94 #endif
unsigned char UInt8
8-bit unsigned integer.
Definition: datatypes.h:60
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
An anchor related to the body of an entity.
Definition: physics_model.h:38
A 3D vector class.
Definition: vector3.h:31
virtual void CalculateBoundingBox()
Calculates the axis-aligned box that contains the entire physics model.
const cpBody * GetActualGripperBody() const
virtual void MoveTo(const CVector3 &c_position, const CQuaternion &c_orientation)
void UpdatePerspectiveCameraAnchor(SAnchor &s_anchor)
virtual void UpdateFromEntityStatus()
Updates the state of this model from the status of the associated entity.
const cpBody * GetActualBaseBody() const
CDynamics2DFootBotModel(CDynamics2DEngine &c_engine, CFootBotEntity &c_entity)
An entity that stores the state of a robot gripper.
Base class for object models with multiple bodies.