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

Corrections and additions to generate Java JAXB classes #3

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# VS Code
.vscode
.vscode
/.project
2 changes: 2 additions & 0 deletions attribute_types/attribute_types.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
<xs:restriction base="xs:string">
<xs:enumeration value="Euler"/>
<xs:enumeration value="RK4"/>
<xs:enumeration value="implicit"/>
<xs:enumeration value="implicitfast"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="collisionType">
Expand Down
111 changes: 111 additions & 0 deletions customization.xjb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb bindingschema_2_0.xsd ">
<jxb:bindings schemaLocation="file:mujoco.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml" />
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="file:element_types/default.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.MuJoCoDefault" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/actuator.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.actuator" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/body.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.body" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/contact.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.contact" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/keyframe.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.keyframe" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/statistic.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.statistic" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/visual.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.visual" />
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="file:element_types/sensor.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.sensor" />
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="file:element_types/asset.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.asset" />
</jxb:schemaBindings>
</jxb:bindings>
<jxb:bindings schemaLocation="file:element_types/option.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.option" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/compiler.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.compiler" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/root.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.root" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/size.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.size" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/tendon.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.tendon" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/equality.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.equality" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:element_types/custom.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.custom" />
</jxb:schemaBindings>
</jxb:bindings>

<jxb:bindings schemaLocation="file:attribute_types/attribute_types.xsd">
<jxb:schemaBindings>
<jxb:package name="org.mujoco.xml.attributetypes" />
</jxb:schemaBindings>
</jxb:bindings>




</jxb:bindings>
2 changes: 2 additions & 0 deletions element_types/actuator.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
<xs:complexContent>
<xs:extension base="motorType">
<xs:attribute name="kp" type="xs:decimal" default="1"/>
<xs:attribute name="kv" type="xs:decimal" default="1"/>
<xs:attribute name="inheritrange" type="xs:decimal" default="1"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Expand Down
1 change: 0 additions & 1 deletion element_types/body.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
xmlns:at="attributeTypes">

<xs:import schemaLocation="../attribute_types/attribute_types.xsd" namespace="attributeTypes"/>

<xs:complexType name="bodyType">
<xs:attribute name="name" type="xs:string" use="optional"/>
<xs:attribute name="childclass" type="xs:string" use="optional"/>
Expand Down
6 changes: 6 additions & 0 deletions element_types/option.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,16 @@
<xs:attribute name="filterparent" type="at:flagSimpleType" default="enable"/>
<xs:attribute name="actuation" type="at:flagSimpleType" default="enable"/>
<xs:attribute name="refsafe" type="at:flagSimpleType" default="enable"/>
<xs:attribute name="sensor" type="at:flagSimpleType" default="enable"/>
<xs:attribute name="midphase" type="at:flagSimpleType" default="enable"/>
<xs:attribute name="eulerdamp" type="at:flagSimpleType" default="enable"/>
<xs:attribute name="override" type="at:flagSimpleType" default="disable"/>
<xs:attribute name="energy" type="at:flagSimpleType" default="disable"/>
<xs:attribute name="fwdinv" type="at:flagSimpleType" default="disable"/>
<xs:attribute name="invdiscrete" type="at:flagSimpleType" default="disable"/>
<xs:attribute name="sensornoise" type="at:flagSimpleType" default="disable"/>
<xs:attribute name="multiccd" type="at:flagSimpleType" default="disable"/>
<xs:attribute name="island" type="at:flagSimpleType" default="disable"/>
</xs:complexType>

</xs:schema>
4 changes: 1 addition & 3 deletions element_types/size.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
targetNamespace="size" xmlns="size">

<xs:complexType name="sizeType">
<xs:attribute name="njmax" type="xs:int" default="-1"/>
<xs:attribute name="nconmax" type="xs:int" default="-1"/>
<xs:attribute name="nstack" type="xs:int" default="-1"/>
<xs:attribute name="memory" type="xs:string" default="-1"/>
<xs:attribute name="nuserdata" type="xs:int" default="0"/>
<xs:attribute name="nkey" type="xs:int" default="0"/>
<xs:attribute name="nuser_body" type="xs:int" default="0"/>
Expand Down
8 changes: 4 additions & 4 deletions mujoco.xsd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:rt="root">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:rt="root" xmlns:def="default">

<xs:import schemaLocation="element_types/root.xsd" namespace="root"/>
<xs:import schemaLocation="element_types/compiler.xsd" namespace="compiler"/>
Expand All @@ -22,7 +22,7 @@
<!-- Recursive types -->

<!-- default -->
<xs:complexType name="defaultType" xmlns:def="default">
<xs:complexType name="defaultType" >
<xs:complexContent>
<xs:extension base="def:defaultType">
<xs:choice minOccurs="0" maxOccurs="unbounded">
Expand Down Expand Up @@ -57,7 +57,7 @@
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="inertial" type="bd:inertialType"/>
<xs:element name="joint" type="bd:jointType"/>
<xs:element name="freejoint" type="bd:jointType"/>
<xs:element name="freejoint" type="bd:freejointType"/>
<xs:element name="geom" type="bd:geomType"/>
<xs:element name="site" type="bd:siteType"/>
<xs:element name="camera" type="bd:cameraType"/>
Expand Down Expand Up @@ -392,4 +392,4 @@
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
</xs:schema>