Skip to main content

Quickstart

This walks through fetching a vessel's current state — the smallest end-to-end call.

Install the SDK

Add the generated gRPC client for your language. See Install the SDK for the full per-language commands.

Create an authenticated channel

Set PLATFORM_ENDPOINT and PLATFORM_TOKEN, then open a secure channel as shown in Authenticate.

Fetch the vessel state

Call GetVesselState with a vessel ID and read the position off the response.

from greenroom.vessel.v1 import vessel_service_pb2, vessel_service_pb2_grpc

channel = create_channel() # from the Authenticate guide
client = vessel_service_pb2_grpc.VesselStateServiceStub(channel)

response = client.GetVesselState(
vessel_service_pb2.GetVesselStateRequest(vessel_id="vessel_1")
)
state = response.state
print(
f"{state.vessel_id}: "
f"{state.geopose.position.latitude:.6f}, "
f"{state.geopose.position.longitude:.6f}"
)

Where to next