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

Feature request : Camera able to follow an entity #538

Open
jgleyze opened this issue Jan 10, 2025 · 1 comment · May be fixed by #554
Open

Feature request : Camera able to follow an entity #538

jgleyze opened this issue Jan 10, 2025 · 1 comment · May be fixed by #554

Comments

@jgleyze
Copy link

jgleyze commented Jan 10, 2025

Hello,

I'm training locomotion policies with genesis in headless mode, I'm using cameras to record the robot training. To follow the robot i'm updating the camera position but this is a bit clunky, it would be nice to have an option telling the camera to follow a certain entity !

In my case it would be nice if the camera follows for example the robot's body on the xy plane but stay at the same height, or maybe even some smoothing done on the position so that the camera's movement are not too jittery.

Would that be possible ?

Thanks have a nice day

Likhithsai2580 added a commit to Likhithsai2580/Genesis that referenced this issue Jan 13, 2025
Fixes Genesis-Embodied-AI#538

Add functionality for the camera to follow an entity.

* **Camera Class (`genesis/vis/camera.py`)**
  - Add `_follow_entity`, `_follow_height`, and `_follow_smoothing` attributes.
  - Add `follow_entity` method to set the camera to follow a specified entity.
  - Update `render` method to call `follow_entity` if enabled.

* **Scene Class (`genesis/engine/scene.py`)**
  - Add `set_camera_follow_entity` method to set the camera to follow a specified entity.
  - Update `step` method to call `set_camera_follow_entity` if enabled.

* **Drone Example (`examples/drone/interactive_drone.py`)**
  - Add `--follow` argument to enable camera follow.
  - Update `main` function to use `follow_entity` method if `--follow` argument is provided.
@Likhithsai2580 Likhithsai2580 linked a pull request Jan 13, 2025 that will close this issue
@jgleyze
Copy link
Author

jgleyze commented Jan 13, 2025

Thanks for the PR @Likhithsai2580

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

Successfully merging a pull request may close this issue.

1 participant