change accessing body position in beerpong.py
This commit is contained in:
parent
a7051cd8b7
commit
4437ab9577
@ -144,16 +144,15 @@ class ALRBeerBongEnv(MujocoEnv, utils.EzPickle):
|
|||||||
infos.update(reward_infos)
|
infos.update(reward_infos)
|
||||||
return ob, reward, done, infos
|
return ob, reward, done, infos
|
||||||
|
|
||||||
def _check_traj_in_joint_limits(self):
|
# def _check_traj_in_joint_limits(self):
|
||||||
return any(self.current_pos > self.j_max) or any(self.current_pos < self.j_min)
|
# return any(self.current_pos > self.j_max) or any(self.current_pos < self.j_min)
|
||||||
|
|
||||||
def _get_obs(self):
|
def _get_obs(self):
|
||||||
theta = self.sim.data.qpos.flat[:7]
|
theta = self.sim.data.qpos.flat[:7]
|
||||||
theta_dot = self.sim.data.qvel.flat[:7]
|
theta_dot = self.sim.data.qvel.flat[:7]
|
||||||
ball_pos = self.sim.data.body_xpos[self.sim.model._body_name2id["ball"]].copy()
|
ball_pos = self.data.get_body_xpos("ball").copy()
|
||||||
cup_goal_diff_final = ball_pos - self.sim.data.site_xpos[
|
cup_goal_diff_final = ball_pos - self.data.get_site_xpos("cup_goal_final_table").copy()
|
||||||
self.sim.model._site_name2id["cup_goal_final_table"]].copy()
|
cup_goal_diff_top = ball_pos - self.data.get_site_xpos("cup_goal_table").copy()
|
||||||
cup_goal_diff_top = ball_pos - self.sim.data.site_xpos[self.sim.model._site_name2id["cup_goal_table"]].copy()
|
|
||||||
return np.concatenate([
|
return np.concatenate([
|
||||||
np.cos(theta),
|
np.cos(theta),
|
||||||
np.sin(theta),
|
np.sin(theta),
|
||||||
|
Loading…
Reference in New Issue
Block a user