Class vicon_transformer::o80Driver¶
-
template<size_t NUM_SUBJECTS, size_t (*map_name_to_index)(const std::string&)>
class o80Driver : public o80::Driver<None, FixedSizeViconFrame<NUM_SUBJECTS>>¶ Generic o80 driver to provide Vicon data.
Since the shared memory used by o80 requires observations to be of fixed size, the number of subjects observed by Vicon needs to be provided at compile time via the template argument.
Likewise the subject names are not stored in the observation. Instead the subject data is provided in an array with an order which is defined by the
map_name_to_index
function. The client code on the other end will likewise need to have access to this mapping to know which subject is listed at which position.map_name_to_index
is expected to throw an UnknownSubjectError if an unexpected name is passed to it. In this case, the driver will ignore that subject.Subjects for which no information is provided by Vicon will have the
is_visible
field set to false.The driver uses ViconTransformer with the given receiver to acquire the Vicon frames and provide poses relative to the specified origin subject.
- Template Parameters:
NUM_SUBJECTS – Number of subjects.
map_name_to_index – Function that maps a subject name to an index in the subject array. The indices must be less than
NUM_SUBJECTS - 1
.
Public Functions
- Parameters:
receiver – Initialised receiver instance which provides Vicon frames
origin_subject_name – Name of the origin subject. Has to be one of the subjects that is tracked by Vicon. Poses of all subjects will be given relative to the origin subject.
logger – A logger instance used for logging output.
-
inline void start() override¶
-
inline void stop() override¶
-
inline FixedSizeViconFrame<NUM_SUBJECTS> get() override¶
-
inline o80Driver(std::shared_ptr<vicon_transformer::Receiver> receiver, const std::string &origin_subject_name, std::shared_ptr<spdlog::logger> logger = nullptr)
- Parameters:
receiver – Initialised receiver instance which provides Vicon frames
origin_subject_name – Name of the origin subject. Has to be one of the subjects that is tracked by Vicon. Poses of all subjects will be given relative to the origin subject.
logger – A logger instance used for logging output.
-
inline void start() override
-
inline void stop() override
-
inline void set(const None&) override
-
inline FixedSizeViconFrame<NUM_SUBJECTS> get() override