tags_default_actuator.cpp
Go to the documentation of this file.
1 
8 #include <argos3/core/simulator/simulator.h>
9 #include <argos3/plugins/simulator/media/tag_medium.h>
10 
11 namespace argos {
12 
13  /****************************************/
14  /****************************************/
15 
17  m_pcTagEquippedEntity(nullptr) {}
18 
19  /****************************************/
20  /****************************************/
21 
23  m_pcTagEquippedEntity =
24  &(c_entity.GetComponent<CTagEquippedEntity>("tags"));
25  m_tSettings.resize(m_pcTagEquippedEntity->GetInstances().size());
26  }
27 
28  /****************************************/
29  /****************************************/
30 
32  try {
33  CCI_TagsActuator::Init(t_tree);
34  }
35  catch(CARGoSException& ex) {
36  THROW_ARGOSEXCEPTION_NESTED("Error initializing the tags default actuator", ex);
37  }
38  }
39 
40  /****************************************/
41  /****************************************/
42 
44  m_pcTagEquippedEntity->SetTagPayloads(m_tSettings);
45  }
46 
47  /****************************************/
48  /****************************************/
49 
51  SetAllPayloads("");
52  }
53 
54  /****************************************/
55  /****************************************/
56 
58  "tags", "default",
59  "Michael Allwright [allsey87@gmail.com]",
60  "1.0",
61  "The tags actuator.",
62 
63  "This actuator controls the payloads of a group of tags. The idea"
64  "is to represent an LCD screen that displays different tags. For a"
65  "complete description of its usage, refer to the ci_tags_actuator.h"
66  " file.\n\n"
67 
68  "REQUIRED XML CONFIGURATION\n\n"
69 
70  " <controllers>\n"
71  " ...\n"
72  " <my_controller ...>\n"
73  " ...\n"
74  " <actuators>\n"
75  " ...\n"
76  " <tags implementation=\"default\" />\n"
77  " ...\n"
78  " </actuators>\n"
79  " ...\n"
80  " </my_controller>\n"
81  " ...\n"
82  " </controllers>\n\n"
83 
84  "OPTIONAL XML CONFIGURATION\n\n"
85 
86  "None.\n",
87 
88  "Usable"
89  );
90 
91  /****************************************/
92  /****************************************/
93 
94 }
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
REGISTER_ACTUATOR(CFootBotDistanceScannerDefaultActuator, "footbot_distance_scanner", "default", "Carlo Pinciroli [ilpincy@gmail.com]", "1.0", "The foot-bot distance scanner actuator.", "This actuator controls the foot-bot distance scanner. For a complete\n" "description of its usage, refer to the ci_footbot_distance_scanner_actuator\n" "file.\n\n" "REQUIRED XML CONFIGURATION\n\n" " <controllers>\n" " ...\n" " <my_controller ...>\n" " ...\n" " <actuators>\n" " ...\n" " <footbot_distance_scanner implementation=\"default\" />\n" " ...\n" " </actuators>\n" " ...\n" " </my_controller>\n" " ...\n" " </controllers>\n\n" "OPTIONAL XML CONFIGURATION\n\n" "None for the time being.\n", "Usable")
virtual void Init(TConfigurationNode &t_node)
Initializes the actuator from the XML configuration tree.
Definition: ci_actuator.h:54
Basic class for an entity that contains other entities.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
The exception that wraps all errors in ARGoS.
virtual void SetAllPayloads(const std::string &str_payload)
Sets all the tags with the same payload.
virtual void Init(TConfigurationNode &t_tree)
Initializes the actuator from the XML configuration tree.
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this actuator.
virtual void Update()
Updates the state of the entity associated to this actuator.
virtual void Reset()
Resets the actuator to the state it had just after Init().
A container of CTagEntity.
SInstance::TVector & GetInstances()
Returns the tags.
void SetTagPayloads(const std::string &str_payload)
Sets the payload of all the tags to the given payload.