SDK & CLI#
Tip
Our Python SDK is open source! Check out github.com/roboto-ai/roboto-python-sdk.
Overview#
The Python SDK and CLI can both be used to programmatically interact with Roboto.
The CLI is convenient for quickly creating new datasets, uploading or downloading files, and running actions. The Python SDK has comprehensive support for all Roboto platform features and is especially useful for data analysis and integration with your other tools.
See reference documentation for the Python SDK and the CLI.
Install#
Refer to the latest installation instructions available on GitHub.
CLI#
With the Python SDK, or standalone CLI installed, you can use roboto
on the command line.
The example below shows how to create a new dataset and upload a file to it.
$ roboto datasets create --tag boston
{
"administrator": "Roboto",
"created": "2024-09-25T22:22:48.271387Z",
"created_by": "benji@roboto.ai",
"dataset_id": "ds_9ggdi910gntp",
...
"tags": [
"boston",
]
}
$ roboto datasets upload-files -d ds_9ggdi910gntp -p scene57.bag
100.0%|█████████████████████████ | 58.9M/58.9M | 2.62MB/s | 00:23 | Src: 1 file
Python SDK#
With the Python SDK installed, you can import roboto
into your Python runtime.
The example below shows how to access topic data for an ingested ROS bag file:
from roboto import Dataset
ds = Dataset.from_id("ds_9ggdi910gntp")
bag = ds.get_file_by_path("scene57.bag")
steering_topic = bag.get_topic("/vehicle_monitor/steering")
steering_data = steering_topic.get_data(
start_time="1714513576", # "<sec>.<nsec>" since epoch
end_time="1714513590",
)
You can also create events:
from roboto import Event
Event.create(
start_time="1714513580", # "<sec>.<nsec>" since epoch
end_time="1714513590",
name="Fast Turn",
topic_ids=[steering_topic.topic_id]
)
Or even search for logs matching metadata and/or statistics with RoboQL:
from roboto import query, RobotoSearch
roboto_search = RobotoSearch(query.client.QueryClient())
query = '''
dataset.tags CONTAINS 'boston' AND
topics[0].msgpaths[/vehicle_monitor/vehicle_speed.data].max > 20
'''
results = roboto_search.find_files(query)
Refer to our collection of notebooks for complete examples, and the SDK reference.