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
- Connect with your Anduril representatives to get access to a Lattice environment. If you have access, go to
$YOUR_LATTICE_URL/docs
for documentation that includes features to streamline your development process.
-
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 install curl.
Authenticate to Lattice
Securely save the bearer token to authenticate requests to the Lattice environment:
- Go to the Account & Security page in Lattice:
$YOUR_LATTICE_URL/user-settings
- In the Bearer tokens section, click + New Token and enter the
following:
- For Bearer token name, enter a descriptive name for your bearer token.
- For Bearer token expiration, select an expiration time frame.
- Click Create to generate and copy your bearer token. After this step, the bearer token will not be visible again.
Publish surface vessel to Lattice
In your terminal, enter the following command:
curl --location --request PUT 'https://$YOUR_LATTICE_URL/api/v1/entities' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $YOUR_BEARER_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"
}
}'
$YOUR_LATTICE_URL
with the URL you use to access the Lattice common operational picture. For example,usa.anduril.com
.$YOUR_BEARER_TOKEN
with the bearer token you generated above. Make sure you keepBearer
in your request.
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.