pinocchio  3.9.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Loading...
Searching...
No Matches
ModelGraph Struct Reference

Represents multibody model as a bidirectional graph. More...

#include <pinocchio/parsers/graph/model-graph.hpp>

Public Types

typedef boost::graph_traits< Graph >::edge_descriptor EdgeDesc
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, ModelGraphVertex, ModelGraphEdgeGraph
typedef boost::graph_traits< Graph >::vertex_descriptor VertexDesc

Public Member Functions

void addBody (const std::string &vertex_name, const Inertia &inert)
 Add a new body to the graph.
void addFrame (const std::string &vertex_name, const FrameVariant &frame)
 Add a new vertex to the graph.
void addGeometries (const std::string &vertex_name, const std::vector< Geometry > &geoms)
void addGeometry (const std::string &vertex_name, const Geometry &geom)
void addJoint (const EdgeParameters &params)
 Add edges (joint) to the graph. Since it's a bidirectional graph, edge and its reverse are added to the graph.
void addJoint (const std::string &joint_name, const JointVariant &joint, const std::string &source_body, const SE3 &source_to_joint, const std::string &target_body, const SE3 &joint_to_target)
 Add edges (joint) to the graph. Since it's a bidirectional graph, edge and its reverse are added to the graph.
void appendGraph (const ModelGraph &g)
 add all the vertex and edges from a graph to this one. Attention : it does not add an edge between the two, so it will be like having two graph coexisting in this structure.
EdgeBuilder edgeBuilder ()
 Create an EdgeBuilde. This will allow to use EdgeBuilder interface to have a more flexible edge configuration.
GeometryBuilder geometryBuilder ()

Public Attributes

Graph graph
 Boost graph structure that holds the graph structure.
std::unordered_map< std::string, VertexDesc > name_to_vertex
 Name of the vertexes in the graph. Useful for graph parcours.

Detailed Description

Represents multibody model as a bidirectional graph.

This is an intermediate step before creating a model, that allows more flexibility as to which body will be the root...

Definition at line 91 of file model-graph.hpp.

Member Typedef Documentation

◆ EdgeDesc

typedef boost::graph_traits<Graph>::edge_descriptor EdgeDesc

Definition at line 97 of file model-graph.hpp.

◆ Graph

typedef boost:: adjacency_list<boost::vecS, boost::vecS, boost::directedS, ModelGraphVertex, ModelGraphEdge> Graph

Definition at line 95 of file model-graph.hpp.

◆ VertexDesc

typedef boost::graph_traits<Graph>::vertex_descriptor VertexDesc

Definition at line 96 of file model-graph.hpp.

Member Function Documentation

◆ addBody()

void addBody(const std::string &vertex_name,
const Inertia &inert )

Add a new body to the graph.

Parameters
[in]vertex_nameName of the vertex
[in]inertinertia of the body

◆ addFrame()

void addFrame(const std::string &vertex_name,
const FrameVariant &frame )

Add a new vertex to the graph.

Parameters
[in]vertex_nameName of the vertex
[in]framewhich type of frame will be added to the model (op_frame, sensor, body)

◆ addJoint() [1/2]

void addJoint(const EdgeParameters &params)

Add edges (joint) to the graph. Since it's a bidirectional graph, edge and its reverse are added to the graph.

Parameters
[in]paramsStructure that holds all of the joint parameters
Note
Since it's a bidirectional graph, two edges are added to the graph. Joints and transformation are inverted, to create reverse edge.

◆ addJoint() [2/2]

void addJoint(const std::string &joint_name,
const JointVariant &joint,
const std::string &source_body,
const SE3 &source_to_joint,
const std::string &target_body,
const SE3 &joint_to_target )

Add edges (joint) to the graph. Since it's a bidirectional graph, edge and its reverse are added to the graph.

Parameters
[in]joint_nameName of the edge
[in]jointType of the joint
[in]source_bodyVertex that is supporting the edge
[in]source_to_jointTransformation from supporting vertex to edge
[in]target_bodyVertex that is supported by edge
[in]joint_to_targetTransformation from edge to supported vertex
Note
Since it's a bidirectional graph, two edges are added to the graph. Joints and transformation are inverted, to create reverse edge.

◆ appendGraph()

void appendGraph(const ModelGraph &g)

add all the vertex and edges from a graph to this one. Attention : it does not add an edge between the two, so it will be like having two graph coexisting in this structure.

Parameters
ggraph that will be added

Member Data Documentation

◆ graph

Graph graph

Boost graph structure that holds the graph structure.

Definition at line 158 of file model-graph.hpp.

◆ name_to_vertex

std::unordered_map<std::string, VertexDesc> name_to_vertex

Name of the vertexes in the graph. Useful for graph parcours.

Definition at line 160 of file model-graph.hpp.


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