dynamics2d_velocity_control.h
Go to the documentation of this file.
1 
7 #ifndef DYNAMICS2D_VELOCITY_CONTROL_H
8 #define DYNAMICS2D_VELOCITY_CONTROL_H
9 
10 namespace argos {
11  class CDynamics2DEngine;
12 }
13 
14 #include <argos3/plugins/simulator/physics_engines/dynamics2d/chipmunk-physics/include/chipmunk.h>
15 #include <argos3/core/utility/configuration/argos_configuration.h>
16 #include <argos3/core/utility/math/vector2.h>
17 
18 namespace argos {
19 
21 
22  public:
23 
25  Real f_max_force,
26  Real f_max_torque,
27  TConfigurationNode* t_node = NULL);
28 
30 
31  void AttachTo(cpBody* pt_body);
32 
33  void Detach();
34 
35  void Reset();
36 
38 
39  void SetLinearVelocity(const CVector2& c_velocity);
40 
41  Real GetAngularVelocity() const;
42 
43  void SetAngularVelocity(Real f_velocity);
44 
45  inline Real GetMaxForce() const {
46  return m_fMaxForce;
47  }
48 
49  inline Real GetMaxTorque() const {
50  return m_fMaxTorque;
51  }
52 
53  inline cpBody* GetControlBody() {
54  return m_ptControlBody;
55  }
56 
57  inline cpBody* GetControlledBody() {
58  return m_ptControlledBody;
59  }
60 
61  inline cpConstraint* GetLinearConstraint() {
62  return m_ptLinearConstraint;
63  }
64 
65  inline cpConstraint* GetAngularConstraint() {
66  return m_ptAngularConstraint;
67  }
68 
69  protected:
70 
72 
73  cpBody* m_ptControlBody;
74 
76 
77  cpConstraint* m_ptLinearConstraint;
78 
79  cpConstraint* m_ptAngularConstraint;
80 
82 
84  };
85 
86 }
87 
88 #endif
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
A 2D vector class.
Definition: vector2.h:27
CDynamics2DVelocityControl(CDynamics2DEngine &c_engine, Real f_max_force, Real f_max_torque, TConfigurationNode *t_node=NULL)
void SetLinearVelocity(const CVector2 &c_velocity)