Skip to content

Commit

Permalink
--[Part 2 of 2] Semantic region building (#2307)
Browse files Browse the repository at this point in the history
* --add support for non-wildcard relative filenames.
This enables relative path/filename values set in the default attributes section of the scene dataset config to be resolved to real files on attributes load.
* --pass semantic attributes to loadSemanticSceneDescriptor instead of just filename.
* --move all semantic scene creation code to SemanticScene
* --add semantic region creation and bindings.
* --add regions to the scene's region vector
* viewer.py region rendering demo
* --make extrusions
* --rename sub-configs to SemanticVolumes
Will eventually be used for describing non-region semantic constructs.
* --add construction of volume edges for debug/visualizations.
* --add semantic visualization in a more formal manner.
* --test containment; fix height calc and containment check.
* --update test to read from test JSON file instead of using a JSON string.
* --ssd specified through scene dataset config default value
* --add semantic config files with names matching scene dataset tags
* --require ssd handle to be found explicitly in dataset
Since this handle is only a string tag to tie to a semantic attributes, it should -always- be matched explicitly.
* --adjust test to cover expanded test scene dataset.
* --minor simplification of attributes managers tests.
* --add bindings specifically for loop-based semantic category
* --python test for semantic regions
* --fix attempting to map ssd file handle if scene instance is NONE scene.

---------

Co-authored-by: aclegg3 <alexanderwclegg@gmail.com>
  • Loading branch information
jturner65 and aclegg3 committed Jan 31, 2024
1 parent 9233834 commit f964e51
Show file tree
Hide file tree
Showing 28 changed files with 1,007 additions and 585 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
}
],
"default_lighting":"modified_test_lights",
"navmesh_instance":"navmesh_path1",
"semantic_scene_instance":"semantic_descriptor_path1"
"navmesh_instance":"navmesh_path1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"region_annotations": [
{
"name": "test_region_negativeX",
"label": "bedroom",
"poly_loop": [
[-20.0, -2.0,-10.0],
[-25.0, -2.0, 0.0],
[-20.0, -2.0, 10.0],
[-10.0, -2.0, 10.0],
[-5.0, -2.0, 0.0],
[-10.0, -2.0,-10.0]
],
"floor_height": -2.0,
"extrusion_height": 4.0,
"min_bounds": [-25.0, -2.0, -10.0],
"max_bounds": [-5.0, 2.0, 10.0]
},
{
"name": "test_region_positiveX",
"label": "bathroom",
"poly_loop": [
[10.0, -2.0,-10.0],
[5.0, -2.0, 0.0],
[10.0, -2.0, 10.0],
[20.0, -2.0, 10.0],
[25.0, -2.0, 0.0],
[20.0, -2.0,-10.0]
],
"floor_height": -2.0,
"extrusion_height": 4.0,
"min_bounds": [5.0, -2.0, -10.0],
"max_bounds": [25.0, 2.0, 10.0]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"region_annotations": [
{
"name": "test_region_negativeX",
"label": "bedroom",
"poly_loop": [
[-20.0, -2.0,-10.0],
[-25.0, -2.0, 0.0],
[-20.0, -2.0, 10.0],
[-10.0, -2.0, 10.0],
[-5.0, -2.0, 0.0],
[-10.0, -2.0,-10.0]
],
"floor_height": -2.0,
"extrusion_height": 4.0,
"min_bounds": [-25.0, -2.0, -10.0],
"max_bounds": [-5.0, 2.0, 10.0]
},
{
"name": "test_region_positiveX",
"label": "bathroom",
"poly_loop": [
[10.0, -2.0,-10.0],
[5.0, -2.0, 0.0],
[10.0, -2.0, 10.0],
[20.0, -2.0, 10.0],
[25.0, -2.0, 0.0],
[20.0, -2.0,-10.0]
],
"floor_height": -2.0,
"extrusion_height": 4.0,
"min_bounds": [5.0, -2.0, -10.0],
"max_bounds": [25.0, 2.0, 10.0]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"region_annotations": [
{
"name": "test_region_negativeX",
"label": "bedroom",
"poly_loop": [
[-20.0, -2.0,-10.0],
[-25.0, -2.0, 0.0],
[-20.0, -2.0, 10.0],
[-10.0, -2.0, 10.0],
[-5.0, -2.0, 0.0],
[-10.0, -2.0,-10.0]
],
"floor_height": -2.0,
"extrusion_height": 4.0,
"min_bounds": [-25.0, -2.0, -10.0],
"max_bounds": [-5.0, 2.0, 10.0]
},
{
"name": "test_region_positiveX",
"label": "bathroom",
"poly_loop": [
[10.0, -2.0,-10.0],
[5.0, -2.0, 0.0],
[10.0, -2.0, 10.0],
[20.0, -2.0, 10.0],
[25.0, -2.0, 0.0],
[20.0, -2.0,-10.0]
],
"floor_height": -2.0,
"extrusion_height": 4.0,
"min_bounds": [5.0, -2.0, -10.0],
"max_bounds": [25.0, 2.0, 10.0]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,90 +12,91 @@
"original_file": "stages/dataset_test_stage.stage_config.json",
"template_handle": "modified_test_stage",
"attributes": {
"scale":[1,1,1],
"gravity":[0,-9.8,0],
"margin":0.041,
"friction_coefficient": 0.4,
"restitution_coefficient": 0.5,
"units_to_meters":1.0
"scale":[1,1,1],
"gravity":[0,-9.8,0],
"margin":0.041,
"friction_coefficient": 0.4,
"restitution_coefficient": 0.5,
"units_to_meters":1.0
}
},
{
"template_handle": "new_test_stage",
"attributes": {
"render_asset": "stages/dataset_test_stage.glb",
"up":[0,-1,0],
"scale":[2,2,2],
"gravity":[0,9.8,0],
"friction_coefficient": 0.35,
"restitution_coefficient": 0.25,
"units_to_meters":2.0,
"force_flat_shading": true
"render_asset": "stages/dataset_test_stage.glb",
"up":[0,-1,0],
"scale":[2,2,2],
"gravity":[0,9.8,0],
"friction_coefficient": 0.35,
"restitution_coefficient": 0.25,
"units_to_meters":2.0,
"force_flat_shading": true
}
}
]
},
"objects":{
"default_attributes": {
"mass" : 10.0,
"inertia": [3,2,1]
"mass" : 10.0,
"inertia": [3,2,1]
},
"paths": {
".json" : ["objects"]
},
".json" : ["objects"]
},
"configs" : [
{
"original_file": "objects/dataset_test_object1.object_config.json",
"template_handle": "modified_test_object1_1_slick_heavy",
"attributes": {
"friction_coefficient": 0.2,
"rolling_friction_coefficient": 0.0002,
"spinning_friction_coefficient": 0.0003,
"mass": 3.5
"friction_coefficient": 0.2,
"rolling_friction_coefficient": 0.0002,
"spinning_friction_coefficient": 0.0003,
"mass": 3.5
}
},
{
{
"template_handle": "new_test_object3",
"attributes": {
"render_asset": "objects/dataset_test_object3.glb",
"friction_coefficient": 0.1,
"mass": 1.1
"render_asset": "objects/dataset_test_object3.glb",
"friction_coefficient": 0.1,
"mass": 1.1
}
}

]
},
"light_setups":{
"default_attributes": {
},
"default_attributes": {},
"paths": {
".json" : ["lights"]
},
".json" : ["lights"]
},
"configs" : [
{
"original_file":"lights/dataset_test_lights.lighting_config.json",
"template_handle": "modified_test_lights",
"attributes": {
"lights":{
"0": { "position": [1.5,0.1,1.5], "intensity": 2.4, "color": [0.5,1,0.95], "type": "point"},
"1": { "position": [2.5,-0.1,2.5], "intensity": 2.1, "color": [0.5,1,0.95], "type": "point"},
"11": { "position": [3.5,-0.7,-3.5], "intensity": -0.5, "color": [1,0.5,1], "type": "point"}
}
"lights":{
"0": { "position": [1.5,0.1,1.5], "intensity": 2.4, "color": [0.5,1,0.95], "type": "point"},
"1": { "position": [2.5,-0.1,2.5], "intensity": 2.1, "color": [0.5,1,0.95], "type": "point"},
"11": { "position": [3.5,-0.7,-3.5], "intensity": -0.5, "color": [1,0.5,1], "type": "point"}
}
}
},
{
"template_handle": "new_test_lights_0",
"attributes": {
"lights":{
"3": { "position": [11.5,10.1,11.5], "intensity": 1.4, "color": [0.5,1,0.95], "type": "point"},
"4": { "position": [12.5,-10.1,12.5], "intensity": 1.1, "color": [0.5,1,0.95], "type": "point"},
"5": { "position": [13.5,-10.7,-13.5], "intensity": -1.5, "color": [1,0.5,1], "type": "point"}
}
"lights":{
"3": { "position": [11.5,10.1,11.5], "intensity": 1.4, "color": [0.5,1,0.95], "type": "point"},
"4": { "position": [12.5,-10.1,12.5], "intensity": 1.1, "color": [0.5,1,0.95], "type": "point"},
"5": { "position": [13.5,-10.7,-13.5], "intensity": -1.5, "color": [1,0.5,1], "type": "point"}
}
}
}
]
},
"scene_instances":{
"default_attributes": {
"semantic_scene_instance": "%%CONFIG_NAME_AS_ASSET_FILENAME%%.semantic_config.json"
},
"paths": {
".json" : ["scenes"]
}
Expand All @@ -105,6 +106,11 @@
"navmesh_path2":"test_navmesh_path2"
},
"semantic_scene_descriptor_instances": {
"paths": {
".json": [
"semantics/*"
]
},
"semantic_descriptor_path1":"test_semantic_descriptor_path1",
"semantic_descriptor_path2":"test_semantic_descriptor_path2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"origin":[1.0,2.0,3.0]
},
"paths": {
".json" : ["stages/*"]
},
".json" : ["stages/*"]
},
"configs" : [
{
"original_file": "stages/stage_0/dataset_test_stage_0.stage_config.json",
Expand Down Expand Up @@ -52,8 +52,8 @@
"inertia": [3,2,1]
},
"paths": {
".json" : ["objects/*"]
},
".json" : ["objects/*"]
},
"configs" : [
{
"original_file": "objects/object_0/dataset_test_object1_0.object_config.json",
Expand All @@ -63,23 +63,22 @@
"mass": 3.5
}
},
{
{
"template_handle": "new_test_object3",
"attributes": {
"render_asset": "objects/object_1/dataset_test_object3_1.glb",
"friction_coefficient": 0.1,
"mass": 1.1
}
}

]
},
"light_setups":{
"default_attributes": {
},
"paths": {
".json" : ["lights/*"]
},
".json" : ["lights/*"]
},
"configs" : [
{
"original_file":"lights/lights_0/dataset_test_lights_0.lighting_config.json",
Expand Down
Loading

0 comments on commit f964e51

Please sign in to comment.