Skip to content

Commit

Permalink
Added javadoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Aug 1, 2023
1 parent 35c45a5 commit 0eaef9e
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,12 @@ public void run() {
// Enqueue message for processing on main thread
synchronized (rxQueue) {
rxQueue.add(new Tuple<>(msg.getAddress(), parsedMessage));
log.info("CarmaV2xMessageReceiver enqueued message of size: " + msg.getLength() + " from client " + msg.getAddress().toString() + ".");
log.debug("CarmaV2xMessageReceiver enqueued message of size {} from client {}." , msg.getLength(), msg.getAddress());
}
} catch (IllegalArgumentException parseError) {
log.warn("CarmaV2xMessageReceiver received malformed message with length: " + msg.getLength() + " from client " + msg.getAddress().toString() + "! Reason: " + parseError.getMessage() +". Discarding...");
log.warn("CarmaV2xMessageReceiver received malformed message with size {} from client {} !\nReason: {} .\nDiscarding ...",msg.getLength(), msg.getAddress(), parseError.getMessage());
}
}
if (listenSocket != null) {
listenSocket.close();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,23 @@ public final class DetectedObject implements Serializable {
private Double[] angularVelocityCovariance = new Double[9];

private Size size;

/**
* Constructor for Detected Object information.
*
* @param type {@link DetectionType}.
* @param confidence in detection type classification.
* @param sensorId of sensor/detector reporting object detection
* @param projString containing information about reference frame in
* which kinematic information is reported.
* @param objectId unique string ID of detected object (only guaranteed
* unique among other detected objects reported by the
* same sensor).
* @param position position of detected object relative to sensor/detector
* frame.
* @param velocity velocity of detected object in sensor/detector frame.
* @param angularVelocity angular velocity of detected object in sensor/detector frame.
* @param size size of object including height,width and length.
*/
public DetectedObject(DetectionType type, double confidence, String sensorId, String projString, String objectId,
CartesianPoint position, Vector3d velocity, Vector3d angularVelocity, Size size) {
this.type = type;
Expand All @@ -62,108 +78,201 @@ public DetectedObject(DetectionType type, double confidence, String sensorId, St
this.size = size;
}

/**
* Getter for {@link DetectionType}
* @return
*/
public DetectionType getType() {
return type;
}

/**
* Getter for projection string which describes how to translate
* Detected Object position,velocity, and angular velocity from a
* sensor/detector relative map reference frame to other reference frames.
* @return
*/
public String getProjString() {
return projString;
}

/**
* Getter for 3x3 covariance associated with position represented as
* a 9 element vector for JSON serialization/deserialization.
* @return
*/
public Double[] getPositionCovariance() {
return positionCovariance;
}

/**
* Setter for 3x3 covariance associated with position represented as
* a 9 element vector for JSON serialization/deserialization.
* @param positionCovariance
*/
public void setPositionCovariance(Double[] positionCovariance) {
this.positionCovariance = positionCovariance;
}

/**
* Getter for 3x3 covariance associated with velocity represented as
* a 9 element vector for JSON serialization/deserialization.
* @return
*/
public Double[] getVelocityCovariance() {
return velocityCovariance;
}

/**
* Setter for 3x3 covariance associated with velocity represented as
* a 9 element vector for JSON serialization/deserialization.
* @param positionCovariance
*/
public void setVelocityCovariance(Double[] velocityCovariance) {
this.velocityCovariance = velocityCovariance;
}

/**
* Getter for 3x3 covariance associated with angular velocity represented
* as a 9 element vector for JSON serialization/deserialization.
* @return
*/
public Double[] getAngularVelocityCovariance() {
return angularVelocityCovariance;
}

/**
* Setter for 3x3 covariance associated with angular velocity represented
* as a 9 element vector for JSON serialization/deserialization.
* @param positionCovariance
*/
public void setAngularVelocityCovariance(Double[] angularVelocityCovariance) {
this.angularVelocityCovariance = angularVelocityCovariance;
}


/**
* Getter for confidence value in DetectionType classification.
* @return
*/
public double getConfidence() {
return confidence;
}

/**
* Getter for sensor ID reporting detected object.
* @return
*/
public String getSensorId() {
return sensorId;
}


/**
* Getter for String object ID.
* @return
*/
public String getObjectId() {
return objectId;
}


/**
* Getter for object location.
* @return
*/
public CartesianPoint getPosition() {
return position;
}


/**
* Getter for object velocity.
* @return
*/
public Vector3d getVelocity() {
return velocity;
}

/**
* Getter for object angular velocity
* @return
*/
public Vector3d getAngularVelocity() {
return angularVelocity;
}


/**
* Getter for object size
* @return
*/
public Size getSize() {
return size;
}


public static long getSerialversionuid() {
return serialVersionUID;
}

/**
* Setter for object {@link DetectionType}
* @param type
*/
public void setType(DetectionType type) {
this.type = type;
}

/**
* Setter for confidence in detected object {@link DetectionType} classification.
* @param confidence
*/
public void setConfidence(double confidence) {
this.confidence = confidence;
}

/**
* Setter for String sensor ID reporting DetectedObject.
* @param sensorId
*/
public void setSensorId(String sensorId) {
this.sensorId = sensorId;
}

/**
* Setter for projection string to translate object kinematic information from
* reference frame to geodetic cordinates.
* @param projString
*/
public void setProjString(String projString) {
this.projString = projString;
}

/**
* Setter for detected object unique string ID.
* @param objectId
*/
public void setObjectId(String objectId) {
this.objectId = objectId;
}

/**
* Setter for detected object position.
* @param position
*/
public void setPosition(CartesianPoint position) {
this.position = position;
}

/**
* Setter for detected object velocity.
* @param velocity {@link Vector3d}
*/
public void setVelocity(Vector3d velocity) {
this.velocity = velocity;
}

/**
* Setter for detected object angular velocity.
* @param angularVelocity {@link Vector3d}
*/
public void setAngularVelocity(Vector3d angularVelocity) {
this.angularVelocity = angularVelocity;
}

/**
* Setter for object size.
* @param size {@link Size}
*/
public void setSize(Size size) {
this.size = size;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,81 @@ public class Detector implements Serializable {
private DetectorType type;
private Orientation orientation;
private CartesianPoint location;

public Detector(String sensorId, DetectorType type, Orientation orientation, CartesianPoint point) {

/**
* Sensor/Detector constructor
*
* @param sensorId unique string ID of sensor/detector.
* @param type of the sensor/detector.
* @param orientation of the sensor/detector.
* @param location of the sensor/detector.
*/
public Detector(String sensorId, DetectorType type, Orientation orientation, CartesianPoint location) {
this.sensorId = sensorId;
this.type = type;
this.orientation = orientation;
this.location = point;
this.location = location;
}

/**
* Get unique String sensor ID.
* @return
*/
public String getSensorId() {
return sensorId;
}

/**
* Set unique String sensor ID.
* @param sensorId
*/
public void setSensorId(String sensorId) {
this.sensorId = sensorId;
}

/**
* Get sensor/detector {@link DetectorType}.
* @return
*/
public DetectorType getType() {
return type;
}

/**
* Set the sensor/detector {@link DetectorType}.
* @param type
*/
public void setType(DetectorType type) {
this.type = type;
}

/**
* Get sensor/detector {@link Orientation}.
* @return
*/
public Orientation getOrientation() {
return orientation;
}

/**
* Set sensor/detector {@link Orientation}.
* @param orientation
*/
public void setOrientation(Orientation orientation) {
this.orientation = orientation;
}

/**
* Get sensor/detector location.
* @return {@link CartesianPoint}.
*/
public CartesianPoint getLocation() {
return location;
}
/**
* Set sensor/detector location
* @param point {@link CartesianPoint}.
*/
public void setLocation(CartesianPoint point) {
this.location = point;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,38 @@ public class Orientation implements Serializable{
private double pitch;

private double roll;

/**
* Constructor for orientation
* @param yaw in degrees
* @param pitch in degrees
* @param roll in degrees
*/
public Orientation( double yaw, double pitch, double roll) {
this.yaw = yaw;
this.pitch = pitch;
this.roll = roll;
}

/**
* Get yaw in degrees.
* @return
*/
public double getYaw() {
return yaw;
}


/**
* Get pitch in degrees.
* @return
*/
public double getPitch() {
return pitch;
}

/**
* Get roll in degrees.
* @return
*/
public double getRoll() {
return roll;
}
Expand Down
Loading

0 comments on commit 0eaef9e

Please sign in to comment.