Skip to content

Commit 81f1586

Browse files
author
psigen
committed
Fixed a bunch of out-of-date javadoc and added new build targets to generate documentation, source packages and a "fat-jar"
1 parent b1981c2 commit 81f1586

8 files changed

Lines changed: 67 additions & 26 deletions

File tree

‎build.xml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,40 @@
7272
nbproject/build-impl.xml file.
7373
7474
-->
75+
76+
<!-- Added targets for building source and javadoc jar files -->
77+
<target description="Bundle sources in a JAR" name="package-sources">
78+
<jar basedir="src" destfile="dist/${ant.project.name}-sources.jar"/>
79+
</target>
80+
<target depends="-javadoc-build" description="Bundle javadoc in a JAR" name="package-doc">
81+
<jar basedir="dist/javadoc" destfile="dist/${ant.project.name}-javadoc.jar"/>
82+
</target>
83+
84+
<!-- Added targets to build a "fat-jar" that includes all dependencies -->
85+
<target name="-unjar-and-copy-lib-jars">
86+
<unjar dest="${build.classes.dir}">
87+
<fileset dir="lib">
88+
<include name="**/*.jar"/>
89+
</fileset>
90+
<patternset>
91+
<exclude name="META-INF/**"/>
92+
<exclude name="/*"/>
93+
</patternset>
94+
</unjar>
95+
</target>
96+
97+
<target depends="init,compile,-pre-pre-jar,-pre-jar,-unjar-and-copy-lib-jars" name="fat-jar">
98+
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
99+
<jar destfile="${dist.jar}">
100+
<fileset dir="${build.classes.dir}"/>
101+
<manifest>
102+
<attribute name="Main-Class" value="${main.class}"/>
103+
</manifest>
104+
</jar>
105+
<echo>To run this application from the command line without Ant, try:</echo>
106+
<property location="${dist.jar}" name="dist.jar.resolved"/>
107+
<echo>java -jar "${dist.jar.resolved}"</echo>
108+
</target>
109+
110+
<target depends="clean,fat-jar" name="clean-and-fat-jar"/>
75111
</project>

