mc_rbdyn::RobotConverter Struct Reference

Copies all common properties from one robot to another encoders, sensors, etc) More...

#include <mc_rbdyn/RobotConverter.h>

Collaboration diagram for mc_rbdyn::RobotConverter:

Public Member Functions

 RobotConverter (const mc_rbdyn::Robot &inputRobot, mc_rbdyn::Robot &outputRobot, const RobotConverterConfig &config)
 
void convert (const mc_rbdyn::Robot &inputRobot, mc_rbdyn::Robot &outputRobot) const
 Copies the common properties of the input robot to the output robot. More...
 
const RobotConverterConfigconfig () const noexcept
 

Protected Member Functions

void precompute (const mc_rbdyn::Robot &inputRobot, const mc_rbdyn::Robot &outputRobot)
 Precomputes the mappings of common properties between input/output robot according to the chosen config_. More...
 
void encodersToOutput (const mc_rbdyn::Robot &inputRobot, mc_rbdyn::Robot &outputRobot) const
 

Protected Attributes

RobotConverterConfig config_
 
std::vector< std::pair< unsigned int, unsigned int > > commonJointIndices_ {}
 
std::vector< std::pair< unsigned int, unsigned int > > commonEncoderToJointIndices_ {}
 
std::vector< std::pair< unsigned int, unsigned int > > mimicJoints_ {}
 

Detailed Description

Copies all common properties from one robot to another encoders, sensors, etc)

Warning
When using the RobotConverter to output to a real robot system, be careful about your choice of options or RobotConverterConfig, not all combinations of options are safe (e.g mbcToOutMbc=false and encodersToOutMbc=false would result in all joints going to zero).

Constructor & Destructor Documentation

◆ RobotConverter()

mc_rbdyn::RobotConverter::RobotConverter ( const mc_rbdyn::Robot inputRobot,
mc_rbdyn::Robot outputRobot,
const RobotConverterConfig config 
)

Initialize the converter and run it once on the output robot

Parameters
inputRobotSame robot that will be fed to convert
outputRobotSame robot that will be fed to convert
configConfig used by this converter

Member Function Documentation

◆ config()

const RobotConverterConfig& mc_rbdyn::RobotConverter::config ( ) const
inlinenoexcept

◆ convert()

void mc_rbdyn::RobotConverter::convert ( const mc_rbdyn::Robot inputRobot,
mc_rbdyn::Robot outputRobot 
) const

Copies the common properties of the input robot to the output robot.

See mc_rbdyn::RobotConverterConfig for available copy options.

◆ encodersToOutput()

void mc_rbdyn::RobotConverter::encodersToOutput ( const mc_rbdyn::Robot inputRobot,
mc_rbdyn::Robot outputRobot 
) const
protected

Copy encoders to output robot configuration

◆ precompute()

void mc_rbdyn::RobotConverter::precompute ( const mc_rbdyn::Robot inputRobot,
const mc_rbdyn::Robot outputRobot 
)
protected

Precomputes the mappings of common properties between input/output robot according to the chosen config_.

Member Data Documentation

◆ commonEncoderToJointIndices_

std::vector<std::pair<unsigned int, unsigned int> > mc_rbdyn::RobotConverter::commonEncoderToJointIndices_ {}
protected

◆ commonJointIndices_

std::vector<std::pair<unsigned int, unsigned int> > mc_rbdyn::RobotConverter::commonJointIndices_ {}
protected

◆ config_

RobotConverterConfig mc_rbdyn::RobotConverter::config_
protected

◆ mimicJoints_

std::vector<std::pair<unsigned int, unsigned int> > mc_rbdyn::RobotConverter::mimicJoints_ {}
protected

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