[FEATURE] Multi env camera sensor (pyrender and Luisa) #2204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for cameras (both attached and static) to render different viewpoints per environment when
n_envs > 1. Previously, all environments rendered from the same camera pose. Here are batched rendered results for rasterizer and raytracerImplementation
Core Change: Added
_get_camera_transforms_per_env(n_envs)method incamera.pythat computes unique camera transforms for each environment:Rasterizer (
rasterizer.py,pyrender/renderer.py):camera_posesparameter to render pipelineRaytracer (
raytracer.py):update_scene_for_env(env_idx)method that updates shape_0with transforms from specified envFiles Changed
genesis/engine/sensors/camera.py- Core camera transform logicgenesis/vis/rasterizer.py- Pass camera_poses to pyrendergenesis/ext/pyrender/renderer.py- Per-env camera matrix updatesgenesis/vis/raytracer.py- Per-env scene updatesTesting
Test Coverage
test_rasterizer_camera_sensor_attached_per_env_pose- Attached camera different poses per envtest_raytracer_camera_sensor_attached_per_env_pose- Same for raytracertest_*_different_poses- Static camera sees different object positions per envChecklist:
Submitting Code Changessection of CONTRIBUTING document.