Skip to content

Commit

Permalink
Fix/add method to detected object (#184)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description

<!--- Describe your changes in detail -->
added tostring method and change logging content
## Related GitHub Issue

<!--- This project only accepts pull requests related to open GitHub
issues or Jira Keys -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please DO NOT name partially fixed issues, instead open an issue
specific to this fix -->
<!--- Please link to the issue here: -->

## Related Jira Key
CDAR-517
<!-- e.g. CAR-123 -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [x] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the
[**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
EricChen-Lei authored Dec 5, 2023
1 parent c781c00 commit 845db9f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void onDetectedObject(DetectedObject detection) {
instance.sendDetection(detection);
// Assuming each sensor would only ever be registered to a single infrastructure
// instance
log.debug("Received detected object: {}", detection);
log.trace("Received detected object: {}", detection);
break;
} catch (IOException e) {
log.error("Error occured: {}", e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,15 @@ public boolean equals(Object obj) {
if (timestamp != other.timestamp)
return false;
return true;
}}
}

@Override
public String toString() {
return "DetectedObject [type=" + type + ", confidence=" + confidence + ", sensorId=" + sensorId
+ ", projString=" + projString + ", objectId=" + objectId + ", position=" + position
+ ", positionCovariance=" + Arrays.deepToString(positionCovariance) + ", velocity=" + velocity
+ ", velocityCovariance=" + Arrays.deepToString(velocityCovariance) + ", angularVelocity=" + angularVelocity
+ ", angularVelocityCovariance=" + Arrays.deepToString(angularVelocityCovariance) + ", size=" + size.toString()
+ ", timestamp=" + timestamp + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,9 @@ public boolean equals(Object obj) {
return true;
}

@Override
public String toString() {
return "Size [length=" + length + ", height=" + height + ", width=" + width + "]";
}

}

0 comments on commit 845db9f

Please sign in to comment.