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

Add egocentric renderings #119

Merged
merged 26 commits into from
May 30, 2024
Merged

Add egocentric renderings #119

merged 26 commits into from
May 30, 2024

Conversation

aaravpandya
Copy link
Collaborator

This PR introduces egocentric renders for all agents.

@aaravpandya aaravpandya marked this pull request as ready for review May 23, 2024 21:49
src/sim.cpp Outdated
@@ -387,8 +387,8 @@ inline void lidarSystem(Engine &ctx, Entity e, Lidar &lidar,
float hit_t;
Vector3 hit_normal;
Entity hit_entity =
bvh.traceRay(pos + 0.5f * math::up, ray_dir, &hit_t,
&hit_normal, 200.f);
bvh.traceRay(pos, ray_dir, &hit_t,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats to trace the rays for lidar. This PR also has pygame lidar renderings. In madrona escape room the rays were being thrown from a bit higher up. The thing is our road objects do not have that much height and so it wont hit. So I throw the rays from 0 height to ensure it hits them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I remove the normalization from the distObs because we dont use worldLength

src/sim.cpp Outdated
@@ -387,8 +387,8 @@ inline void lidarSystem(Engine &ctx, Entity e, Lidar &lidar,
float hit_t;
Vector3 hit_normal;
Entity hit_entity =
bvh.traceRay(pos + 0.5f * math::up, ray_dir, &hit_t,
&hit_normal, 200.f);
bvh.traceRay(pos, ray_dir, &hit_t,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I remove the normalization from the distObs because we dont use worldLength

src/sim.cpp Outdated
// if (idx < consts::numLidarSamples) {
// traceRay(idx);
// }
while (idx < consts::numLidarSamples) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change allows to run GPU optimized lidar for more number of lidar samles than 30.

@aaravpandya aaravpandya merged commit 2e00b51 into main May 30, 2024
1 check failed
daphne-cornelisse pushed a commit that referenced this pull request Jul 28, 2024
* Add options for madrona render

* Use enums and dataclass

* Add camera entity

* Use render config

* Check controlled state safely

* Revert headless

* Add egocentric rendering support

* Add bindings for KNN params

* Compute egocentric map obs

* Add lidar support

* Working lidar

* Multi world viz

* draw map on every render

* Update consts.hpp

* revert sim

* revert sim
@aaravpandya aaravpandya deleted the ap_pygameRelative branch October 4, 2024 03:20
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 this pull request may close these issues.

2 participants