Lattice SDK quickstart: Publish vessel
Experiment with the Lattice SDK before you develop your application by connecting to the Lattice environment and publishing a surface vessel.
Before you begin
- Complete the set up steps to log in to the Sandbox and create an environment. If you do not have access to a Lattice Sandbox, request to join the Lattice SDK developer program.
-
Make sure you have the curl command-line tool by running the following in your terminal:
curl --version
If you get a message similar to
command not found: curl
, download and installcurl
.
Publish surface vessel to Lattice
In your terminal, enter the following command. Replace:
$YOUR_LATTICE_URL
: The environment URL for the environment your want to use.$YOUR_ENVIRONMENT_TOKEN
: Your environment bearer token.
If using Lattice Sandboxes, get the value for $YOUR_SANDBOXES_TOKEN
from the
Account & Security page in the Lattice Sandboxes platform.
curl --location --request PUT 'https://$YOUR_LATTICE_URL/api/v1/entities' \
--header 'content-type: application/json' \
--header 'authorization: Bearer $YOUR_ENVIRONMENT_TOKEN' \
# Add the following header statement if you're using Lattice Sandboxes.
# --header 'anduril-sandbox-authorization: Bearer $YOUR_SANDBOX_TOKEN' \
--include \
--data '{
"entityId": "",
"description": "Quickstart example",
"isLive": true,
"createdTime": "undefined",
"expiryTime": "1970-01-04T00:00:00.000Z",
"aliases": {
"name": ""
},
"milView": {
"disposition": "DISPOSITION_FRIENDLY",
"environment": "ENVIRONMENT_SURFACE"
},
"location": {
"position": {
"latitudeDegrees": 0,
"longitudeDegrees": 0,
"altitudeHaeMeters": 0
}
},
"ontology": {
"template": "TEMPLATE_TRACK",
"platformType": "Surface_Vessel",
"specificType": "N/A"
},
"provenance": {
"dataType": "docs-example",
"integrationName": "quickstart-example",
"sourceUpdateTime": "undefined"
}
}'
If the request is successful, you get a 200
status response with an empty body: {}
.
When refreshing this page, the code sample above dynamically updates values in the following fields to create unique objects in your environment:
entity_id
createdTime
expiryTime
aliases.name
provenance.sourceUpdateTime
Verify vessel in Lattice
The previous request publishes a track entity to your Lattice environment. You can verify the surface vessel in your Lattice environment:
- Go to your Lattice environment.
-
Open the Track panel by clicking
Tracks in your environment's left-hand sidebar.
-
In the Track panel's search bar, find your published surface vessel by searching for the
aliases.name
value that you specified in your request. -
To center your view on the surface vessel, select the vessel in the Tracks panel and click
Center.
You have successfully made a request using the Lattice SDK and published a surface vessel entity to Lattice.
What's next
- Ready to start building? Set up your development environment.
- Check out our sample apps in GitHub.