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

Update AddSocket #17

Merged
merged 90 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
4cf3d70
Update to 2.3.4
HoangGiang93 Apr 20, 2023
5a6f180
Fix bug
HoangGiang93 Apr 21, 2023
987da7e
Fix bug
HoangGiang93 Apr 21, 2023
8ea2b58
Add nonslip for floor
HoangGiang93 Apr 24, 2023
9e9d9a5
Update to mujoco 2.3.5
HoangGiang93 Apr 26, 2023
b3f4c77
Update box
HoangGiang93 Apr 27, 2023
973ca5f
added initial version of USD owl file
daniel86 Apr 27, 2023
c33ee5f
Merge pull request #6 from daniel86/USD_KG
HoangGiang93 Apr 27, 2023
7f5871f
work on modeling schemas
daniel86 Apr 27, 2023
98d4a9e
Update mujoco_compile
HoangGiang93 Apr 27, 2023
41e410b
Merge branch 'USD_KG' of github.com:HoangGiang93/mujoco_sim into USD_KG
HoangGiang93 Apr 27, 2023
c5e8a14
Update mujoco_compile
HoangGiang93 Apr 27, 2023
24c8fcd
Add bound
HoangGiang93 Apr 28, 2023
1cdc213
Reduce bound
HoangGiang93 Apr 28, 2023
a237099
Extent waiting time
HoangGiang93 Apr 28, 2023
aa8b54f
work on modeling some builtin schemas
daniel86 Apr 29, 2023
6070d90
cleanup ontology
daniel86 Apr 29, 2023
d9a5830
finished with covering USD builtins from considered example, added on…
daniel86 Apr 29, 2023
5472cd6
Merge pull request #7 from daniel86/USD_KG
HoangGiang93 Apr 29, 2023
9a7ec5a
redefined body0 and body1 properties as sub-property of hasComponent
daniel86 Apr 29, 2023
628cb51
introduced transitive + symmetric hasConnection relation that can be …
daniel86 Apr 29, 2023
c4cd95c
Merge pull request #8 from daniel86/USD_KG
HoangGiang93 Apr 29, 2023
ef0bc0b
refactored USD properties: use underscore instead of colon
daniel86 Apr 30, 2023
8dfdc09
Merge pull request #9 from daniel86/USD_KG
HoangGiang93 Apr 30, 2023
929a94c
cleanup USD ontology
daniel86 Apr 30, 2023
acf2017
Merge remote-tracking branch 'upstream/USD_KG' into USD_KG
daniel86 Apr 30, 2023
f07cd28
Merge pull request #10 from daniel86/USD_KG
HoangGiang93 Apr 30, 2023
bd7a7c7
Add usd_to_owl.py
HoangGiang93 May 1, 2023
eb6fb02
Add hasPart
HoangGiang93 May 1, 2023
7d41698
Remove def Ontology
HoangGiang93 May 1, 2023
671ad76
Update
HoangGiang93 May 1, 2023
fac8df5
fix for body0/1 as a relation of the joint
daniel86 May 1, 2023
4d00418
Merge pull request #11 from daniel86/USD_KG
HoangGiang93 May 1, 2023
4cd998e
Update
HoangGiang93 May 1, 2023
7f2941f
Add HasAPI
HoangGiang93 May 1, 2023
acbca5b
Add HasAPI, again
HoangGiang93 May 1, 2023
5a95de8
Add HasAPI, again
HoangGiang93 May 1, 2023
66be3f1
owl:Thing -> dul:Entity
daniel86 May 1, 2023
83dda2d
Merge pull request #12 from daniel86/USD_KG
HoangGiang93 May 1, 2023
4f6bc4a
Fix SOMA-box.usda
HoangGiang93 May 1, 2023
cf88c91
Remove print
HoangGiang93 May 1, 2023
0204bc6
Remove print
HoangGiang93 May 1, 2023
f70471c
Clean up
HoangGiang93 May 1, 2023
d3e4e66
Add IriAPI
HoangGiang93 May 2, 2023
f60dab6
Update usd_to_owl.py
HoangGiang93 May 2, 2023
117000f
Update
HoangGiang93 May 4, 2023
f7bb5ae
+JointState quality, +hasJointValue property
daniel86 May 4, 2023
26ea5b2
added box scenario classes
daniel86 May 4, 2023
4f372ff
Merge pull request #13 from daniel86/USD_KG
HoangGiang93 May 4, 2023
e553f39
+contains
daniel86 May 4, 2023
3629268
quick fix
daniel86 May 4, 2023
5a808b7
Merge pull request #14 from daniel86/USD_KG
HoangGiang93 May 4, 2023
7fc1213
Update
HoangGiang93 May 5, 2023
4588f4e
Update
HoangGiang93 May 5, 2023
fdcee6e
infer if box is opened or not via fixed threshold of joint value
daniel86 May 5, 2023
af974a3
Merge pull request #15 from daniel86/USD_KG
HoangGiang93 May 5, 2023
d7f515f
Update
HoangGiang93 May 5, 2023
c2afad2
Update
HoangGiang93 May 5, 2023
f9d1100
Extent waiting time
HoangGiang93 Apr 28, 2023
a5da83e
Reduce bound
HoangGiang93 Apr 28, 2023
00fd600
Merge pull request #16 from HoangGiang93/main
HoangGiang93 May 6, 2023
678a048
Revert
HoangGiang93 May 6, 2023
d14f98e
Add Schrodinger's cat scenario
HoangGiang93 May 6, 2023
498f73a
Add obj file
HoangGiang93 May 6, 2023
54cd1d8
Change className to conceptName
HoangGiang93 May 6, 2023
c962125
Update
HoangGiang93 May 6, 2023
0cb6af6
Add usd_plugin
HoangGiang93 May 6, 2023
143f11a
Fix shebang
HoangGiang93 May 6, 2023
27fd692
Add cat
HoangGiang93 May 6, 2023
0af1c4d
Remove print
HoangGiang93 May 6, 2023
14ec5e6
Add delay
HoangGiang93 May 6, 2023
e5322bc
Change semanticRelation to semanticLabel
HoangGiang93 May 7, 2023
8c992db
Remove
HoangGiang93 May 7, 2023
aa7b1f4
Update
HoangGiang93 May 7, 2023
512d9ee
Add box_reasoned.owl
HoangGiang93 May 7, 2023
4dd73ca
Clean up
HoangGiang93 May 8, 2023
2da1096
Fix bug
HoangGiang93 May 8, 2023
9a14d70
Update
HoangGiang93 May 8, 2023
8e722ca
Update README.md
HoangGiang93 May 11, 2023
5ff28a7
Update README.md
HoangGiang93 May 11, 2023
3af69a7
Update README.md
HoangGiang93 May 11, 2023
ba5b4ee
Update
HoangGiang93 May 11, 2023
88add15
Fix bug
HoangGiang93 May 11, 2023
d9d6d60
Update
HoangGiang93 May 12, 2023
297b8d5
Update
HoangGiang93 May 12, 2023
6d4e4db
Fix bug
HoangGiang93 May 12, 2023
d8a23e4
Fix bug
HoangGiang93 May 12, 2023
71ead74
Update
HoangGiang93 May 12, 2023
522993b
Add energy
HoangGiang93 May 23, 2023
66406a4
Merge branch 'AddSocket' into main
HoangGiang93 May 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add hasPart
  • Loading branch information
