Skip to content

Commit 1a32b5b

Browse files
committed
Corrected class docstring attributes/params
1 parent 8342eef commit 1a32b5b

File tree

1 file changed

+88
-4
lines changed

1 file changed

+88
-4
lines changed

src/compas_fab/robots/constraints.py

Lines changed: 88 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,33 @@ class BoundingVolume(object):
2020
The volume can be either a :class:`compas.geometry.Box`, a
2121
:class:`compas.geometry.Sphere`, or a
2222
:class:`compas.datastructures.Mesh`.
23+
24+
Attributes
25+
----------
26+
volume_type
27+
The type of bounding volume, one of :attr:`BoundingVolume.VOLUME_TYPES`.
28+
volume : :class:`compas.datastructures.Mesh` or :class:`compas.geometry.Primitive`
29+
The volume can be either a :class:`compas.geometry.Box`, a
30+
:class:`compas.geometry.Sphere`, or a
31+
:class:`compas.datastructures.Mesh`.
32+
33+
Class attributes
34+
----------------
35+
BOX
36+
Box bounding volume type.
37+
SPHERE
38+
Sphere bounding volume type.
39+
MESH
40+
Mesh bounding volume type.
41+
VOLUME_TYPES
42+
List of supported bounding volume types.
2343
"""
2444

25-
#: Box volume type
45+
#: Box bounding volume type
2646
BOX = 1
27-
#: Sphere volume type
47+
#: Sphere bounding volume type
2848
SPHERE = 2
29-
#: Mesh volume type
49+
#: Mesh bounding volume type
3050
MESH = 3
3151

3252
#: List of supported volume types
@@ -160,6 +180,26 @@ class Constraint(object):
160180
A weighting factor for this constraint. Denotes relative importance to
161181
other constraints. Closer to zero means less important. Defaults to
162182
``1``.
183+
184+
Attributes
185+
----------
186+
constraint_type
187+
Constraint type, one of :attr:`Constraint.CONSTRAINT_TYPES`.
188+
weight : :obj:`float`, optional
189+
A weighting factor for this constraint. Denotes relative importance to
190+
other constraints. Closer to zero means less important. Defaults to
191+
``1``.
192+
193+
Class Attributes
194+
----------------
195+
JOINT
196+
Joint constraint type.
197+
POSITION
198+
Positional constraint type.
199+
ORIENTATION
200+
Orientational constraint type.
201+
CONSTRAINT_TYPES
202+
List of possible constraint types.
163203
"""
164204

165205
#: Joint constraint type.
@@ -227,6 +267,21 @@ class JointConstraint(Constraint):
227267
other constraints. Closer to zero means less important. Defaults to
228268
``1``.
229269
270+
Attributes
271+
----------
272+
joint_name : :obj:`str`
273+
The name of the joint this contraint refers to.
274+
value : :obj:`float`
275+
The targeted value for that joint.
276+
tolerance_above : :obj:`float`
277+
Tolerance above the targeted joint value, in radians. Defaults to ``0``.
278+
tolerance_below : :obj:`float`
279+
Tolerance below the targeted joint value, in radians. Defaults to ``0``.
280+
weight : :obj:`float`, optional
281+
A weighting factor for this constraint. Denotes relative importance to
282+
other constraints. Closer to zero means less important. Defaults to
283+
``1``.
284+
230285
Examples
231286
--------
232287
>>> from compas_fab.robots import JointConstraint
@@ -287,6 +342,23 @@ class OrientationConstraint(Constraint):
287342
other constraints. Closer to zero means less important. Defaults to
288343
``1``.
289344
345+
Attributes
346+
----------
347+
link_name : :obj:`str`
348+
The name of the link this contraint refers to.
349+
quaternion : :obj:`list` of :obj:`float`
350+
The desired orientation of the link specified by a quaternion in the
351+
order of ``[w, x, y, z]``.
352+
tolerances : :obj:`list` of :obj:`float`, optional
353+
Error tolerances t\ :sub:`i` for each of the frame's axes. If only one
354+
value is passed it will be used for all 3 axes. The respective bound to
355+
be achieved is :math:`(a_{i} - t_{i}, a_{i} + t_{i})`. Defaults to
356+
``[0.01, 0.01, 0.01]``.
357+
weight : :obj:`float`, optional
358+
A weighting factor for this constraint. Denotes relative importance to
359+
other constraints. Closer to zero means less important. Defaults to
360+
``1``.
361+
290362
Notes
291363
-----
292364
The rotation tolerance for an axis is defined by the other vector component
@@ -348,7 +420,19 @@ class PositionConstraint(Constraint):
348420
The volume this constraint refers to.
349421
weight : :obj:`float`, optional
350422
A weighting factor for this constraint. Denotes relative importance to
351-
other constraints. Closer to zero means less important. Defaults to ``1``.
423+
other constraints. Closer to zero means less important. Defaults to
424+
``1``.
425+
426+
Attributes
427+
----------
428+
link_name : :obj:`str`
429+
The name of the link this contraint refers to.
430+
bounding_volume : :class:`BoundingVolume`
431+
The volume this constraint refers to.
432+
weight : :obj:`float`, optional
433+
A weighting factor for this constraint. Denotes relative importance to
434+
other constraints. Closer to zero means less important. Defaults to
435+
``1``.
352436
353437
Examples
354438
--------

0 commit comments

Comments
 (0)