Skip to content

Commit d16bb3d

Browse files
authored
DOCS-3233: Add readings key info to tabular data capture upload (#810)
1 parent d0c6169 commit d16bb3d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/viam/app/data_client.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,21 +1345,28 @@ async def tabular_data_capture_upload(
13451345
13461346
::
13471347
1348+
from datetime import datetime
1349+
13481350
time_requested = datetime(2023, 6, 5, 11)
13491351
time_received = datetime(2023, 6, 5, 11, 0, 3)
1350-
13511352
file_id = await data_client.tabular_data_capture_upload(
13521353
part_id="INSERT YOUR PART ID",
1353-
component_type='rdk:component:motor',
1354-
component_name='left_motor',
1355-
method_name='IsPowered',
1356-
tags=["tag_1", "tag_2"],
1354+
component_type='rdk:component:movement_sensor',
1355+
component_name='my_movement_sensor',
1356+
method_name='Readings',
1357+
tags=["sensor_data"],
13571358
data_request_times=[(time_requested, time_received)],
1358-
tabular_data=[{'PowerPCT': 0, 'IsPowered': False}]
1359+
tabular_data=[{
1360+
'readings': {
1361+
'linear_velocity': {'x': 0.5, 'y': 0.0, 'z': 0.0},
1362+
'angular_velocity': {'x': 0.0, 'y': 0.0, 'z': 0.1}
1363+
}
1364+
}]
13591365
)
13601366
13611367
Args:
13621368
tabular_data (List[Mapping[str, Any]]): List of the data to be uploaded, represented tabularly as a collection of dictionaries.
1369+
Must include the key "readings" for sensors.
13631370
part_id (str): Part ID of the component used to capture the data.
13641371
component_type (str): Type of the component used to capture the data (for example, "rdk:component:movement_sensor").
13651372
component_name (str): Name of the component used to capture the data.

0 commit comments

Comments
 (0)