lfd.environment package¶
Class inheritance diagram¶
Submodules¶
lfd.environment.environment module¶
lfd.environment.settings module¶
-
lfd.environment.settings.
CAMERA_MATRIX
= [[0, 1, 0, 0], [-1, 0, 0.5, 0], [0.5, 0, 1, 0], [2.25, 0, 4.5, 1]]¶ transposed homogeneous matrix for the viewer’s camera
-
lfd.environment.settings.
GRIPPER_OPEN_CLOSE_THRESH
= 0.04¶
-
lfd.environment.settings.
ROPE_ANG_DAMPING
= 1¶
-
lfd.environment.settings.
ROPE_ANG_LIMIT
= 0.4¶
-
lfd.environment.settings.
ROPE_ANG_STIFFNESS
= 0.1¶
-
lfd.environment.settings.
ROPE_LIN_DAMPING
= 0.75¶
-
lfd.environment.settings.
ROPE_LIN_STOP_ERP
= 0.2¶
-
lfd.environment.settings.
ROPE_MASS
= 1.0¶
-
lfd.environment.settings.
ROPE_RADIUS
= 0.005¶
-
lfd.environment.settings.
ROPE_RADIUS_THICK
= 0.008¶
-
lfd.environment.settings.
WINDOW_PROP
= [0, 0, 1500, 1500]¶ window properties for the viewer’s window
lfd.environment.sim_util module¶
-
class
lfd.environment.sim_util.
RopeState
(init_rope_nodes, rope_params, tfs=None)[source]¶ Bases:
object
-
class
lfd.environment.sim_util.
SceneState
(cloud, rope_nodes, rope_state, id=None, color=None)[source]¶ Bases:
object
-
ids
= set([])¶
-
-
lfd.environment.sim_util.
get_ee_traj
(robot, lr, arm_traj_or_full_traj, ee_link_name_fmt='%s_gripper_tool_frame')[source]¶
-
lfd.environment.sim_util.
get_finger_pts_traj
(robot, lr, full_traj_or_ee_finger_traj)[source]¶ ee_traj = sim_util.get_ee_traj(robot, lr, arm_traj) flr2finger_pts_traj1 = get_finger_pts_traj(robot, lr, (ee_traj, finger_traj))
full_traj = sim_util.get_full_traj(robot, {lr:arm_traj}, {lr:finger_traj}) flr2finger_pts_traj2 = get_finger_pts_traj(robot, lr, full_traj)
-
lfd.environment.sim_util.
get_full_traj
(robot, lr2arm_traj, lr2finger_traj={})[source]¶ A full trajectory is a tuple of a trajectory (np matrix) and dof indices (list)
-
lfd.environment.sim_util.
gripper_joint2gripper_l_finger_joint_values
(gripper_joint_vals)[source]¶ Only the %s_gripper_l_finger_joint%lr can be controlled (this is the joint returned by robot.GetManipulator({“l”:”leftarm”, “r”:”rightarm”}[lr]).GetGripperIndices()) The rest of the gripper joints (like %s_gripper_joint%lr) are mimiced and cannot be controlled directly
-
lfd.environment.sim_util.
grippers_exceed_rope_length
(sim_env, full_traj, thresh)[source]¶ Let min_length be the minimun length of the rope between the parts being held by the left and right gripper. This function returns a mask of the trajectory steps in which the distance between the grippers doesn’t exceed min_length-thresh. If not both of the grippers are holding the rope, this function return None.
-
lfd.environment.sim_util.
load_fake_data_segment
(demofile, fake_data_segment, fake_data_transform)[source]¶
-
lfd.environment.sim_util.
replace_rope
(new_rope, sim_env, rope_params, restore=False)[source]¶ restore indicates if this function is being called to restore an existing rope, in which case the color of the rope is saved and restored
-
lfd.environment.sim_util.
set_gripper_maybesim
(sim_env, lr, is_open, prev_is_open, animate=False)[source]¶
-
lfd.environment.sim_util.
sim_full_traj_maybesim
(sim_env, full_traj, animate=False, interactive=False, max_cart_vel_trans_traj=0.05)[source]¶
-
lfd.environment.sim_util.
sim_traj_maybesim
(sim_env, lr2traj, animate=False, interactive=False, max_cart_vel_trans_traj=0.05)[source]¶
lfd.environment.simulation module¶
-
class
lfd.environment.simulation.
DynamicRopeSimulationRobotWorld
(env=None, T_w_k=None, range_k=2.0)[source]¶ Bases:
lfd.environment.simulation.DynamicSimulationRobotWorld
-
class
lfd.environment.simulation.
DynamicSimulation
(env=None)[source]¶ Bases:
lfd.environment.simulation.StaticSimulation
-
set_state
(sim_state)[source]¶ Defined such that execution1 and execution2 gives the same results if execution1 == execution2 in the following code:
set_state(sim_state) execution1() set_state(sim_state) execution2()
-
-
class
lfd.environment.simulation.
DynamicSimulationRobotWorld
(env=None, T_w_k=None, range_k=2.0)[source]¶ Bases:
lfd.environment.simulation.DynamicSimulation
,lfd.environment.robot_world.RobotWorld
-
close_gripper
(lr, step_viewer=1, max_vel=0.02, close_dist_thresh=0.004, grab_dist_thresh=0.005)[source]¶
-
lfd.environment.simulation_object module¶
-
class
lfd.environment.simulation_object.
BoxSimulationObject
(name, translation, extents, dynamic=True)[source]¶ Bases:
lfd.environment.simulation_object.XmlSimulationObject
-
class
lfd.environment.simulation_object.
CylinderSimulationObject
(name, translation, radius, height, dynamic=True)[source]¶ Bases:
lfd.environment.simulation_object.XmlSimulationObject
-
class
lfd.environment.simulation_object.
RopeSimulationObject
(name, ctrl_points, rope_params=None, dynamic=True, upsample=0, upsample_rad=1)[source]¶ Bases:
lfd.environment.simulation_object.SimulationObject
-
add_after
= True¶
-