|
mc_rtc
2.14.0
|
#include <mc_rbdyn/Robots.h>


Classes | |
| struct | NewRobotsToken |
Public Types | |
| using | value_type = mc_rbdyn::Robot |
Public Types inherited from mc_rtc::shared< Robots > | |
| using | ActualBase = typename std::conditional< std::is_same< void, void >::value, std::enable_shared_from_this< Robots >, void >::type |
Public Member Functions | |
| const std::vector< mc_rbdyn::RobotModule > & | robotModules () const |
| std::vector< rbd::MultiBody > & | mbs () |
| const std::vector< rbd::MultiBody > & | mbs () const |
| std::vector< rbd::MultiBodyConfig > & | mbcs () |
| const std::vector< rbd::MultiBodyConfig > & | mbcs () const |
| bool | hasRobot (const std::string &name) const |
| mc_rbdyn::Robots & | robots () noexcept |
| const mc_rbdyn::Robots & | robots () const noexcept |
| unsigned int | robotIndex () const |
| unsigned int | envIndex () const |
| unsigned int | robotIndex (const std::string &name) const |
| const RobotModule & | robotModule (size_t idx) const |
| Robot & | robot () |
| const Robot & | robot () const |
| Robot & | env () |
| const Robot & | env () const |
| Robot & | robot (size_t idx) |
| const Robot & | robot (size_t idx) const |
| Robot & | robot (const std::string &name) |
| const Robot & | robot (const std::string &name) const |
| size_type | size () const noexcept |
| void | reserve (size_type new_cap) |
| mc_rbdyn::Robot & | operator[] (size_t idx) |
| const mc_rbdyn::Robot & | operator[] (size_t idx) const |
| mc_rbdyn::Robot & | at (size_t idx) |
| const mc_rbdyn::Robot & | at (size_t idx) const |
| void | copy (mc_rbdyn::Robots &out) const |
| Robots (NewRobotsToken) | |
Robot(s) loading/unloading functions | |
These functions allow to load or unload robot(s) from the Robots class | |
| Robot & | load (const std::string &name, const RobotModule &module, const LoadRobotParameters ¶ms={}) |
| Robot & | load (const RobotModule &module, const LoadRobotParameters ¶ms={}) |
| void | load (const std::vector< std::shared_ptr< RobotModule >> &modules) |
| void | rename (const std::string &oldName, const std::string &newName) |
| Robot & | loadFromUrdf (const std::string &name, const std::string &urdf, const rbd::parsers::ParserParameters &parser_params={}, const LoadRobotParameters &load_params={}) |
| void | robotCopy (const Robot &robot, const std::string ©Name) |
| void | removeRobot (const std::string &name) |
| void | removeRobot (unsigned int idx) |
Public Member Functions inherited from mc_rtc::shared< Robots > | |
| operator std::shared_ptr< Robots > () | |
| operator std::shared_ptr< const Robots > () const | |
Static Public Member Functions | |
| static RobotsPtr | make () noexcept |
| template<class Deleter > | |
| static RobotsPtr | make (Deleter deleter) noexcept |
Protected Member Functions | |
| Robots (const Robots &rhs)=delete | |
| Robots & | operator= (const Robots &rhs)=delete |
| Robots (Robots &&robots)=delete | |
| Robots & | operator= (Robots &&robots)=delete |
| void | updateIndexes () |
Protected Attributes | |
| RobotModuleVector | robot_modules_ |
| std::vector< RobotPtr > | robots_ |
| std::vector< rbd::MultiBody > | mbs_ |
| std::vector< rbd::MultiBodyConfig > | mbcs_ |
| std::vector< rbd::MultiBodyGraph > | mbgs_ |
| unsigned int | robotIndex_ |
| unsigned int | envIndex_ |
| std::unordered_map< std::string, unsigned int > | robotNameToIndex_ |
| Correspondance between robot name and index. More... | |
| onRobotAddedSigT | onRobotAdded_ |
| onRobotRemovedSigT | onRobotRemoved_ |
Friends | |
| struct | Robot |
Iterators | |
These functions provide an iterator interface to Robots | |
| using | iterator = mc_rtc::SharedPtrVectorIterator< Robot > |
| using | const_iterator = mc_rtc::SharedPtrVectorConstIterator< Robot > |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
| using | size_type = std::vector< RobotPtr >::size_type |
| iterator | begin () noexcept |
| const_iterator | begin () const noexcept |
| const_iterator | cbegin () const noexcept |
| iterator | end () noexcept |
| const_iterator | end () const noexcept |
| const_iterator | cend () const noexcept |
| reverse_iterator | rbegin () noexcept |
| const_reverse_iterator | rbegin () const noexcept |
| const_reverse_iterator | crbegin () const noexcept |
| reverse_iterator | rend () noexcept |
| const_reverse_iterator | rend () const noexcept |
| const_reverse_iterator | crend () const noexcept |
Signals | |
These functions provide signals to events related to robot adding/removing | |
| using | onRobotAddedSigT = mc_rtc::Signal< std::string > |
| using | onRobotAddedSlotT = onRobotAddedSigT::SlotT |
| using | onRobotRemovedSigT = mc_rtc::Signal< std::string > |
| using | onRobotRemovedSlotT = onRobotRemovedSigT::SlotT |
| onRobotAddedSigT::Proxy | onRobotAdded () const noexcept |
| onRobotRemovedSigT::Proxy | onRobotRemoved () const noexcept |
| using mc_rbdyn::Robots::const_reverse_iterator = std::reverse_iterator<const_iterator> |
| using mc_rbdyn::Robots::onRobotAddedSigT = mc_rtc::Signal<std::string> |
This signal is emitted after a robot is added
The payload has the name of the newly added robot.
It is emitted after the robot has been added, i.e. robots(payload) has the newly added robot
This signal is emitted after a robot is added
The payload has the name of the newly added robot.
It is emitted after the robot has been added, i.e. robots(payload) has the newly added robot
| using mc_rbdyn::Robots::onRobotRemovedSigT = mc_rtc::Signal<std::string> |
This signal is emitted after a robot is added
The payload has the name of the newly added robot.
It is emitted after the robot has been added, i.e. robots(payload) has the newly added robot
This signal is emitted after a robot is added
The payload has the name of the newly added robot.
It is emitted after the robot has been added, i.e. robots(payload) has the newly added robot
| using mc_rbdyn::Robots::reverse_iterator = std::reverse_iterator<iterator> |
| using mc_rbdyn::Robots::size_type = std::vector<RobotPtr>::size_type |
| mc_rbdyn::Robots::Robots | ( | NewRobotsToken | ) |
|
protecteddelete |
|
protecteddelete |
|
inline |
Access the robot at provided index
Provided for backward compatibility
|
inline |
Access the robot at provided index (const)
Provided for backward compatibility
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
| void mc_rbdyn::Robots::copy | ( | mc_rbdyn::Robots & | out | ) | const |
Copy this instance into another instance
out will be cleared and robots loaded in this instance will be copied into out
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
| Robot& mc_rbdyn::Robots::env | ( | ) |
| const Robot& mc_rbdyn::Robots::env | ( | ) | const |
| unsigned int mc_rbdyn::Robots::envIndex | ( | ) | const |
Index of the first non-actuated robot (or the last actuated robot if no unactuated robot are loaded)
| bool mc_rbdyn::Robots::hasRobot | ( | const std::string & | name | ) | const |
True if the given robot is part of this intance
|
inline |
Load a single robot from a RobotModule
Use the name in the module to load the robot
| Robot& mc_rbdyn::Robots::load | ( | const std::string & | name, |
| const RobotModule & | module, | ||
| const LoadRobotParameters & | params = {} |
||
| ) |
Load a single robot from a RobotModule with the provided parameters
| name | Name of the new robot. Must be unique. |
| module | The RobotModule to fetch data from for this robot |
| params |
| If | a robot named <name> already exists |
| void mc_rbdyn::Robots::load | ( | const std::vector< std::shared_ptr< RobotModule >> & | modules | ) |
Load multiple robots from as many RobotModule instances
| modules | List of RobotModule to load the robots from |
| Robot& mc_rbdyn::Robots::loadFromUrdf | ( | const std::string & | name, |
| const std::string & | urdf, | ||
| const rbd::parsers::ParserParameters & | parser_params = {}, |
||
| const LoadRobotParameters & | load_params = {} |
||
| ) |
Load a robot directly from URDF content with the given parameters
| name | Name of the robot |
| urdf | URDF content to be parsed |
| parser_params | Parameters used to parse the URDF |
| load_params | Parameters used to load the robot |
|
inlinestaticnoexcept |
Create a new Robots instance with a custom deleter
| std::vector<rbd::MultiBodyConfig>& mc_rbdyn::Robots::mbcs | ( | ) |
Give access to the underlying list of rbd::MultiBodyConfig objects
| const std::vector<rbd::MultiBodyConfig>& mc_rbdyn::Robots::mbcs | ( | ) | const |
Give access to the underlying list of rbd::MultiBodyConfig objects (const)
| std::vector<rbd::MultiBody>& mc_rbdyn::Robots::mbs | ( | ) |
Give access to the underlying list of rbd::MultiBody objects
| const std::vector<rbd::MultiBody>& mc_rbdyn::Robots::mbs | ( | ) | const |
Give access to the underlying list of rbd::MultiBody objects (const)
|
inlinenoexcept |
This signal is emitted after a robot is added
The payload has the name of the newly added robot.
It is emitted after the robot has been added, i.e. robots(payload) has the newly added robot
|
inlinenoexcept |
This signal is emitted when a robot is about to be removed
The payload is the name of the robot that is about to be removed
It is emitted before the robot is effectively removed, i.e. robots(payload) still has the robot about to be removed
|
inline |
Access via operator[]
Provided for backward compatibility
|
inline |
Access via operator[] (const)
Provided for backward compatibility
|
noexcept |
|
noexcept |
| void mc_rbdyn::Robots::removeRobot | ( | const std::string & | name | ) |
Load a single robot from a RobotModule with the provided parameters
| name | Name of the new robot. Must be unique. |
| module | The RobotModule to fetch data from for this robot |
| params |
| If | a robot named <name> already exists |
| void mc_rbdyn::Robots::removeRobot | ( | unsigned int | idx | ) |
Load a single robot from a RobotModule with the provided parameters
| name | Name of the new robot. Must be unique. |
| module | The RobotModule to fetch data from for this robot |
| params |
| If | a robot named <name> already exists |
| void mc_rbdyn::Robots::rename | ( | const std::string & | oldName, |
| const std::string & | newName | ||
| ) |
Rename an existing robot
|
noexcept |
|
noexcept |
| void mc_rbdyn::Robots::reserve | ( | size_type | new_cap | ) |
Reserves space for a total number of new_cap Robots
| new_cap | Reserve size |
Has no effect if size > new_cap
| Robot& mc_rbdyn::Robots::robot | ( | ) |
| const Robot& mc_rbdyn::Robots::robot | ( | ) | const |
| Robot& mc_rbdyn::Robots::robot | ( | const std::string & | name | ) |
| const Robot& mc_rbdyn::Robots::robot | ( | const std::string & | name | ) | const |
| Robot& mc_rbdyn::Robots::robot | ( | size_t | idx | ) |
| const Robot& mc_rbdyn::Robots::robot | ( | size_t | idx | ) | const |
| void mc_rbdyn::Robots::robotCopy | ( | const Robot & | robot, |
| const std::string & | copyName | ||
| ) |
Load a single robot from a RobotModule with the provided parameters
| name | Name of the new robot. Must be unique. |
| module | The RobotModule to fetch data from for this robot |
| params |
| If | a robot named <name> already exists |
| unsigned int mc_rbdyn::Robots::robotIndex | ( | ) | const |
Index of the main robot
| unsigned int mc_rbdyn::Robots::robotIndex | ( | const std::string & | name | ) | const |
Index of a robot by name, throws if the robot does not exist
| const RobotModule& mc_rbdyn::Robots::robotModule | ( | size_t | idx | ) | const |
| const std::vector<mc_rbdyn::RobotModule>& mc_rbdyn::Robots::robotModules | ( | ) | const |
Give access to the underlying list of RobotModule objects
|
inlinenoexcept |
Give access to self for backward compatibility (const)
|
inlinenoexcept |
Give access to self for backward compatibility
|
noexcept |
Number of robots
|
protected |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
Correspondance between robot name and index.
|
protected |