Skip to content

Added elevation data on simulator side #22

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

Merged
merged 4 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Assets/Scripts/GpsSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -62,11 +64,14 @@ private void ReportPosition()
transform.position.x + _noise * Utilities.GaussianRandom()},
new double[] {initLat, initLon});

double altitude = initAlt + transform.position.y + _noise * Utilities.GaussianRandom();

JObject positionReport = new JObject()
{
["type"] = "simGpsPositionReport",
["latitude"] = GPS[0],
["longitude"] = GPS[1]
["longitude"] = GPS[1],
["altitude"] = altitude
};
_socket.Send(positionReport);
}
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,22 @@ Sent from the simulator to inform the rover server of the rover's exact pose.

## GPS Position Report
### Description
Sent from the simulator to inform the rover server of the geographic position provided by a simulated GPS sensor. The position will be reported in standard geographic coordinates. The simulated GPS sensor will map Unity's cartesian origin to Null Island. Gaussian noise is applied to the latitude and longitude.
Sent from the simulator to inform the rover server of the geographic position provided by a simulated GPS sensor. The position will be reported in standard geographic coordinates. The simulated GPS sensor will map Unity's cartesian origin to Null Island. Gaussian noise is applied to the latitude, longitude and altitude.

### Syntax
```
{
type: "simGpsPositionReport",
latitude: number,
longitude: number
longitude: number,
altitude: number,
}
```

### Parameters
- `latitude` - the latitude in degrees
- `longitude` - the longitude in degrees
- `altitude` - the altitude in meters

## IMU Orientation Report
### Description
Expand Down