mirage.benchmark.robosuite.evaluate_policy_demo_source_robot_server.SourceRobot#

class mirage.benchmark.robosuite.evaluate_policy_demo_source_robot_server.SourceRobot(robot_name=None, ckpt_path=None, render=False, video_path=None, rollout_horizon=None, seed=None, dataset_path=None, connection=None, port=50007, passive=True, demo_path=None, inpaint_enabled=False, forward_dynamics_model_path='', save_paired_images=False, save_paired_images_folder_path=None, device=None, save_failed_demos=False, naive=False, save_stats_path=None)#

Bases: Robot

__init__(robot_name=None, ckpt_path=None, render=False, video_path=None, rollout_horizon=None, seed=None, dataset_path=None, connection=None, port=50007, passive=True, demo_path=None, inpaint_enabled=False, forward_dynamics_model_path='', save_paired_images=False, save_paired_images_folder_path=None, device=None, save_failed_demos=False, naive=False, save_stats_path=None)#

_summary_

Args:

robot_name (string, optional): one of [Sawyer, UR5e, Panda, Kinova3, Jaco, IIWA]. If None, then the robot name is read from the checkpoint. ckpt_path (string, optional): render (bool, optional): video_path (string, optional): rollout_horizon (int, optional): seed (int, optional): connection (socket, optional):

Methods

__init__([robot_name, ckpt_path, render, ...])

_summary_

compute_eef_pose()

return a 7D or 14D pose vector

compute_pose_error(target_pose)

drive_robot_to_target_pose([target_pose, ...])

get_object_state()

initialize_robot()

rollout_robot([video_skip, return_obs, ...])

Helper function to carry out rollouts.

run_experiments(seeds[, ...])

target_robot_delta_action only affects the target robot.

set_object_state([set_to_target_object_state])

set_seed(seed)

step(action[, use_delta, blocking, ...])

If not blocking, action is EEF (delta) pose (6DOF) + gripper If blocking, action is EEF target state (7DOF using quarternion) + gripper

compute_eef_pose()#

return a 7D or 14D pose vector

rollout_robot(video_skip=5, return_obs=False, camera_names=None, set_object_state=False, set_robot_pose=False, tracking_error_threshold=0.003, num_iter_max=100, target_robot_delta_action=False, demo_index=0)#

Helper function to carry out rollouts. Supports on-screen rendering, off-screen rendering to a video, and returns the rollout trajectory.

The source robot will:
  • optionally receive the target object state and/or target robot pose from the target robot, and then set its environment to that state and/or pose.

  • Then, the source robot will execute the action from the policy as usual from its own environment.

  • Then, it will send the action command and the actual achieved pose to the target robot.

Args:

video_skip (int): how often to write video frames return_obs (bool): if True, return possibly high-dimensional observations along the trajectoryu.

They are excluded by default because the low-dimensional simulation states should be a minimal representation of the environment.

camera_names (list): determines which camera(s) are used for rendering. Pass more than

one to output a video with multiple camera views concatenated horizontally.

Returns:

stats (dict): some statistics for the rollout - such as return, horizon, and task success traj (dict): dictionary that corresponds to the rollout trajectory

run_experiments(seeds, rollout_num_episodes=1, video_skip=5, camera_names='agentview', dataset_obs=False, save_stats_path=None, tracking_error_threshold=0.003, num_iter_max=100, target_robot_delta_action=False, inpaint_online_eval=False)#

target_robot_delta_action only affects the target robot. Default is to track the absolute pose of the source robot.

step(action, use_delta=True, blocking=False, tracking_error_threshold=0.003, num_iter_max=100, goal_pose=None, name='Source Robot')#

If not blocking, action is EEF (delta) pose (6DOF) + gripper If blocking, action is EEF target state (7DOF using quarternion) + gripper