-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added elevation data on simulator side #22
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ public class GpsSensor : MonoBehaviour | |
private double initLat = 0.0; | ||
[SerializeField] | ||
private double initLon = 0.0; | ||
[SerializeField] | ||
private double initAlt= 0.0; | ||
|
||
private RoverSocket _socket; | ||
|
||
|
@@ -59,14 +61,16 @@ private void ReportPosition() | |
// z+ is north, x+ is east | ||
double[] GPS = Utilities.metersToGPS(new double[] { | ||
transform.position.z + _noise * Utilities.GaussianRandom(), | ||
transform.position.x + _noise * Utilities.GaussianRandom()}, | ||
new double[] {initLat, initLon}); | ||
transform.position.x + _noise * Utilities.GaussianRandom(), | ||
transform.position.y + _noise * Utilities.GaussianRandom()}, | ||
new double[] {initLat, initLon, initAlt}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can probably just insert something like |
||
JObject positionReport = new JObject() | ||
{ | ||
["type"] = "simGpsPositionReport", | ||
["latitude"] = GPS[0], | ||
["longitude"] = GPS[1] | ||
["longitude"] = GPS[1], | ||
["altitude"] = GPS[2] | ||
}; | ||
_socket.Send(positionReport); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure to update the READMEs with the updated report packets please 🙏 |
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are reporting the altitude in meters anyway, I don't think we need to pass it into this metersToGPS function