Skip to content

Commit

Permalink
Merge pull request #1 from MO-RISE/distance_and_orientation_fix
Browse files Browse the repository at this point in the history
Distance and orientation FIX
  • Loading branch information
TedSjoblom authored Feb 14, 2023
2 parents 850bafb + de38da3 commit af5afa2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# crowsnest-processor-opendlv-radar

A processing microservice within the crowsnest ecosystem which listens on `RadarDetectionReading`s from an OpenDLV session and converts and outputs these as "single level point clouds" with weights.

A processing microservice within the crowsnest ecosystem which listens on `RadarDetectionReading`s from an OpenDLV session and converts and outputs these as "single level point clouds" with weights.

Output minimized example:
```
{
"sent_at": "2023-02-14T13:37:38.326046+00:00",
"message":
{
"points": [[0.0, 0.0], [2.9296840530811576, 0.0044940825770061485], [5.859368106162315, 0.008988165154012297], ...]
}
}
```

## Development setup
To setup the development environment:
Expand All @@ -28,5 +38,6 @@ To run the tests:

python -m pytest --verbose tests


## License
Apache 2.0, see [LICENSE](./LICENSE)
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ def polar_to_cartesian(
x = distances * np.cos(np.deg2rad(azimuth)) # pylint: disable=invalid-name
y = distances * np.sin(np.deg2rad(azimuth)) # pylint: disable=invalid-name

points = np.column_stack((x, y))
# Distance correction (Do not know why...)
x = x*2
y = y*2

points = np.column_stack((y, x))

return azimuth, points, weights

Expand Down

0 comments on commit af5afa2

Please sign in to comment.