Skip to content
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();

Comment thread
PatrickRung marked this conversation as resolved.
JObject positionReport = new JObject()
{
["type"] = "simGpsPositionReport",
["latitude"] = GPS[0],
["longitude"] = GPS[1]
["longitude"] = GPS[1],
["altitude"] = altitude
};
_socket.Send(positionReport);
Comment thread
PatrickRung marked this conversation as resolved.
}
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