@@ -34,7 +34,7 @@ class Robot(Data):
34
34
Parameters
35
35
----------
36
36
model : :class:`compas_robots.RobotModel`
37
- The robot model, usually created from an URDF structure.
37
+ The robot model that describes robot kinematics, typically comes from an URDF structure.
38
38
scene_object : :class:`compas_robots.scene.BaseRobotModelObject`
39
39
Instance of the scene object used to visualize the robot model. Defaults to ``None``.
40
40
semantics : :class:`~compas_fab.robots.RobotSemantics`
@@ -48,9 +48,28 @@ class Robot(Data):
48
48
attributes : :obj:`dict`
49
49
Named attributes related to the robot instance.
50
50
attached_tools : :obj:`dict` of [:obj:`str`, :class:`~compas_fab.robots.Tool`], read-only
51
- Dictionary of tools and the planning groups that the tools are currently attached to, if any.
51
+ attached_tool : :class:`~compas_fab.robots.Tool`, read-only
52
+ client : :class:`~compas_fab.backends.interfaces.ClientInterface`
53
+ The backend client to use for communication.
54
+ group_names : :obj:`list` of :obj:`str`, read-only
55
+ group_states : :obj:`dict` of :obj:`dict`, read-only
56
+ scene_object : :class:`~compas_robots.scene.BaseRobotModelObject`
57
+ main_group_name : :obj:`str`, read-only
58
+ model : :class:`compas_robots.RobotModel`
59
+ The robot model that describes robot kinematics, typically comes from an URDF structure.
60
+ name : :obj:`str`, read-only
61
+ Name of the robot, as defined by its model.
62
+ root_name : :obj:`str`, read-only
63
+ semantics : :class:`~compas_fab.robots.RobotSemantics`
64
+ The semantic model of the robot. Can be ``None`` if not loaded.
65
+ scale_factor : :obj:`float`
66
+
52
67
"""
53
68
69
+ # NOTE: If the attribute function has a docstring, the first sentence will be used automatically in the class attribute's.
70
+ # However, the rest of the docstring, after the first fullstop symbol will be ignored.
71
+ # It is futile to add examples to the attribute docstrings, as they will not be rendered in the documentation.
72
+
54
73
def __init__ (self , model = None , scene_object = None , semantics = None , client = None ):
55
74
super (Robot , self ).__init__ ()
56
75
# These attributes have to be initiated first,
@@ -95,7 +114,7 @@ def __from_data__(cls, data):
95
114
96
115
@property
97
116
def scene_object (self ):
98
- """:class:`compas_robots.scene.BaseRobotModelObject`: Scene object used to visualize robot model."""
117
+ """Scene object used to visualize robot model."""
99
118
return self ._scene_object
100
119
101
120
@scene_object .setter
@@ -143,7 +162,11 @@ def basic(cls, name, joints=None, links=None, materials=None, **kwargs):
143
162
144
163
@property
145
164
def name (self ):
146
- """:obj:`str`: Name of the robot, as defined by its model.
165
+ """Name of the robot, as defined by its model.
166
+
167
+ Returns
168
+ -------
169
+ :obj:`str`
147
170
148
171
Examples
149
172
--------
@@ -155,7 +178,11 @@ def name(self):
155
178
156
179
@property
157
180
def group_names (self ):
158
- """:obj:`list` of :obj:`str`: All planning groups of the robot.
181
+ """All planning groups of the robot, only available if semantics is set.
182
+
183
+ Returns
184
+ -------
185
+ :obj:`list` of :obj:`str`
159
186
160
187
Examples
161
188
--------
@@ -169,18 +196,29 @@ def group_names(self):
169
196
170
197
@property
171
198
def main_group_name (self ):
172
- """:obj:`str`: Robot's main planning group."""
199
+ """
200
+ Robot's main planning group, only available if semantics is set.
201
+
202
+ Returns
203
+ -------
204
+ :obj:`str`
205
+
206
+ """
173
207
self .ensure_semantics ()
174
208
return self .semantics .main_group_name
175
209
176
210
@property
177
211
def root_name (self ):
178
- """:obj:`str`: Robot's root name."""
212
+ """Robot's root name."""
179
213
return self .model .root .name
180
214
181
215
@property
182
216
def group_states (self ):
183
- """:obj:`dict` of :obj:`dict`: All group states of the robot.
217
+ """All group states of the robot, only available if semantics is set.
218
+
219
+ Returns
220
+ -------
221
+ :obj:`dict` of :obj:`dict`
184
222
185
223
Examples
186
224
--------
@@ -194,12 +232,12 @@ def group_states(self):
194
232
195
233
@property
196
234
def attached_tools (self ):
197
- """:obj:`dict` of :obj:`robot.Tool`: Maps planning group to the tool attached to it """
235
+ """Dictionary of tools and the planning groups that the tools are currently attached to, if any. """
198
236
return self ._attached_tools
199
237
200
238
@property
201
239
def attached_tool (self ):
202
- """:obj:`robot.Tool`: For backwards compatibility. Returns the tool attached to the default group, or None ."""
240
+ """Returns the tool attached to the default main planning group, if any ."""
203
241
return self ._attached_tools .get (self .main_group_name , None )
204
242
205
243
def get_end_effector_link_name (self , group = None ):
@@ -1986,7 +2024,10 @@ def scale(self, factor):
1986
2024
1987
2025
@property
1988
2026
def scale_factor (self ):
1989
- """:obj:`float`: Robot's scale factor."""
2027
+ """A scale factor affecting planning targets, results and visualizaion; Typically, robot models are defined in meters,
2028
+ if used in CAD environemnt where units is mm, use a scale_factor of 1000.
2029
+
2030
+ """
1990
2031
if self .scene_object :
1991
2032
return self .scene_object .scale_factor
1992
2033
else :
0 commit comments