8 #include <argos3/core/simulator/simulator.h>
9 #include <argos3/core/simulator/space/space.h>
10 #include <argos3/plugins/simulator/media/radio_medium.h>
36 const std::string& str_id) :
50 for(itRadio = itRadio.begin(&t_tree);
51 itRadio != itRadio.end();
55 pcRadio->Init(*itRadio);
59 std::string strAnchorId;
71 m_vecInstances.emplace_back(*pcRadio, cBody.GetAnchor(strAnchorId), cOffset);
90 s_instance.Anchor.Enable();
102 s_instance.Anchor.Disable();
112 Real f_transmit_range) {
133 "CRadioEquippedEntity::GetRadio(), id=\"" <<
135 "\": index out of bounds: un_index = " <<
137 ", m_vecInstances.size() = " <<
148 if(s_instance.Radio.IsEnabled()) {
149 cPosition = s_instance.Offset;
150 cPosition.
Rotate(s_instance.Anchor.Orientation);
151 cPosition += s_instance.Anchor.Position;
152 s_instance.Radio.SetPosition(cPosition);
162 s_instance.Radio.SetMedium(c_medium);
#define ARGOS_ASSERT(condition, message)
When code is compiled in debug, this macro throws an ARGoS exception with the passed message if the s...
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
unsigned int UInt32
32-bit unsigned integer.
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
ticpp::Iterator< ticpp::Element > TConfigurationNodeIterator
The iterator for the ARGoS configuration XML node.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
REGISTER_STANDARD_SPACE_OPERATIONS_ON_COMPOSABLE(CComposableEntity)
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
Basic class for an entity that contains other entities.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
void AddComponent(CEntity &c_component)
Adds a component to this composable entity.
This entity is a link to a body in the physics engine.
void Disable()
Disables the entity.
const std::string & GetId() const
Returns the id of this entity.
std::string GetContext() const
Returns the context of this entity.
void Enable()
Enables the entity.
CComposableEntity & GetParent()
Returns this entity's parent.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
An anchor related to the body of an entity.
The exception that wraps all errors in ARGoS.
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
A container of CRadioEntity.
SInstance::TVector m_vecInstances
List of the radios managed by this entity.
CRadioEntity & GetRadio(UInt32 un_index)
Returns a radio by numeric index.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
void AddRadio(const std::string &str_id, const CVector3 &c_offset, SAnchor &s_anchor, Real f_transmit_range)
Programmatically creates a new radio.
void SetMedium(CRadioMedium &c_medium)
Sets the medium associated to this entity.
CRadioEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
virtual void UpdateComponents()
Calls the Update() method on all the components.
SInstance(CRadioEntity &c_radio, SAnchor &s_anchor, const CVector3 &c_offset)