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

Export render and depth tensors #78

Merged
merged 20 commits into from
May 4, 2024
Merged

Export render and depth tensors #78

merged 20 commits into from
May 4, 2024

Conversation

aaravpandya
Copy link
Collaborator

@aaravpandya aaravpandya commented Apr 11, 2024

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
@@ -70,7 +70,7 @@ target_link_libraries(gpudrive PRIVATE
if (TARGET madrona_viz)
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
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?

@@ -81,7 +81,7 @@ static inline Entity createAgent(Engine &ctx, const MapObject &agentInit) {
{
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
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
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.

@@ -88,11 +128,27 @@ int main(int argc, char *argv[])
(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
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?

Copy link
Contributor

@eugenevinitsky eugenevinitsky left a comment

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
1 check passed
@aaravpandya aaravpandya deleted the FixViewer 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.

3 participants