File tree Expand file tree Collapse file tree 5 files changed +16
-11
lines changed
src/compas_fab/backends/vrep Expand file tree Collapse file tree 5 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ Unreleased
1818**Changed **
1919
2020* The `Configuration ` class has moved to `compas.robots `, but is still aliased within `compas_fab.robots `
21+ * Lazily load `V-REP remoteApi ` library
2122
2223**Fixed **
2324
Original file line number Diff line number Diff line change 22from __future__ import division
33from __future__ import print_function
44
5- from compas_fab .backends .vrep . helpers import assert_robot
5+ from compas_fab .backends .interfaces import AddAttachedCollisionMesh
66from compas_fab .backends .vrep .helpers import DEFAULT_OP_MODE
77from compas_fab .backends .vrep .helpers import VrepError
8- from compas_fab .backends .interfaces import AddAttachedCollisionMesh
9- from compas_fab .backends . vrep . remote_api import vrep
8+ from compas_fab .backends .vrep . helpers import assert_robot
9+ from compas_fab .utilities import LazyLoader
1010
1111__all__ = [
1212 'VrepAddAttachedCollisionMesh' ,
1313]
1414
15+ vrep = LazyLoader ('vrep' , globals (), 'compas_fab.backends.vrep.remote_api.vrep' )
16+
1517
1618class VrepAddAttachedCollisionMesh (AddAttachedCollisionMesh ):
1719 """Callable to add a building member to the 3D scene and attach it to the robot.
Original file line number Diff line number Diff line change 22from __future__ import division
33from __future__ import print_function
44
5- from compas_fab .backends .vrep .helpers import DEFAULT_OP_MODE
6- from compas_fab .backends .vrep .remote_api import vrep
75from compas_fab .backends .interfaces import RemoveCollisionMesh
8-
6+ from compas_fab .backends .vrep .helpers import DEFAULT_OP_MODE
7+ from compas_fab .utilities import LazyLoader
98
109__all__ = [
1110 'VrepRemoveCollisionMesh' ,
1211]
1312
13+ vrep = LazyLoader ('vrep' , globals (), 'compas_fab.backends.vrep.remote_api.vrep' )
14+
1415
1516class VrepRemoveCollisionMesh (RemoveCollisionMesh ):
1617 """Callable to remove collision meshes from the 3D scene.
Original file line number Diff line number Diff line change 22
33import logging
44
5- from compas_fab .backends .vrep .helpers import DEFAULT_OP_MODE
65from compas_fab .backends .interfaces .client import ClientInterface
76from compas_fab .backends .vrep import VrepError
7+ from compas_fab .backends .vrep .helpers import DEFAULT_OP_MODE
88from compas_fab .backends .vrep .helpers import assert_robot
99from compas_fab .backends .vrep .helpers import config_from_vrep
1010from compas_fab .backends .vrep .helpers import config_to_vrep
1111from compas_fab .backends .vrep .helpers import floats_from_vrep
1212from compas_fab .backends .vrep .helpers import floats_to_vrep
1313from compas_fab .backends .vrep .helpers import resolve_host
1414from compas_fab .backends .vrep .planner import VrepPlanner
15- from compas_fab .backends . vrep . remote_api import vrep
15+ from compas_fab .utilities import LazyLoader
1616
1717DEFAULT_SCALE = 1.
18- CHILD_SCRIPT_TYPE = vrep .sim_scripttype_childscript
18+ CHILD_SCRIPT_TYPE = 1 # defined in vrepConst .sim_scripttype_childscript, but redefined here to prevent loading the remoteApi library
1919LOG = logging .getLogger ('compas_fab.backends.vrep.client' )
2020
21+ vrep = LazyLoader ('vrep' , globals (), 'compas_fab.backends.vrep.remote_api.vrep' )
22+
2123__all__ = [
2224 'VrepClient' ,
2325]
Original file line number Diff line number Diff line change 55from compas .robots import Configuration
66
77from compas_fab .backends .exceptions import BackendError
8- from compas_fab .backends .vrep .remote_api import vrep
98
109
1110__all__ = [
1211 'VrepError' ,
1312]
1413
15- DEFAULT_OP_MODE = vrep .simx_opmode_blocking
14+ DEFAULT_OP_MODE = 0x010000 # defined in vrepConst .simx_opmode_blocking, but redefined here to prevent loading the remoteApi library
1615
1716# --------------------------------------------------------------------------
1817# MAPPINGS
You can’t perform that action at this time.
0 commit comments