pybullet-gym icon indicating copy to clipboard operation
pybullet-gym copied to clipboard

Camera adjust not working

Open unrealwill opened this issue 7 years ago • 1 comments

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)



unrealwill avatar Dec 05 '18 13:12 unrealwill

Thanks for mentioning this!

benelot avatar Jan 10 '19 20:01 benelot