Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/sdk_protos_map.csv
Original file line number Diff line number Diff line change
Expand Up @@ -296,21 +296,6 @@ motion,DoCommand,,do_command,DoCommand,,doCommand
motion,GetResourceName,,get_resource_name,Name,,name
motion,Close,,close,Close,,

## Navigation
navigation,GetMode,,get_mode,Mode,,getMode
navigation,SetMode,,set_mode,SetMode,,setMode
navigation,GetLocation,,get_location,Location,,getLocation
navigation,GetWaypoints,,get_waypoints,Waypoints,,getWayPoints
navigation,AddWaypoint,,add_waypoint,AddWaypoint,,addWayPoint
navigation,RemoveWaypoint,,remove_waypoint,RemoveWaypoint,,removeWayPoint
navigation,GetObstacles,,get_obstacles,Obstacles,,getObstacles
navigation,GetPaths,,get_paths,Paths,,getPaths
navigation,GetProperties,,get_properties,Properties,,getProperties
## HACK: proto for these (and/or inherited in Go SDK), manually mapping:
navigation,Reconfigure,,,Reconfigure,,
navigation,DoCommand,,do_command,DoCommand,,doCommand
navigation,GetResourceName,,get_resource_name,Name,,name
navigation,Close,,close,Close,,

## SLAM
slam,GetPosition,,get_position,Position,,getPosition
Expand Down
45 changes: 24 additions & 21 deletions .github/workflows/update_sdk_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
## at runtime if desired:
components = ["arm", "base", "board", "button", "camera", "encoder", "gantry", "generic_component", "gripper",
"input_controller", "motor", "movement_sensor", "power_sensor", "sensor", "servo", "switch", "audio_in", "audio_out"]
services = ["base_remote_control", "data_manager", "discovery", "generic_service", "mlmodel", "motion", "navigation", "slam", "vision", "world_state_store"]
services = ["base_remote_control", "data_manager", "discovery", "generic_service", "mlmodel", "motion", "slam", "vision", "world_state_store"]
app_apis = ["app", "billing", "data", "dataset", "data_sync", "mltraining"]
robot_apis = ["robot"]

Expand Down Expand Up @@ -279,11 +279,6 @@
"name": "MotionServiceClient",
"methods": []
},
"navigation": {
"url": "https://raw.githubusercontent.com/viamrobotics/api/main/service/navigation/v1/navigation_grpc.pb.go",
"name": "NavigationServiceClient",
"methods": []
},
"slam": {
"url": "https://raw.githubusercontent.com/viamrobotics/api/main/service/slam/v1/slam_grpc.pb.go",
"name": "SLAMServiceClient",
Expand Down Expand Up @@ -936,7 +931,7 @@ def write_markdown(type, names, methods):
## Replace underscores, and convert generic_component to just generic:
resource_adjusted = resource.replace('generic_component', 'generic').replace('_','-')
proto_anchor_link = '/dev/reference/apis/components/' + resource_adjusted + '/#' + proto_link
elif type == 'service' and resource in ['base_remote_control', 'motion', 'navigation', 'slam', 'vision']:
elif type == 'service' and resource in ['base_remote_control', 'motion', 'slam', 'vision']:
proto_anchor_link = '/dev/reference/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
elif type == 'service' and resource == 'data_manager':
proto_anchor_link = '/dev/reference/apis/services/data/#' + proto_link
Expand Down Expand Up @@ -966,20 +961,28 @@ def write_markdown(type, names, methods):
## first sentence:


with open(proto_override_file, 'r') as f:
file_contents = f.read().strip()
file_contents = regex.sub(r'\{\{\%.*\%\}\}.*\{\{\% \/[a-b].* \%\}\}', '', file_contents, flags=regex.DOTALL)
search_result = file_contents.split('.\n', 1)[0].strip().replace("\n", " ")

## If the proto description contains any MD links, strip them out:
search_result = regex.sub(r'\[([A-Za-z0-9\.\(\)\-\_\`\s]*)\]\([A-Za-z0-9\.\:\/\-\_\#]*\)', r'\1', search_result)

## If the proto description is missing a trailing period, or we stripped it off during the above matching, append
## (restore) the period character:
if not search_result.endswith('.'):
proto_description_first_sentence = search_result + '.'
else:
proto_description_first_sentence = search_result
if os.path.isfile(proto_override_file):
with open(proto_override_file, 'r') as f:
file_contents = f.read().strip()
file_contents = regex.sub(r'\{\{\%.*\%\}\}.*\{\{\% \/[a-b].* \%\}\}', '', file_contents, flags=regex.DOTALL)
search_result = file_contents.split('.\n', 1)[0].strip().replace("\n", " ")

## If the proto description contains any MD links, strip them out:
search_result = regex.sub(r'\[([A-Za-z0-9\.\(\)\-\_\`\s]*)\]\([A-Za-z0-9\.\:\/\-\_\#]*\)', r'\1', search_result)

## If the proto description is missing a trailing period, or we stripped it off during the above matching, append
## (restore) the period character:
if not search_result.endswith('.'):
proto_description_first_sentence = search_result + '.'
else:
proto_description_first_sentence = search_result
else:
## No proto description override file (for example a proto whose
## docs section was removed); leave the description blank instead
## of crashing on the missing file, but warn so a genuinely
## missing override (an authoring gap) is still surfaced.
print(f"WARNING: {type} {resource} {proto} has no proto description override file ({proto_override_file}); leaving description blank")
proto_description_first_sentence = ''

## Write out this proto's entry to this resource's table_file:
if resource != 'movement_sensor':
Expand Down
Loading