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

Classes | |
| struct | ConnectionParameters |
| struct | FrameDescription |
| struct | Gripper |
Public Types | |
| using | bounds_t = std::vector< std::map< std::string, std::vector< double > >> |
| using | accelerationBounds_t = std::vector< std::map< std::string, std::vector< double > >> |
| using | jerkBounds_t = std::vector< std::map< std::string, std::vector< double > >> |
| using | torqueDerivativeBounds_t = std::vector< std::map< std::string, std::vector< double > >> |
Public Member Functions | |
| RobotModule (const std::string &path, const std::string &name) | |
| RobotModule (const std::string &path, const std::string &name, const std::string &urdf_path) | |
| RobotModule (const std::string &name, const rbd::parsers::ParserResult &res) | |
| RobotModule | connect (const mc_rbdyn::RobotModule &other, const std::string &this_body, const std::string &other_body, const std::string &prefix, const ConnectionParameters ¶ms) const |
| RobotModule | disconnect (const mc_rbdyn::RobotModule &other, const std::string &this_body, const std::string &other_body, const std::string &prefix, const ConnectionParameters ¶ms) const |
| void | init (const rbd::parsers::ParserResult &res) |
| void | generate_convexes (bool regenerate=false, unsigned int sampling_point=4000) |
| void | bind_convexes () |
| const std::vector< std::map< std::string, std::vector< double > > > & | bounds () const |
| const std::vector< std::map< std::string, std::vector< double > > > & | accelerationBounds () const |
| const std::vector< std::map< std::string, std::vector< double > > > & | jerkBounds () const |
| const std::vector< std::map< std::string, std::vector< double > > > & | torqueDerivativeBounds () const |
| const std::map< std::string, std::vector< double > > & | stance () const |
| const std::map< std::string, std::pair< std::string, std::string > > & | convexHull () const |
| const std::map< std::string, std::pair< std::string, S_ObjectPtr > > & | collisionObjects () const |
| const std::map< std::string, std::pair< std::string, std::string > > & | stpbvHull () const |
| const std::map< std::string, sva::PTransformd > & | collisionTransforms () const |
| const std::vector< Flexibility > & | flexibility () const |
| const std::vector< ForceSensor > & | forceSensors () const |
| const BodySensorVector & | bodySensors () const |
| const std::vector< JointSensor > & | jointSensors () const |
| const Springs & | springs () const |
| const std::vector< mc_rbdyn::Collision > & | minimalSelfCollisions () const |
| const std::vector< mc_rbdyn::Collision > & | commonSelfCollisions () const |
| const std::vector< Gripper > & | grippers () const |
| const Gripper::Safety & | gripperSafety () const |
| const std::vector< std::string > & | ref_joint_order () const |
| const std::array< double, 7 > & | default_attitude () const |
| const mc_rbdyn::lipm_stabilizer::StabilizerConfiguration & | defaultLIPMStabilizerConfiguration () const |
| void | boundsFromURDF (const rbd::parsers::Limits &limits) |
| void | expand_stance () |
| void | make_default_ref_joint_order () |
| const CompoundJointConstraintDescriptionVector & | compoundJoints () const |
| const std::vector< std::string > & | parameters () const |
| const std::vector< std::string > & | canonicalParameters () const |
| std::string | real_urdf () const |
| const DevicePtrVector & | devices () const |
| const std::vector< FrameDescription > & | frames () const noexcept |
| using mc_rbdyn::RobotModule::accelerationBounds_t = std::vector<std::map<std::string, std::vector<double> >> |
Holds information regarding the additional acceleration bounds (specified in addition to urdf limits)
The vector should have 2 entries:
Each entry is a map joint name <-> bound
| using mc_rbdyn::RobotModule::bounds_t = std::vector<std::map<std::string, std::vector<double> >> |
Holds information regarding the bounds (specified in the urdf)
The vector should have 6 entries:
Each entry is a map joint name <-> bound
| using mc_rbdyn::RobotModule::jerkBounds_t = std::vector<std::map<std::string, std::vector<double> >> |
Holds information regarding the additional jerk bounds (specified in addition to urdf limits)
The vector should have 2 entries:
Each entry is a map joint name <-> bound
| using mc_rbdyn::RobotModule::torqueDerivativeBounds_t = std::vector<std::map<std::string, std::vector<double> >> |
Holds information regarding the additional torque-derivative bounds (specified in addition to urdf limits)
The vector should have 2 entries:
Each entry is a map joint name <-> bound
|
inline |
Construct from a provided path and name
As a result:
name path No further action is taken. This constructor is useful to inherit from
| path | Path to the robot description |
| name | Name of the robot |
|
inline |
Construct from a provided path, name and urdf_path
The different is that urdf_path is defined to urdf_path
| path | Path to the robot description |
| name | Name of the robot |
| urdf_path | Path to the robot URDF |
| mc_rbdyn::RobotModule::RobotModule | ( | const std::string & | name, |
| const rbd::parsers::ParserResult & | res | ||
| ) |
Construct from a parser result
|
inline |
Returns the robot's acceleration bounds
The vector should hold 2 string -> vector<double> map
Each map's keys are joint names and values are joint limits.
They should be provided in the following order:
| void mc_rbdyn::RobotModule::bind_convexes | ( | ) |
Bind generated convex hulls to robot bodies.
Associates convex hull files (generated via generate_convexes) with each body in the robot.
convex_dir and named as {mesh_name}-ch.txt.
|
inline |
Return the body sensors of the robot
|
inline |
Returns the robot's bounds obtained from parsing a urdf
The vector should hold 6 string -> vector<double> map
Each map's keys are joint names and values are joint limits.
They should be provided in the following order:
| void mc_rbdyn::RobotModule::boundsFromURDF | ( | const rbd::parsers::Limits & | limits | ) |
Generate correct bounds from URDF bounds
URDF outputs bounds in {lower, upper, velocity, torque} forms
This function set _bounds to: {lower, upper, -velocity, velocity, -torque, torque}
|
inline |
Returns the list of parameters to get a RobotModule that is a canonical representation of this module
An empty vector means that the canonical and control module are the same
|
inline |
Returns a map describing collision objects for the robot
A key defines a valid collision name, there should be no collision with the names convexHull()
A value is composed of two strings:
The transformation between the convex and the body it's attached to are provided in a separate map see collisionTransforms()
|
inline |
Returns a map describing the transformation between convex/STPBV hulls and their parent bodies
A key defines the collision name. The value is the transformation between this collision object and its parent body
|
inline |
Return a common self-collision set
This set of collision describe self-collisions that you want to enable for general applications. Generally this is a super-set of minimalSelfCollisions
|
inline |
Returns a list of compound joint constraint description
| RobotModule mc_rbdyn::RobotModule::connect | ( | const mc_rbdyn::RobotModule & | other, |
| const std::string & | this_body, | ||
| const std::string & | other_body, | ||
| const std::string & | prefix, | ||
| const ConnectionParameters & | params | ||
| ) | const |
Create a new RobotModule by connecting this instance with another RobotModule
| other | The module that will be connected to this instance |
| this_body | Which body in this RobotModule is used to connect the two instances |
| other_body | Which body in the other RobotModule is used to connect the two instances |
| prefix | Prefix applied to every named entities in other before they are added to the resulting module |
| params | Parameters that control how other is transformed during the connection, |
other is has a floating then this base is eliminated in the process| If | a name collision occurs and in conditions specified by wrong params |
|
inline |
Returns a map describing the convex hulls for the robot
A key defines a valid collision name, there should be no collision with the names in collisionObjects()
A value is composed of two strings:
The transformation between the convex and the body it's attached to are provided in a separate map see collisionTransforms()
|
inline |
Return the default attitude of the floating base
This attitute is associated to the stance() configuration
|
inline |
Return default configuration for the lipm stabilizer
|
inline |
Returns a list of non standard sensors supported by this module
| RobotModule mc_rbdyn::RobotModule::disconnect | ( | const mc_rbdyn::RobotModule & | other, |
| const std::string & | this_body, | ||
| const std::string & | other_body, | ||
| const std::string & | prefix, | ||
| const ConnectionParameters & | params | ||
| ) | const |
Create a new RobotModule by disconnecting the provided RobotModule from this one
| other | The module that will be disconnected from this instance |
| this_body | Which body in this RobotModule was used to connect the two instances |
| other_body | Which body in the other RobotModule was used to connect the two instances |
| prefix | Prefix applied to every named entities in other before they were added to this module |
| params | Parameters that controlled how other was connected to this module, |
params.name is empty then prefix_other.name is removed from the name if present, otherwise params.name is used as the output nameparams.useGripperSafetyFromThis cannot be reversed if it was falseparams.useLIPMStabilizerConfigFromThis cannot be reversed if it was false| void mc_rbdyn::RobotModule::expand_stance | ( | ) |
Add missing elements to the current module stance
If joints are present in the MultiBody but absent from the default stance, this will add a default value for this joint to the stance (the joint's zero configuration).
|
inline |
Return the flexibilities of the robot
|
inline |
Return the force sensors of the robot
|
inlinenoexcept |
Returns a list of robot frames supported by this module
| void mc_rbdyn::RobotModule::generate_convexes | ( | bool | regenerate = false, |
| unsigned int | sampling_point = 4000 |
||
| ) |
Generate convex hulls for mesh collision geometries in the robot model.
Process all mesh-type collision geometries defined in the robot's URDF or SRDF and generates convex hulls for them, optionally regenerating them if needed.
Convex hulls are cached on disk in a per-variant directory under the user's local share path. If the cache is missing or regenerate is true, convex hulls will be rebuilt using the mesh_sampling utilities. Old cache directories for the same robot variant are deleted.
Mesh file URIs are resolved from:
package:// URIs (using ROS or fallback search paths)file:// URIs| regenerate | If true, forces regeneration of convexes even if cache exists. |
| sampling_point | Number of points to use when sampling the mesh for convex generation. |
| std::runtime_error | If mesh files cannot be resolved or read. |
LOCALAPPDATA%/<robot_name> on Windows$HOME/.local/share/<robot_name> on Linux/macOS
|
inline |
Return the grippers in the robot
|
inline |
Returns default gripper safety parameters if one is not provided by a gripper.
This can also be used to provide identical settings for every grippers in a robot
| void mc_rbdyn::RobotModule::init | ( | const rbd::parsers::ParserResult & | res | ) |
Initialize the module from a parser result
|
inline |
Returns the robot's jerk bounds
The vector should hold 2 string -> vector<double> map
Each map's keys are joint names and values are joint limits.
They should be provided in the following order:
|
inline |
Return the joint sensors of the robot
| void mc_rbdyn::RobotModule::make_default_ref_joint_order | ( | ) |
Make a valid ref_joint_order
If ref_joint_order() is empty, this will generate a list of actuated joints in the order they appear in the kinematic tree
|
inline |
Return a minimal self-collision set
This set of collision describe self-collisions that you always want to enable regardless of the application
|
inline |
Returns the list of parameters passed to mc_rbdyn::RobotLoader::get_robot_module to obtain this module
|
inline |
Returns the path to a "real" URDF file
This will be used to show a visually distinct robot for displaying the control and observed models simulatenously.
This defaults to urdf_path
|
inline |
Return the reference (native controller) joint order of the robot
If it is empty, make_default_ref_joint_order() will be used to generate one
|
inline |
Return the springs of a robot
|
inline |
Returns a default configuration for the robot
Keys are joint names and values are joint configurations.
It should be ok to include joints that are not in the robot (e.g. generate the same default stance for variants of a robot. However, each actuated joint in the robot should have a valid entry, see expand_stance
For the floating base see default_attitude
|
inline |
Returns a map describing the STPBV hulls for the robot
A key defines a valid collision name, a value is composed of two strings:
The transformation between the STPBV and the body it's attached to are provided in a separate map see collisionTransforms()
|
inline |
Returns the robot's torque-derivative bounds
The vector should hold 2 string -> vector<double> map
Each map's keys are joint names and values are joint limits.
They should be provided in the following order:
| accelerationBounds_t mc_rbdyn::RobotModule::_accelerationBounds |
| BodySensorVector mc_rbdyn::RobotModule::_bodySensors |
| std::vector<std::string> mc_rbdyn::RobotModule::_canonicalParameters |
| VisualMap mc_rbdyn::RobotModule::_collision |
Holds collision representation of bodies in the robot
| std::map<std::string, std::pair<std::string, S_ObjectPtr> > mc_rbdyn::RobotModule::_collisionObjects |
| std::map<std::string, sva::PTransformd> mc_rbdyn::RobotModule::_collisionTransforms |
| std::vector<mc_rbdyn::Collision> mc_rbdyn::RobotModule::_commonSelfCollisions |
| CompoundJointConstraintDescriptionVector mc_rbdyn::RobotModule::_compoundJoints |
| std::map<std::string, std::pair<std::string, std::string> > mc_rbdyn::RobotModule::_convexHull |
| std::array<double, 7> mc_rbdyn::RobotModule::_default_attitude = {{1., 0., 0., 0., 0., 0., 0.}} |
| DevicePtrVector mc_rbdyn::RobotModule::_devices |
| std::vector<Flexibility> mc_rbdyn::RobotModule::_flexibility |
| std::vector<ForceSensor> mc_rbdyn::RobotModule::_forceSensors |
| std::vector<FrameDescription> mc_rbdyn::RobotModule::_frames |
| std::vector<Gripper> mc_rbdyn::RobotModule::_grippers |
| Gripper::Safety mc_rbdyn::RobotModule::_gripperSafety |
| jerkBounds_t mc_rbdyn::RobotModule::_jerkBounds |
| std::vector<JointSensor> mc_rbdyn::RobotModule::_jointSensors |
| mc_rbdyn::lipm_stabilizer::StabilizerConfiguration mc_rbdyn::RobotModule::_lipmStabilizerConfig |
| std::vector<mc_rbdyn::Collision> mc_rbdyn::RobotModule::_minimalSelfCollisions |
| std::vector<std::string> mc_rbdyn::RobotModule::_parameters |
| std::string mc_rbdyn::RobotModule::_real_urdf |
| std::vector<std::string> mc_rbdyn::RobotModule::_ref_joint_order |
| std::map<std::string, std::vector<double> > mc_rbdyn::RobotModule::_stance |
| std::map<std::string, std::pair<std::string, std::string> > mc_rbdyn::RobotModule::_stpbvHull |
| torqueDerivativeBounds_t mc_rbdyn::RobotModule::_torqueDerivativeBounds |
| VisualMap mc_rbdyn::RobotModule::_visual |
Holds visual representation of bodies in the robot
| std::string mc_rbdyn::RobotModule::calib_dir |
Path to the robot's calib folder
| RobotConverterConfig mc_rbdyn::RobotModule::controlToCanonicalConfig |
Returns the configuration for the control to canonical conversion
The default configuration:
| std::function<void(const mc_rbdyn::Robot & control, mc_rbdyn::Robot & canonical)> mc_rbdyn::RobotModule::controlToCanonicalPostProcess |
| std::string mc_rbdyn::RobotModule::convex_dir |
Path to the robot's convex folder
| rbd::MultiBody mc_rbdyn::RobotModule::mb |
RBDyn representation of this robot
| rbd::MultiBodyConfig mc_rbdyn::RobotModule::mbc |
RBDyn configuration of this robot
| rbd::MultiBodyGraph mc_rbdyn::RobotModule::mbg |
RBDyn graph representation of this robot
| std::string mc_rbdyn::RobotModule::name |
(default) Name of the robot
| std::string mc_rbdyn::RobotModule::path |
Path to the robot's description package
| std::string mc_rbdyn::RobotModule::rsdf_dir |
Path to the robot's RSDF folder
| std::string mc_rbdyn::RobotModule::urdf_path |
Path to the robot's URDF file