‎src/robotutils/Quaternion.java‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,17 @@ public class Quaternion implements Cloneable, Serializable {
6060
public static final double SINGULARITY_SOUTH_POLE = -0.49999;
6161

6262
/**
63-
* 2D cartesian coordinates.
63+
* 4D quaternion coordinates.
6464
*/
6565
private final double w, x, y, z;
6666

6767
/**
6868
* Construct a new quaternion.
69+
*
70+
* @param w the w-coordinate of the object
6971
* @param x the x-coordinate of the object
7072
* @param y the y-coordinate of the object
71-
* @param theta the planar rotation of the object
73+
* @param z the z-coordinate of the object
7274
*/
7375
public Quaternion(double w, double x, double y, double z) {
7476
this.w = w;
@@ -77,13 +79,6 @@ public Quaternion(double w, double x, double y, double z) {
7779
this.z = z;
7880
}
7981

80-
/**
81-
* Construct a new quaternion.
82-
* @param x the x-coordinate of the object
83-
* @param y the y-coordinate of the object
84-
* @param theta the planar rotation of the object
85-
*/
86-
8782
/**
8883
* Wrap a quaternion in vector form.
8984
* @param q a quaternion vector in {w, x, y, z} form.
@@ -134,7 +129,12 @@ public double[] getArray() {
134129
public static Quaternion fromRotation(RealMatrix m) {
135130
throw new UnsupportedOperationException("Not implemented yet.");
136131
}
137-
132+
133+
/**
134+
* Converts quaternion to (3x3) rotation matrix.
135+
*
136+
* @return a 2D 3x3 rotation matrix representing the quaternion.
137+
*/
138138
public RealMatrix toRotation() {
139139
double[][] m = new double[3][3];
140140

‎src/robotutils/data/CoordUtils.java‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ public class CoordUtils {
3232

3333
/**
3434
* Returns Manhattan distance from this point to another.
35-
* @param that the other point
36-
* @return the Manhattan distance to the other point
35+
*
36+
* @param a the first point
37+
* @param b the second point
38+
* @return the Manhattan distance between the two points
3739
*/
3840
public static final double mdist(Coordinate a, Coordinate b) {
3941

@@ -53,8 +55,10 @@ public static final double mdist(Coordinate a, Coordinate b) {
5355

5456
/**
5557
* Returns Euclidean distance from this point to another.
56-
* @param that the other point
57-
* @return the Euclidean distance to the other point
58+
*
59+
* @param a the first point
60+
* @param b the second point
61+
* @return the Euclidean distance between the two points
5862
*/
5963
public static final double edist(Coordinate a, Coordinate b) {
6064

‎src/robotutils/data/FileBuffer.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ public int size() {
667667
* type, a RuntimeException will be thrown wrapping the original
668668
* corresponding IOException or ClassNotFoundException.
669669
*
670-
* @param uid The UID reference of the object that is being retrieved.
670+
* @param key The UID of the object that is being retrieved (must be a Long).
671671
* @return The object, or null if the reference is not valid.
672672
*/
673673
public T get(Object key) {
@@ -745,7 +745,7 @@ public int size() {
745745
*
746746
* @param k
747747
* @param v
748-
* @return
748+
* @return Unspecified, this function will always throw an exception.
749749
*/
750750
public T put(Long k, T v) {
751751
throw new UnsupportedOperationException("Not supported. Please use the 'add' function.");
@@ -766,7 +766,7 @@ public void putAll(Map<? extends Long, ? extends T> map) {
766766
* Not supported because this is a write-to-EOF buffer.
767767
*
768768
* @param o
769-
* @return
769+
* @return Unspecified, this function will always throw an exception.
770770
*/
771771
public T remove(Object o) {
772772
throw new UnsupportedOperationException("Not supported.");

‎src/robotutils/filters/ExtendedKalmanFilter.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public ExtendedKalmanFilter(RealMatrix x, RealMatrix P) {
9090
}
9191

9292
/**
93-
* @see KalmanFilter#predict(Jama.Matrix)
93+
* @see KalmanFilter#predict(org.apache.commons.math.linear.RealMatrix)
9494
*/
9595
@Override
9696
public void predict(RealMatrix u) {
@@ -102,7 +102,7 @@ public void predict(RealMatrix u) {
102102
}
103103

104104
/**
105-
* @see KalmanFilter#update(Jama.Matrix)
105+
* @see KalmanFilter#update(org.apache.commons.math.linear.RealMatrix)
106106
*/
107107
@Override
108108
public void update(RealMatrix z) {
@@ -113,7 +113,7 @@ public void update(RealMatrix z) {
113113
}
114114

115115
/**
116-
* @see KalmanFilter#setState(Jama.Matrix)
116+
* @see KalmanFilter#setState(org.apache.commons.math.linear.RealMatrix)
117117
*/
118118
@Override
119119
public void setState(RealMatrix x) {

‎src/robotutils/planning/GraphDStar.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ public V getGoal() {
9797

9898
/**
9999
* A wrapper function that searches for a set of edges that yields the
100-
* optimal path of vertices returned by D*-lite.
100+
* optimal path of vertices returned by D*-lite. The start and end points
101+
* are assumed to already be specified using the constructor and setStart.
102+
*
103+
* @see GraphDStar#GraphDStar(org.jgrapht.Graph, java.lang.Object, java.lang.Object)
104+
* @see GraphDStar#setStart(java.lang.Object)
101105
*
102-
* @param start the starting vertex
103-
* @param goal the ending vertex
104106
* @return a list of edges implementing an optimal path
105107
*/
106108
public List<E> search() {

‎src/robotutils/simulation/ImageServerLink.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public void connect(int port) {
8181
/**
8282
* Attempt a connection to the ImageServer, or do nothing if there is
8383
* already a connection open.
84-
* @return the success of the connection attempt.
8584
*/
8685
public void connect(String hostname, int port) {
8786
if (isConnected()) return;
@@ -145,7 +144,7 @@ public void removeUpdateEventListener(ImageEventListener listener) {
145144

146145
/**
147146
* Handler that dispatches images to all of the listeners.
148-
* @param image the image received from the server.
147+
* @param evt the image event received from the server.
149148
*/
150149
protected void fireUpdateEventMessage(ImageEvent evt) {
151150
Object[] listeners = listenerList.getListenerList();

‎src/robotutils/util/PriorityQueue.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public PriorityQueue(int initialCapacity, Comparator<? super E> comparator) {
108108

109109
/**
110110
* Make a copy of another PriorityQueue.
111-
* @param comparator comparison operator to use when ordering elements
111+
* @param c the PriorityQueue that will be cloned
112112
*/
113113
public PriorityQueue(PriorityQueue<? extends E> c) {
114114
_queue = (Vector)c._queue.clone();

0 commit comments

Comments
 (0)