in src/rosbridge/fetch_proxy.py [0:0]
def __init__(self, api, obs_joints=True, obs_lidar=False, obs_head_depth=True, obs_head_rgb=False, act_torques=True):
self.api = api
self.obs_joints = obs_joints
self.obs_lidar = obs_lidar
self.obs_head_depth = obs_head_depth
self.obs_head_rgb = obs_head_rgb
self.act_torques = act_torques
obsparts = []
if self.obs_joints:
obsparts.append(Box(-4, +4, self.api.cur_joint_pos.shape))
obsparts.append(Box(-4, +4, self.api.cur_joint_vel.shape))
if self.obs_lidar:
obsparts.append(Box(0, +16.0, self.api.cur_base_scan.shape))
if self.obs_head_depth:
obsparts.append(Box(0, 5.0, self.api.cur_head_camera_depth_image.shape))
if self.obs_head_rgb:
obsparts.append(Box(0, 255, self.api.cur_head_camera_rgb_image.shape))
self.observation_space = Tuple(obsparts)
actparts = []
if self.act_torques:
actparts.append(Box(-1.0, +1.0, [len(self.api.joint_names)]))
self.action_space = Tuple(actparts)
self.reward_range = [-1, +1]
self.tickrate = rospy.Rate(10)
self.api.start_timeseq('fetch')
self.api.start_axis_video()