Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera adjust not working #17

Open
unrealwill opened this issue Dec 5, 2018 · 1 comment
Open

Camera adjust not working #17

unrealwill opened this issue Dec 5, 2018 · 1 comment

Comments

@unrealwill
Copy link

Calling env.env.camera_adjust()

results in undefined attribute self._p at following line :

self._p.resetDebugVisualizerCamera(distance, yaw, -20, lookat)

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)



@benelot
Copy link
Owner

benelot commented Jan 10, 2019

Thanks for mentioning this!

antoniosmakro added a commit to myned-ai/pybullet-gym that referenced this issue Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants