Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
Loading...
Searching...
No Matches
icarus::Vec3Handle< Scalar > Struct Template Reference

Handle for accessing a Vec3 signal as three scalar components. More...

#include <VecHandle.hpp>

Collaboration diagram for icarus::Vec3Handle< Scalar >:

Public Member Functions

Vec3< Scalar > get () const
 Read all components as a Vec3.
void set (const Vec3< Scalar > &v)
 Write all components from a Vec3.
bool valid () const
 Check if all handles are valid.
 operator bool () const
 Check if handle is valid.

Public Attributes

SignalHandle< Scalar > x
 X component handle.
SignalHandle< Scalar > y
 Y component handle.
SignalHandle< Scalar > z
 Z component handle.

Detailed Description

template<typename Scalar>
struct icarus::Vec3Handle< Scalar >

Handle for accessing a Vec3 signal as three scalar components.

Vec3Handle bundles three SignalHandles (x, y, z) and provides convenience methods for reading/writing the entire vector.

Usage:

// Registration (in component Provision)
Vec3<double> position_;
registry.register_output_vec3("position", &position_, "m");
// Resolution (in consumer Stage)
Vec3Handle<double> pos = registry.resolve_vec3<double>("position");
// Access (in Step)
Vec3<double> p = pos.get(); // Read all components
pos.set(new_position); // Write all components
double x = *pos.x; // Read single component
Handle for accessing a Vec3 signal as three scalar components.
Definition VecHandle.hpp:39
SignalHandle< Scalar > x
X component handle.
Definition VecHandle.hpp:40
void set(const Vec3< Scalar > &v)
Write all components from a Vec3.
Definition VecHandle.hpp:52
Vec3< Scalar > get() const
Read all components as a Vec3.
Definition VecHandle.hpp:47
Template Parameters
ScalarThe scalar type (double or casadi::MX)

Member Function Documentation

◆ get()

template<typename Scalar>
Vec3< Scalar > icarus::Vec3Handle< Scalar >::get ( ) const
inlinenodiscard

Read all components as a Vec3.

◆ operator bool()

template<typename Scalar>
icarus::Vec3Handle< Scalar >::operator bool ( ) const
inlineexplicit

Check if handle is valid.

◆ set()

template<typename Scalar>
void icarus::Vec3Handle< Scalar >::set ( const Vec3< Scalar > & v)
inline

Write all components from a Vec3.

◆ valid()

template<typename Scalar>
bool icarus::Vec3Handle< Scalar >::valid ( ) const
inlinenodiscard

Check if all handles are valid.

Member Data Documentation

◆ x

template<typename Scalar>
SignalHandle<Scalar> icarus::Vec3Handle< Scalar >::x

X component handle.

◆ y

template<typename Scalar>
SignalHandle<Scalar> icarus::Vec3Handle< Scalar >::y

Y component handle.

◆ z

template<typename Scalar>
SignalHandle<Scalar> icarus::Vec3Handle< Scalar >::z

Z component handle.


The documentation for this struct was generated from the following file: