11from __future__ import print_function
22
33import logging
4- import math
54import socket
65from timeit import default_timer as timer
76
8- from compas .datastructures import Mesh
97from compas .geometry import Frame
108from compas .geometry import matrix_from_frame
119
1210from compas_fab .backends .exceptions import BackendError
1311from compas_fab .backends .vrep .remote_api import vrep
1412from compas_fab .robots import Configuration
15- from compas_fab .robots import Robot
1613
1714DEFAULT_SCALE = 1.
1815DEFAULT_OP_MODE = vrep .simx_opmode_blocking
@@ -61,9 +58,9 @@ class VrepClient(object):
6158 For more examples, check out the :ref:`V-REP examples page <examples_vrep>`.
6259 """
6360 SUPPORTED_PLANNERS = ('bitrrt' , 'bkpiece1' , 'est' , 'kpiece1' ,
64- 'lazyprmstar' , 'lbkpiece1' , 'lbtrrt' , 'pdst' ,
65- 'prm' , 'prrt' , 'rrt' , 'rrtconnect' , 'rrtstar' ,
66- 'sbl' , 'stride' , 'trrt' )
61+ 'lazyprmstar' , 'lbkpiece1' , 'lbtrrt' , 'pdst' ,
62+ 'prm' , 'prrt' , 'rrt' , 'rrtconnect' , 'rrtstar' ,
63+ 'sbl' , 'stride' , 'trrt' )
6764
6865 def __init__ (self , host = '127.0.0.1' , port = 19997 , scale = DEFAULT_SCALE , lua_script = 'RFL' , debug = False ):
6966 super (VrepClient , self ).__init__ ()
@@ -176,7 +173,7 @@ def set_robot_metric(self, robot, metric_values):
176173 effectively removes one degree of freedom (DOF).
177174
178175 Args:
179- robot (:class:`Robot`): Robot instance.
176+ robot (:class:`compas_fab.robots. Robot`): Robot instance.
180177 metric_values (:obj:`list` of :obj:`float`): List containing one value
181178 per configurable joint. Each value ranges from 0 to 1.
182179 """
@@ -192,7 +189,7 @@ def set_robot_pose(self, robot, frame):
192189 """Moves the robot to a given pose, specified as a frame.
193190
194191 Args:
195- robot (:class:`Robot`): Robot instance to move.
192+ robot (:class:`compas_fab.robots. Robot`): Robot instance to move.
196193 frame (:class:`Frame`): Target or goal frame.
197194
198195 Returns:
@@ -215,7 +212,7 @@ def set_robot_config(self, robot, config):
215212 """Moves the robot to the specified configuration.
216213
217214 Args:
218- robot (:class:`Robot`): Robot instance to move.
215+ robot (:class:`compas_fab.robots. Robot`): Robot instance to move.
219216 config (:class:`Configuration` instance): Describes the position of the
220217 robot as an instance of :class:`Configuration`.
221218
@@ -243,7 +240,7 @@ def get_robot_config(self, robot):
243240 """Gets the current configuration of the specified robot.
244241
245242 Args:
246- robot (:class:`Robot`): Robot instance.
243+ robot (:class:`compas_fab.robots. Robot`): Robot instance.
247244
248245 Examples:
249246
@@ -265,7 +262,7 @@ def forward_kinematics(self, robot):
265262 """Calculates forward kinematics to get the current end-effector pose.
266263
267264 Args:
268- robot (:class:`Robot`): Robot instance.
265+ robot (:class:`compas_fab.robots. Robot`): Robot instance.
269266
270267 Examples:
271268
@@ -279,15 +276,15 @@ def forward_kinematics(self, robot):
279276 assert_robot (robot )
280277
281278 _res , _ , pose , _ , _ = self .run_child_script ('getIkTipPose' ,
282- [robot .model .attr ['index' ]],
283- [], [])
279+ [robot .model .attr ['index' ]],
280+ [], [])
284281 return vrep_pose_to_frame (pose , self .scale )
285282
286283 def inverse_kinematics (self , robot , goal_frame , metric_values = None , gantry_joint_limits = None , arm_joint_limits = None , max_trials = None , max_results = 1 ):
287284 """Calculates inverse kinematics to find valid robot configurations for the specified goal frame.
288285
289286 Args:
290- robot (:class:`Robot`): Robot instance.
287+ robot (:class:`compas_fab.robots. Robot`): Robot instance.
291288 goal_frame (:class:`Frame`): Target or goal frame.
292289 metric_values (:obj:`list` of :obj:`float`): List containing one value
293290 per configurable joint. Each value ranges from 0 to 1,
@@ -357,7 +354,7 @@ def pick_building_member(self, robot, building_member_mesh, pickup_frame, metric
357354 """Picks up a building member and attaches it to the robot.
358355
359356 Args:
360- robot (:class:`Robot`): Robot instance to use for pick up.
357+ robot (:class:`compas_fab.robots. Robot`): Robot instance to use for pick up.
361358 building_member_mesh (:class:`compas.datastructures.Mesh`): Mesh
362359 of the building member that will be attached to the robot.
363360 pickup_pose (:class:`Frame`): Pickup frame.
@@ -455,7 +452,7 @@ def plan_motion_to_config(self, robot, goal_configs, metric_values=None, collisi
455452 specific goal configuration.
456453
457454 Args:
458- robot (:class:`Robot`): Robot instance to move.
455+ robot (:class:`compas_fab.robots. Robot`): Robot instance to move.
459456 goal_configs (:obj:`list` of :class:`Configuration`): List of target or goal configurations.
460457 metric_values (:obj:`list` of :obj:`float`): List containing one value
461458 per configurable joint. Each value ranges from 0 to 1,
@@ -493,7 +490,7 @@ def plan_motion(self, robot, goal_frame, metric_values=None, collision_meshes=No
493490 """Find a path plan to move the selected robot from its current position to the `goal_frame`.
494491
495492 Args:
496- robot (:class:`Robot`): Robot instance to move.
493+ robot (:class:`compas_fab.robots. Robot`): Robot instance to move.
497494 goal_frame (:class:`Frame`): Target or goal frame.
498495 metric_values (:obj:`list` of :obj:`float`): List containing one value
499496 per configurable joint. Each value ranges from 0 to 1,
@@ -529,7 +526,7 @@ def add_building_member(self, robot, building_member_mesh):
529526 """Adds a building member to the 3D scene and attaches it to the robot.
530527
531528 Args:
532- robot (:class:`Robot`): Robot instance to attach the building member to.
529+ robot (:class:`compas_fab.robots. Robot`): Robot instance to attach the building member to.
533530 building_member_mesh (:class:`compas.datastructures.Mesh`): Mesh
534531 of the building member that will be attached to the robot.
535532
0 commit comments