Skip to content

Commit

Permalink
Adding additional position configs
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Mar 19, 2024
1 parent 48706ee commit b3aa634
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ src/main/java/mujoco/*.h

*.DS_Store*
cppbuild
*hs_err_*.log
*hs_err_*.log
/MUJOCO_LOG.TXT
2 changes: 1 addition & 1 deletion schema
144 changes: 144 additions & 0 deletions src/main/java/org/mujoco/xml/actuator/PositionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
* <complexContent>
* <extension base="{actuator}motorType">
* <attribute name="kp" type="{http://www.w3.org/2001/XMLSchema}decimal" default="1" />
* <attribute name="kv" type="{http://www.w3.org/2001/XMLSchema}decimal" default="1" />
* <attribute name="inheritrange" type="{http://www.w3.org/2001/XMLSchema}decimal" default="1" />
* </extension>
* </complexContent>
* </complexType>
Expand All @@ -51,6 +53,10 @@ public class PositionType

@XmlAttribute(name = "kp")
protected BigDecimal kp;
@XmlAttribute(name = "kv")
protected BigDecimal kv;
@XmlAttribute(name = "inheritrange")
protected BigDecimal inheritrange;

/**
* Generated by copy-constructor plugin, JAXB requires public no-arg constructor.
Expand All @@ -69,6 +75,8 @@ public PositionType() {
public PositionType(final PositionType _other) {
super(_other);
this.kp = _other.kp;
this.kv = _other.kv;
this.inheritrange = _other.inheritrange;
}

/**
Expand All @@ -87,6 +95,14 @@ public PositionType(final PositionType _other, final PropertyTree _propertyTree,
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kpPropertyTree!= null):((kpPropertyTree == null)||(!kpPropertyTree.isLeaf())))) {
this.kp = _other.kp;
}
final PropertyTree kvPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("kv"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kvPropertyTree!= null):((kvPropertyTree == null)||(!kvPropertyTree.isLeaf())))) {
this.kv = _other.kv;
}
final PropertyTree inheritrangePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("inheritrange"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(inheritrangePropertyTree!= null):((inheritrangePropertyTree == null)||(!inheritrangePropertyTree.isLeaf())))) {
this.inheritrange = _other.inheritrange;
}
}

/**
Expand All @@ -105,6 +121,38 @@ public BigDecimal getKp() {
}
}

/**
* Gets the value of the kv property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getKv() {
if (kv == null) {
return new BigDecimal("1");
} else {
return kv;
}
}

/**
* Gets the value of the inheritrange property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getInheritrange() {
if (inheritrange == null) {
return new BigDecimal("1");
} else {
return inheritrange;
}
}

@Override
public PositionType withVetoableChangeListener(final VetoableChangeListener vetoableChangeListener) {
addVetoableChangeListener(vetoableChangeListener);
Expand All @@ -128,6 +176,28 @@ public void setKp(final BigDecimal value) {
this.propertyChange__Support.firePropertyChange("kp", __oldValue, value);
}

public void setKv(final BigDecimal value) {
final BigDecimal __oldValue = this.kv;
try {
this.vetoableChange__Support.fireVetoableChange("kv", __oldValue, value);
} catch (PropertyVetoException x) {
throw new RuntimeException(x);
}
this.kv = value;
this.propertyChange__Support.firePropertyChange("kv", __oldValue, value);
}

public void setInheritrange(final BigDecimal value) {
final BigDecimal __oldValue = this.inheritrange;
try {
this.vetoableChange__Support.fireVetoableChange("inheritrange", __oldValue, value);
} catch (PropertyVetoException x) {
throw new RuntimeException(x);
}
this.inheritrange = value;
this.propertyChange__Support.firePropertyChange("inheritrange", __oldValue, value);
}

@Override
public PositionType clone() {
final PositionType _newObject;
Expand All @@ -139,6 +209,8 @@ public PositionType clone() {
public PositionType createCopy() {
final PositionType _newObject = ((PositionType) super.createCopy());
_newObject.kp = this.kp;
_newObject.kv = this.kv;
_newObject.inheritrange = this.inheritrange;
return _newObject;
}

Expand All @@ -149,6 +221,14 @@ public PositionType createCopy(final PropertyTree _propertyTree, final PropertyT
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kpPropertyTree!= null):((kpPropertyTree == null)||(!kpPropertyTree.isLeaf())))) {
_newObject.kp = this.kp;
}
final PropertyTree kvPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("kv"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kvPropertyTree!= null):((kvPropertyTree == null)||(!kvPropertyTree.isLeaf())))) {
_newObject.kv = this.kv;
}
final PropertyTree inheritrangePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("inheritrange"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(inheritrangePropertyTree!= null):((inheritrangePropertyTree == null)||(!inheritrangePropertyTree.isLeaf())))) {
_newObject.inheritrange = this.inheritrange;
}
return _newObject;
}

Expand All @@ -171,6 +251,8 @@ public PositionType copyOnly(final PropertyTree _propertyTree) {
public<_B >void copyTo(final PositionType.Builder<_B> _other) {
super.copyTo(_other);
_other.kp = this.kp;
_other.kv = this.kv;
_other.inheritrange = this.inheritrange;
}

@Override
Expand Down Expand Up @@ -211,6 +293,14 @@ public<_B >void copyTo(final PositionType.Builder<_B> _other, final PropertyTree
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kpPropertyTree!= null):((kpPropertyTree == null)||(!kpPropertyTree.isLeaf())))) {
_other.kp = this.kp;
}
final PropertyTree kvPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("kv"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kvPropertyTree!= null):((kvPropertyTree == null)||(!kvPropertyTree.isLeaf())))) {
_other.kv = this.kv;
}
final PropertyTree inheritrangePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("inheritrange"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(inheritrangePropertyTree!= null):((inheritrangePropertyTree == null)||(!inheritrangePropertyTree.isLeaf())))) {
_other.inheritrange = this.inheritrange;
}
}

@Override
Expand Down Expand Up @@ -262,11 +352,15 @@ public static class Builder<_B >
{

private BigDecimal kp;
private BigDecimal kv;
private BigDecimal inheritrange;

public Builder(final _B _parentBuilder, final PositionType _other, final boolean _copy) {
super(_parentBuilder, _other, _copy);
if (_other!= null) {
this.kp = _other.kp;
this.kv = _other.kv;
this.inheritrange = _other.inheritrange;
}
}

Expand All @@ -277,11 +371,21 @@ public Builder(final _B _parentBuilder, final PositionType _other, final boolean
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kpPropertyTree!= null):((kpPropertyTree == null)||(!kpPropertyTree.isLeaf())))) {
this.kp = _other.kp;
}
final PropertyTree kvPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("kv"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(kvPropertyTree!= null):((kvPropertyTree == null)||(!kvPropertyTree.isLeaf())))) {
this.kv = _other.kv;
}
final PropertyTree inheritrangePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("inheritrange"));
if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(inheritrangePropertyTree!= null):((inheritrangePropertyTree == null)||(!inheritrangePropertyTree.isLeaf())))) {
this.inheritrange = _other.inheritrange;
}
}
}

protected<_P extends PositionType >_P init(final _P _product) {
_product.kp = this.kp;
_product.kv = this.kv;
_product.inheritrange = this.inheritrange;
return super.init(_product);
}

Expand All @@ -296,6 +400,28 @@ public PositionType.Builder<_B> withKp(final BigDecimal kp) {
return this;
}

/**
* Sets the new value of "kv" (any previous value will be replaced)
*
* @param kv
* New value of the "kv" property.
*/
public PositionType.Builder<_B> withKv(final BigDecimal kv) {
this.kv = kv;
return this;
}

