ARGoS 3
A parallel, multi-engine simulator for swarm robotics
medium.cpp
Go to the documentation of this file.
1
7#include "medium.h"
8#include <argos3/core/simulator/simulator.h>
9#include <argos3/core/simulator/space/space.h>
10
11namespace argos {
12
13 /****************************************/
14 /****************************************/
15
17 try {
18 /* Initialize space */
19 m_pcSpace = &CSimulator::GetInstance().GetSpace();
20 /* Get id from the XML */
21 GetNodeAttribute(t_tree, "id", m_strId);
22 }
23 catch(CARGoSException& ex) {
24 THROW_ARGOSEXCEPTION_NESTED("Error initializing a medium entity", ex);
25 }
26 }
27
28 /****************************************/
29 /****************************************/
30
31}
#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.
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
virtual void Init(TConfigurationNode &t_tree)
Initialized the medium.
Definition medium.cpp:16
CSpace & GetSpace() const
Returns a reference to the simulated space.
Definition simulator.h:104
static CSimulator & GetInstance()
Returns the instance to the CSimulator class.
Definition simulator.cpp:78
The exception that wraps all errors in ARGoS.