ARGoS
3
A parallel, multi-engine simulator for swarm robotics
quadrotor_entity.cpp
Go to the documentation of this file.
1
7
#include "
quadrotor_entity.h
"
8
#include <argos3/core/simulator/space/space.h>
9
10
namespace
argos
{
11
12
/****************************************/
13
/****************************************/
14
15
CQuadRotorEntity::SPositionControlData::SPositionControlData
(
16
const
CVector3
& c_position,
17
const
CRadians
& c_yaw) :
18
Position(c_position),
19
Yaw(c_yaw) {}
20
21
/****************************************/
22
/****************************************/
23
24
CQuadRotorEntity::SSpeedControlData::SSpeedControlData
(
25
const
CVector3
& c_velocity,
26
const
CRadians
& c_rot_speed) :
27
Velocity(c_velocity),
28
RotSpeed(c_rot_speed) {}
29
30
/****************************************/
31
/****************************************/
32
33
CQuadRotorEntity::CQuadRotorEntity
(
CComposableEntity
* pc_parent) :
34
CEntity
(pc_parent),
35
m_eControlMethod(
NO_CONTROL
) {
36
Reset
();
37
}
38
39
/****************************************/
40
/****************************************/
41
42
CQuadRotorEntity::CQuadRotorEntity
(
CComposableEntity
* pc_parent,
43
const
std::string& str_id) :
44
CEntity
(pc_parent, str_id),
45
m_eControlMethod(NO_CONTROL) {
46
Reset
();
47
}
48
49
/****************************************/
50
/****************************************/
51
52
void
CQuadRotorEntity::Reset
() {
53
m_sPositionControlData.
Position
.
Set
(0.0f, 0.0f, 0.0f);
54
m_sPositionControlData.
Yaw
.
SetValue
(0.0f);
55
m_sSpeedControlData.
Velocity
.
Set
(0.0f, 0.0f, 0.0f);
56
m_sSpeedControlData.
RotSpeed
.
SetValue
(0.0);
57
}
58
59
/****************************************/
60
/****************************************/
61
62
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY
(
CQuadRotorEntity
);
63
64
/****************************************/
65
/****************************************/
66
67
}
argos::CVector3::Set
void Set(const Real f_x, const Real f_y, const Real f_z)
Sets the vector contents from Cartesian coordinates.
Definition:
vector3.h:143
argos::CQuadRotorEntity::Reset
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
Definition:
quadrotor_entity.cpp:52
argos
The namespace containing all the ARGoS related code.
Definition:
ci_actuator.h:12
argos::CVector3
A 3D vector class.
Definition:
vector3.h:29
argos::CRadians
It defines the basic type CRadians, used to store an angle value in radians.
Definition:
angles.h:42
quadrotor_entity.h
argos::CComposableEntity
Basic class for an entity that contains other entities.
Definition:
composable_entity.h:32
argos::REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY(CEntity)
argos::CQuadRotorEntity::SPositionControlData::SPositionControlData
SPositionControlData()
Definition:
quadrotor_entity.h:33
argos::CQuadRotorEntity::CQuadRotorEntity
CQuadRotorEntity(CComposableEntity *pc_parent)
Definition:
quadrotor_entity.cpp:33
argos::CQuadRotorEntity::SPositionControlData::Yaw
CRadians Yaw
Definition:
quadrotor_entity.h:31
argos::CRadians::SetValue
void SetValue(Real f_value)
Sets the value in radians.
Definition:
angles.h:127
argos::CQuadRotorEntity::SSpeedControlData::Velocity
CVector3 Velocity
Definition:
quadrotor_entity.h:39
argos::CEntity
The basic entity type.
Definition:
entity.h:89
argos::CQuadRotorEntity::NO_CONTROL
@ NO_CONTROL
Definition:
quadrotor_entity.h:24
argos::CQuadRotorEntity
Definition:
quadrotor_entity.h:15
argos::CQuadRotorEntity::SSpeedControlData::SSpeedControlData
SSpeedControlData()
Definition:
quadrotor_entity.h:42
argos::CQuadRotorEntity::SPositionControlData::Position
CVector3 Position
Definition:
quadrotor_entity.h:30
argos::CQuadRotorEntity::SSpeedControlData::RotSpeed
CRadians RotSpeed
Definition:
quadrotor_entity.h:40
plugins
simulator
entities
quadrotor_entity.cpp
Generated on Wed Aug 4 2021 00:15:55 for ARGoS by
1.8.17