/**
* Sets the new value of "inheritrange" (any previous value will be replaced)
*
* @param inheritrange
* New value of the "inheritrange" property.
*/
public PositionType.Builder<_B> withInheritrange(final BigDecimal inheritrange) {
this.inheritrange = inheritrange;
return this;
}

/**
* Sets the new value of "name" (any previous value will be replaced)
*
Expand Down Expand Up @@ -519,6 +645,8 @@ public PositionType.Builder<_B> copyOf(final PositionType.Builder _other) {
public static class PropInfo {

public final static transient String KP = "kp";
public final static transient String KV = "kv";
public final static transient String INHERITRANGE = "inheritrange";

}

Expand All @@ -542,6 +670,8 @@ public static class Selector<TRoot extends com.kscs.util.jaxb.Selector<TRoot, ?>
{

private com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>> kp = null;
private com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>> kv = null;
private com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>> inheritrange = null;

public Selector(final TRoot root, final TParent parent, final String propertyName) {
super(root, parent, propertyName);
Expand All @@ -554,13 +684,27 @@ public Map<String, PropertyTree> buildChildren() {
if (this.kp!= null) {
products.put("kp", this.kp.init());
}
if (this.kv!= null) {
products.put("kv", this.kv.init());
}
if (this.inheritrange!= null) {
products.put("inheritrange", this.inheritrange.init());
}
return products;
}

public com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>> kp() {
return ((this.kp == null)?this.kp = new com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>>(this._root, this, "kp"):this.kp);
}

public com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>> kv() {
return ((this.kv == null)?this.kv = new com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>>(this._root, this, "kv"):this.kv);
}

public com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>> inheritrange() {
return ((this.inheritrange == null)?this.inheritrange = new com.kscs.util.jaxb.Selector<TRoot, PositionType.Selector<TRoot, TParent>>(this._root, this, "inheritrange"):this.inheritrange);
}

}

}

0 comments on commit b3aa634

Please sign in to comment.