HoangGiang93 committed May 1, 2023
commit eb6fb02954488206041782b92581ad160a34c6b6
12 changes: 12 additions & 0 deletions model/ontology/BoxScenarioTest1.owl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<USD.:Prim rdf:about="#https://ease-crc.org/ont/USD.owl#world">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
<USD.:hasTypedSchema rdf:resource="https://ease-crc.org/ont/USD.owl#XformSchema"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#box"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_1"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_2"/>
</USD.:Prim>

<USD.:Prim rdf:about="#https://ease-crc.org/ont/USD.owl#box">
Expand All @@ -29,6 +32,13 @@
<DUL.:hasQuality rdf:resource="#https://ease-crc.org/ont/USD.owl#box_mass"/>
<DUL.:hasQuality rdf:resource="#https://ease-crc.org/ont/USD.owl#box_centerOfMass"/>
<USD.:hasTypedSchema rdf:resource="https://ease-crc.org/ont/USD.owl#XformSchema"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_1"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_2"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_3"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_4"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_5"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_1_joint"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_2_joint"/>
</USD.:Prim>

<DUL.:Quality rdf:about="#https://ease-crc.org/ont/USD.owl#box_xformOpOrder">
Expand Down Expand Up @@ -268,6 +278,7 @@
<DUL.:hasQuality rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_1_mass"/>
<DUL.:hasQuality rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_1_centerOfMass"/>
<USD.:hasTypedSchema rdf:resource="https://ease-crc.org/ont/USD.owl#XformSchema"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_6"/>
</USD.:Prim>

