vulp  2.3.0
vulp::actuation::ServoLayout Class Reference

Map between servos, their busses and the joints they actuate. More...

#include <ServoLayout.h>

Public Member Functions

void add_servo (const int servo_id, const int bus_id, const std::string &joint_name)
 Add a servo to the layout. More...
 
int bus (const int servo_id) const
 Get identifier of the CAN bus a servo is connected to. More...
 
const std::string & joint_name (const int servo_id) const
 Get the name of the joint a servo actuates. More...
 
const std::map< int, int > & servo_bus_map () const noexcept
 Get the full servo-bus map. More...
 
const std::map< int, std::string > & servo_joint_map () const noexcept
 Get the full servo-joint map. More...
 
size_t size () const noexcept
 Get the number of servos in the layout. More...
 

Detailed Description

Map between servos, their busses and the joints they actuate.

Definition at line 12 of file ServoLayout.h.

Member Function Documentation

◆ add_servo()

void vulp::actuation::ServoLayout::add_servo ( const int  servo_id,
const int  bus_id,
const std::string &  joint_name 
)
inline

Add a servo to the layout.

Parameters
[in]servo_idServo ID (id.id for moteus)
[in]bus_idCAN bus the servo is connected to.
[in]joint_nameName of the joint the servo actuates.

Definition at line 20 of file ServoLayout.h.

◆ bus()

int vulp::actuation::ServoLayout::bus ( const int  servo_id) const
inline

Get identifier of the CAN bus a servo is connected to.

Parameters
[in]servo_idServo ID.
Returns
CAN bus the servo is connected to.
Exceptions
std::out_of_rangeif the servo is not in the layout.

Definition at line 34 of file ServoLayout.h.

◆ joint_name()

const std::string& vulp::actuation::ServoLayout::joint_name ( const int  servo_id) const
inline

Get the name of the joint a servo actuates.

Parameters
[in]servo_idServo ID.
Returns
Name of the joint the servo actuates.
Exceptions
std::out_of_rangeif the servo is not in the layout.

Definition at line 44 of file ServoLayout.h.

◆ servo_bus_map()

const std::map<int, int>& vulp::actuation::ServoLayout::servo_bus_map ( ) const
inlinenoexcept

Get the full servo-bus map.

Definition at line 49 of file ServoLayout.h.

◆ servo_joint_map()

const std::map<int, std::string>& vulp::actuation::ServoLayout::servo_joint_map ( ) const
inlinenoexcept

Get the full servo-joint map.

Definition at line 54 of file ServoLayout.h.

◆ size()

size_t vulp::actuation::ServoLayout::size ( ) const
inlinenoexcept

Get the number of servos in the layout.

Definition at line 59 of file ServoLayout.h.


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