argos::SAnchor Struct Reference

An anchor related to the body of an entity. More...

#include <physics_model.h>

Collaboration diagram for argos::SAnchor:

Public Member Functions

 SAnchor (CEmbodiedEntity &c_body, const std::string &str_id, UInt32 un_index, const CVector3 &c_offset_position, const CQuaternion &c_offset_orientation, const CVector3 &c_position, const CQuaternion &c_orientation)
 Struct constructor. More...
 
void Enable ()
 Enables this anchor. More...
 
void Disable ()
 Disables this anchor. More...
 

Public Attributes

CEmbodiedEntityBody
 The embodied entity that owns this anchor. More...
 
std::string Id
 The id of the anchor. More...
 
UInt32 Index
 The index of the anchor assigned by the embodied entity. More...
 
CVector3 OffsetPosition
 The initial position of the anchor wrt the body coordinate system. More...
 
CQuaternion OffsetOrientation
 The initial orientation of the anchor wrt the body coordinate system. More...
 
CVector3 Position
 The position of the anchor wrt the global coordinate system. More...
 
CQuaternion Orientation
 The orientation of the anchor wrt the global coordinate system. More...
 
UInt32 InUseCount
 A counter for the devices using this anchor. More...
 

Detailed Description

An anchor related to the body of an entity.

Anchors are used by entities as reference points. For instance, an LED ring could use an anchor as the center of the ring. As the anchor moves in the space, the LED positions would be calculated with respect to it. An anchor is always initially disabled. To use it, you must first enable it.

Definition at line 38 of file physics_model.h.

Constructor & Destructor Documentation

◆ SAnchor()

argos::SAnchor::SAnchor ( CEmbodiedEntity c_body,
const std::string &  str_id,
UInt32  un_index,
const CVector3 c_offset_position,
const CQuaternion c_offset_orientation,
const CVector3 c_position,
const CQuaternion c_orientation 
)

Struct constructor.

Initializes the anchor using the provided information. InUseCount is initialized to 0, i.e., the anchor is initially disabled.

Parameters
str_idThe id of the anchor.
c_offset_positionThe position of the anchor wrt the body coordinate system.
c_offset_orientationThe orientation of the anchor wrt the body coordinate system.
See also
CEmbodiedEntity::AddAnchor
CEmbodiedEntity::EnableAnchor
CEmbodiedEntity::DisableAnchor

Definition at line 10 of file physics_model.cpp.

Member Function Documentation

◆ Disable()

void argos::SAnchor::Disable ( )

Disables this anchor.

Definition at line 37 of file physics_model.cpp.

◆ Enable()

void argos::SAnchor::Enable ( )

Enables this anchor.

Definition at line 30 of file physics_model.cpp.

Member Data Documentation

◆ Body

CEmbodiedEntity& argos::SAnchor::Body

The embodied entity that owns this anchor.

Definition at line 40 of file physics_model.h.

◆ Id

std::string argos::SAnchor::Id

The id of the anchor.

Definition at line 42 of file physics_model.h.

◆ Index

UInt32 argos::SAnchor::Index

The index of the anchor assigned by the embodied entity.

Indices are used for fast lookup of anchor methods in physics engines.

Definition at line 45 of file physics_model.h.

◆ InUseCount

UInt32 argos::SAnchor::InUseCount

A counter for the devices using this anchor.

Definition at line 55 of file physics_model.h.

◆ OffsetOrientation

CQuaternion argos::SAnchor::OffsetOrientation

The initial orientation of the anchor wrt the body coordinate system.

Definition at line 49 of file physics_model.h.

◆ OffsetPosition

CVector3 argos::SAnchor::OffsetPosition

The initial position of the anchor wrt the body coordinate system.

Definition at line 47 of file physics_model.h.

◆ Orientation

CQuaternion argos::SAnchor::Orientation

The orientation of the anchor wrt the global coordinate system.

Definition at line 53 of file physics_model.h.

◆ Position

CVector3 argos::SAnchor::Position

The position of the anchor wrt the global coordinate system.

Definition at line 51 of file physics_model.h.