Skip to content

Commit

Permalink
DOCS-3233: Add readings key info to tabular data capture upload (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre authored Jan 10, 2025
1 parent d0c6169 commit d16bb3d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,21 +1345,28 @@ async def tabular_data_capture_upload(
::
from datetime import datetime
time_requested = datetime(2023, 6, 5, 11)
time_received = datetime(2023, 6, 5, 11, 0, 3)
file_id = await data_client.tabular_data_capture_upload(
part_id="INSERT YOUR PART ID",
component_type='rdk:component:motor',
component_name='left_motor',
method_name='IsPowered',
tags=["tag_1", "tag_2"],
component_type='rdk:component:movement_sensor',
component_name='my_movement_sensor',
method_name='Readings',
tags=["sensor_data"],
data_request_times=[(time_requested, time_received)],
tabular_data=[{'PowerPCT': 0, 'IsPowered': False}]
tabular_data=[{
'readings': {
'linear_velocity': {'x': 0.5, 'y': 0.0, 'z': 0.0},
'angular_velocity': {'x': 0.0, 'y': 0.0, 'z': 0.1}
}
}]
)
Args:
tabular_data (List[Mapping[str, Any]]): List of the data to be uploaded, represented tabularly as a collection of dictionaries.
Must include the key "readings" for sensors.
part_id (str): Part ID of the component used to capture the data.
component_type (str): Type of the component used to capture the data (for example, "rdk:component:movement_sensor").
component_name (str): Name of the component used to capture the data.
Expand Down

0 comments on commit d16bb3d

Please sign in to comment.