pybullet-gym
pybullet-gym copied to clipboard
Camera adjust not working
Calling env.env.camera_adjust()
results in undefined attribute self._p at following line : https://github.com/benelot/pybullet-gym/blob/5bae28508e97564dad062af820ef7faeee31bdff/pybulletgym/envs/mujoco/env_bases.py#L132
In pybulletgym/envs/mujoco/env_bases.py The fix is to inject the env into the camera with : in init :
self.camera = Camera(self)
and then
class Camera:
def __init__(self,env):
self.env = env
pass
def move_and_look_at(self,i,j,k,x,y,z):
lookat = [x,y,z]
distance = 10
yaw = 10
self.env._p.resetDebugVisualizerCamera(distance, yaw, -20, lookat)
Thanks for mentioning this!