habitat-sim
habitat-sim copied to clipboard
viewer.py: Object QA Application
Motivation and Context
****************** Changed branch name so making new draft pull request ******************
Allows us to load in objects from datasets (like a banana, bowl, cup, etc) to simple_room.glb and see how they interact with the table geometry. The table mesh is simple and flat, so it allows us to identify any glaring problems with the geometry or physics of an object from a dataset. You can iterate through each object in the dataset, they will be displayed and rotated in front of you, then you can turn on physics and apply impulses, forces, and torques on them to see how they move. You can also make recordings of your tests by hitting the 'L' key to start and stop recording.
This is the command I use to run it: python examples/viewer.py --scene ./data/test_assets/scenes/simple_room.glb --dataset ./data/objects/ycb/ycb.scene_dataset_config.json
After "--scene," put the .glb you want to use, and after "--dataset," put the scene_dataset_config.json you want to use. The positions of the agent and objects are hardcoded for simple_room.glb as of now
You can also just run: python examples/viewer.py and it will just use "./data/test_assets/scenes/simple_room.glb" and "./data/objects/ycb/ycb.scene_dataset_config.json" as defaults
Notable key bindings I added were:
'P': iterate forward through the list of dataset objects and display it 'I': iterate backward through the list of dataset objects and display it 'O': snap the existing object down to the table while turning on physics 'L': used to start and stop recording the screen '1': apply an impulse to the object (hardcoded to be upwards and a little off its center of mass) '2': apply a force to the object (hardcoded to be upwards and a little off its center of mass) '3': apply an impluse torque to the object (hardcoded to be counter-clockwise) '4': apply a torque to the object (hardcoded to be counter-clockwise)
You can see the other key bindings when you run it, as help text is printed in the terminal
How Has This Been Tested
Nothing strenuous as of now, just gradual and periodic testing on my (John Reyna) machine as I was writing and debugging. Also passes the 10 tests at the bottom of this page
Types of changes
- [ ] Docs change / refactoring / dependency upgrade
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [x] I have completed my CLA (see CONTRIBUTING)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.