<DUL.:Quality rdf:about="#https://ease-crc.org/ont/USD.owl#box_flap_side_1_xformOpOrder">
Expand Down Expand Up @@ -332,6 +343,7 @@
<DUL.:hasQuality rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_2_mass"/>
<DUL.:hasQuality rdf:resource="#https://ease-crc.org/ont/USD.owl#box_flap_side_2_centerOfMass"/>
<USD.:hasTypedSchema rdf:resource="https://ease-crc.org/ont/USD.owl#XformSchema"/>
<DUL.:hasPart rdf:resource="#https://ease-crc.org/ont/USD.owl#geom_7"/>
</USD.:Prim>

<DUL.:Quality rdf:about="#https://ease-crc.org/ont/USD.owl#box_flap_side_2_xformOpOrder">
Expand Down
24 changes: 16 additions & 8 deletions script/usd_to_owl.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def usd_to_owl(file_path: str) -> None:
rdfAPI = UsdOntology.RdfAPI.Apply(prim)
iri = rdfAPI.GetRdfNamespaceAttr().Get() + prim.GetName()
prim_inst = usd_onto.Prim(iri)
iri_map[prim] = prim_inst

if prim.IsA(UsdGeom.Xformable):
xformable = UsdGeom.Xformable(prim)
Expand Down Expand Up @@ -199,16 +200,14 @@ def usd_to_owl(file_path: str) -> None:
revoluteJoint = UsdPhysics.RevoluteJoint(prim)
body0 = stage.GetPrimAtPath(
revoluteJoint.GetBody0Rel().GetTargets()[0])
if body0.HasAPI(UsdOntology.RdfAPI):
body0_rdfAPI = UsdOntology.RdfAPI.Apply(body0)
body0_iri = body0_rdfAPI.GetRdfNamespaceAttr().Get() + body0.GetName()
prim_inst.physics_body0 = ABox_onto[body0_iri]
body0_inst = iri_map.get(body0)
if body0_inst is not None:
prim_inst.physics_body0 = body0_inst
body1 = stage.GetPrimAtPath(
revoluteJoint.GetBody1Rel().GetTargets()[0])
if body1.HasAPI(UsdOntology.RdfAPI):
body1_rdfAPI = UsdOntology.RdfAPI.Apply(body1)
body1_iri = body1_rdfAPI.GetRdfNamespaceAttr().Get() + body1.GetName()
prim_inst.physics_body1 = ABox_onto[body1_iri]
body1_inst = iri_map.get(body1)
if body1_inst is not None:
prim_inst.physics_body1 = body1_inst

prim_inst.physics_collisionEnabled = [
revoluteJoint.GetCollisionEnabledAttr().Get()]
Expand All @@ -220,6 +219,15 @@ def usd_to_owl(file_path: str) -> None:
revoluteJoint.GetLocalRot0Attr().Get()]
prim_inst.physics_localRot1 = [
revoluteJoint.GetLocalRot1Attr().Get()]

for prim in stage.Traverse():
if prim.HasAPI(UsdOntology.RdfAPI):
prim_inst = iri_map.get(prim)
if prim_inst is not None:
for prim_child in prim.GetChildren():
prim_child_inst = iri_map.get(prim_child)
if prim_child_inst is not None:
prim_inst.hasPart.append(prim_child_inst)

ABox_onto.save(file=save_path + 'BoxScenarioTest1.owl', format="rdfxml")

Expand Down