pinocchio  3.9.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
Loading...
Searching...
No Matches
geometries.hpp
1//
2// Copyright (c) 2025 INRIA
3//
4
5#ifndef __pinocchio_parsers_graph_geometries_hpp__
6#define __pinocchio_parsers_graph_geometries_hpp__
7
8#include "pinocchio/parsers/graph/fwd.hpp"
9
10#include <Eigen/Core>
11
12#include <boost/variant/variant.hpp>
13
14#include <string>
15
16namespace pinocchio
17{
18 namespace graph
19 {
20 // Kind of possible geometry
21 enum struct GeomType
22 {
23 VISUAL,
24 COLLISION,
25 BOTH
26 };
27
28 struct Mesh
29 {
30 std::string path;
31
32 Mesh() = default;
33 explicit Mesh(const std::string & name_path)
34 : path(name_path)
35 {
36 }
37 };
38
39 struct Box
40 {
41 Eigen::Vector3d size = Eigen::Vector3d::Constant(0);
42
43 Box() = default;
44 explicit Box(const Eigen::Vector3d & size)
45 : size(size)
46 {
47 }
48 };
49
50 struct Cylinder
51 {
52 Eigen::Vector2d size = Eigen::Vector2d::Constant(0);
53
54 Cylinder() = default;
55 explicit Cylinder(const Eigen::Vector2d & size)
56 : size(size)
57 {
58 }
59 };
60
61 struct Capsule
62 {
63 Eigen::Vector2d size = Eigen::Vector2d::Constant(0);
64
65 Capsule() = default;
66 explicit Capsule(const Eigen::Vector2d & size)
67 : size(size)
68 {
69 }
70 };
71
72 struct Sphere
73 {
74 double radius = 0;
75
76 Sphere() = default;
77 explicit Sphere(const double r)
78 : radius(r)
79 {
80 }
81 };
82
83 typedef boost::variant<Mesh, Box, Cylinder, Capsule, Sphere> GeomVariant;
84
85 struct Geometry
86 {
87 std::string name;
88
89 GeomType type = GeomType::BOTH;
90
91 Eigen::Vector3d scale = Eigen::Vector3d::Constant(1);
92
93 Eigen::Vector4d color = Eigen::Vector4d::Constant(1);
94
95 SE3 placement = SE3::Identity();
96
97 GeomVariant geometry;
98
99 Geometry() = default;
100
101 Geometry(
102 const std::string & name,
103 const SE3 & placement,
104 const GeomType & type,
105 const Eigen::Vector3d & scale,
106 const Eigen::Vector4d & color,
107 const GeomVariant & geom)
108 : name(name)
109 , type(type)
110 , scale(scale)
111 , color(color)
112 , placement(placement)
113 , geometry(geom)
114 {
115 }
116 };
117 } // namespace graph
118} // namespace pinocchio
119
120#endif // ifndef __pinocchio_parsers_graph_geometries_hpp__
Main pinocchio namespace.
Definition treeview.dox:11