Skip to content

Export render and depth tensors#78

Merged
aaravpandya merged 20 commits into
mainfrom
FixViewer
May 4, 2024
Merged

Export render and depth tensors#78
aaravpandya merged 20 commits into
mainfrom
FixViewer

Conversation

@aaravpandya

@aaravpandya aaravpandya commented Apr 11, 2024

Copy link
Copy Markdown
Collaborator

This PR fixes the rendering using madrona.

  1. Adds the missing rendering updates in the mgr::step() function.
  2. Makes padding entities renderable to allow for exporting rgb tensors for all agents.
  3. Exports the bindings for rgb and depth tensor.
  4. Fixes a previously introduced bug in test.py

PS - This is rebased over #80 as without that fix, the sim just segfaults.

@aaravpandya aaravpandya changed the title Update mgr.cpp Fix Viewer Apr 11, 2024
@aaravpandya aaravpandya marked this pull request as ready for review April 13, 2024 16:51
@aaravpandya aaravpandya changed the title Fix Viewer Export render and depth tensors Apr 13, 2024
Comment thread src/CMakeLists.txt
add_executable(viewer viewer.cpp)
target_link_libraries(viewer PRIVATE
madrona_mw_core gpudrive_mgr madrona_viz)
madrona_mw_core gpudrive_mgr madrona_viz nlohmann_json::nlohmann_json)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@SamanKazemkhani I vaguely remember a comment about this elsewhere too?

Comment thread src/level_gen.cpp Outdated
trajectory.positions[i] = Vector2{.x = agentInit.position[i].x - ctx.data().mean.x + length, .y = agentInit.position[i].y - ctx.data().mean.y + width};
trajectory.velocities[i] = Vector2{.x = agentInit.velocity[i].x, .y = agentInit.velocity[i].y};
trajectory.headings[i] = toRadians(agentInit.heading[i]);
trajectory.headings[i] = toRadians(agentInit.heading[i]) - M_PI_2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a big thing. Why do we think this is right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This change crept in :) Will remove that.

Comment thread src/viewer.cpp
(math::Quat::angleAxis(0, math::up) *
math::Quat::angleAxis(-math::pi / 2.f, math::right)).normalize();

std::string path = "/home/aarav/gpudrive/nocturne_data";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

avoid hardcoding if possible. Maybe we can assume a relative path?

@eugenevinitsky eugenevinitsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am approving but I would prefer we not merge until we address the two comments

@aaravpandya aaravpandya merged commit dd226e0 into main May 4, 2024
@aaravpandya aaravpandya deleted the FixViewer branch October 4, 2024 03:20
wangbingke0 pushed a commit to wangbingke0/gpudrive that referenced this pull request Feb 13, 2026
* Update mgr.cpp

* Fix viewer

* Fix padding agent values on reset

* Render padding agents too

* Export valid state

* Fix mean calculations (Emerge-Lab#84)

* Local rendering (Emerge-Lab#79)

* Add scale to road observations (Emerge-Lab#83)

* Fix scale road issue

* save progress

* Looking good

* Add json for viewer

* Remove M_PI sub

* Reintroduce means

* Remove floor plane

---------

Co-authored-by: SamanKazemkhani <skazemkhani@gmail.com>
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.

3 participants