VrepClient
-
class
compas_fab.backends.
VrepClient
(host='127.0.0.1', port=19997, scale=1.0, lua_script='RFL', debug=False)[source] Bases:
object
Interface to run simulations using VREP as the engine for kinematics and path planning.
VrepClient
is a context manager type, so it’s best used in combination with thewith
statement to ensure resource deallocation.- Parameters
Examples
>>> from compas_fab.backends import VrepClient >>> with VrepClient() as client: ... print ('Connected: %s' % client.is_connected) Connected: True
Note
For more examples, check out the V-REP examples page.
Methods
__init__
([host, port, scale, lua_script, debug])Initialize self.
add_building_member
(robot, building_member_mesh)Adds a building member to the 3D scene and attaches it to the robot.
add_meshes
(meshes)Adds meshes to the 3D scene.
forward_kinematics
(robot)Calculates forward kinematics to get the current end-effector pose.
Gets a list of object handles (identifiers) for all visible shapes of the 3D model.
get_object_handle
(object_name)Gets the object handle (identifier) for a given object name.
get_object_matrices
(object_handles)Gets a dictionary of matrices keyed by object handle.
get_robot_config
(robot)Gets the current configuration of the specified robot.
inverse_kinematics
(robot, goal_frame[, …])Calculates inverse kinematics to find valid robot configurations for the specified goal frame.
pick_building_member
(robot, …[, metric_values])Picks up a building member and attaches it to the robot.
plan_motion
(robot, goal_frame[, …])Find a path plan to move the selected robot from its current position to the goal_frame.
plan_motion_to_config
(robot, goal_configs[, …])Find a path plan to move the selected robot from its current position to one of the goal_configs.
remove_meshes
(mesh_handles)Removes meshes from the 3D scene.
remove_objects
(object_handles)Removes objects from the 3D scene.
run_child_script
(function_name, in_ints, …)set_robot_config
(robot, config)Moves the robot to the specified configuration.
set_robot_metric
(robot, metric_values)Assigns a metric defining relations between axis values of a robot.
set_robot_pose
(robot, frame)Moves the robot to a given pose, specified as a frame.
Attributes
SUPPORTED_PLANNERS
is_connected
Indicates whether the client has an active connection.