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

test_sandbox_driver attempt #1254

Closed
wants to merge 1 commit into from
Closed

test_sandbox_driver attempt #1254

wants to merge 1 commit into from

Conversation

rpartsey
Copy link
Collaborator

Motivation and Context

This is an attempt to implement SandboxDriver image-based unit test described in this doc.

But following instructions from BatchReplayRendererTest::testIntegration as suggested in the doc renderer.render([mutable_image_view]) fails with # AssertionError: ESP_CHECK failed: Renderer was not created with a background render thread, cannot do async drawing.

How Has This Been Tested

Types of changes

  • [Development] A pull request that add new features to the habitat-lab task and environment codebase. Development Pull Requests must be small (less that 500 lines of code change), have unit testing, very extensive documentation and examples. These are typically new tasks, environments, sensors, etc... The review process for these Pull Request is longer because these changes will be maintained by our core team of developers, so make sure your changes are easy to understand!

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

@rpartsey rpartsey added the WIP label Apr 10, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Apr 10, 2023
Copy link
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

Added some quick comments.

glfw_config = Application.Configuration()
glfw_config.title = "Sandbox App"
glfw_config.size = (args.width, args.height)
gui_app_wrapper = GuiApplication(glfw_config, 30)
Copy link
Contributor

Choose a reason for hiding this comment

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

It should not be necessary to create a GuiApplication for this test.

# init SandboxDriver
sim_input = GuiInput()
driver = SandboxDriver(args, config, gui_input=sim_input)
app_renderer = ReplayGuiAppRenderer(
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably not appropriate to use ReplayGuiAppRenderer for this test, because it assumes it can render to the "default framebuffer". A better option is probably to create your own replay renderer using create_classic_replay_renderer.

# 0, app_renderer._sensor_uuid, app_renderer.cam_transform
# )
# AssertionError: ESP_CHECK failed: Renderer was not created with a background render thread, cannot do async drawing
# app_renderer._replay_renderer.render([mutable_image_view])
Copy link
Contributor

Choose a reason for hiding this comment

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

Once you switch to a standalone replay renderer, you may still his this same error. @0mdc should weigh in as he created these renderers and knows about the various render methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

A few things could be happening here.

  1. Make sure that you are using an up-to-date habitat-sim. This error was occurring prior to this fix.
  2. ReplayGuiAppRenderer is windowed, hence it already has a context. It tries to create a standalone context here. Therefore, it fails. The following solutions could fix this:
    • Creating path so that ReplayGuiAppRenderer can be run in headless mode.
    • I can add a python binding to copy the framebuffer into an MutableImageView. This already exists in the backend. In this case, you would have to call replay_renderer.render(framebuffer), then something like replay_renderer.copy_color_into(image_views).

@rpartsey
Copy link
Collaborator Author

Added some quick comments.

Thank you @eundersander , I have tried like that but I faced with the same error.

@rpartsey rpartsey closed this by deleting the head repository Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants