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
12 changes: 11 additions & 1 deletion .github/workflows/parse_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ def parse(self, type, viam_resources):
self.go_methods[type][resource]['Readings']['code_sample'] = code_sample[0].find_next('pre').text.replace("\t", " ")

## Similarly, if the resource being considered inherits from framesystem.InputEnabled (Arm, for example),
## then add the one inherited method manually: Kinematics():
## then add its three inherited methods manually: Kinematics(), CurrentInputs(), and GoToInputs().
## These are documented on the framesystem.InputEnabled interface page, not the resource's own
## pkg.go.dev page, so the inline method scraper above does not find them.
if '\tframesystem.InputEnabled' in resource_interface.text:
self.go_methods[type][resource]['Kinematics'] = {'proto': 'GetKinematics', \
'description': 'Kinematics returns the kinematics model of the resource.', \
Expand All @@ -374,6 +376,14 @@ def parse(self, type, viam_resources):
code_sample = resource_soup.find_all(lambda code_sample_tag: code_sample_tag.name == 'p' and "Kinematics example:" in code_sample_tag.text)
if code_sample:
self.go_methods[type][resource]['Kinematics']['code_sample'] = code_sample[0].find_next('pre').text.replace("\t", " ")
self.go_methods[type][resource]['CurrentInputs'] = {'proto': 'GetCurrentInputs', \
'description': 'CurrentInputs returns the current inputs of the resource.', \
'usage': 'CurrentInputs(ctx <a href="/context">context</a>.<a href="/context#Context">Context</a>) (<a href="/go.viam.com/rdk/referenceframe#Input">[]referenceframe.Input</a>, <a href="/builtin#error">error</a>)', \
'method_link': 'https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#InputEnabled'}
self.go_methods[type][resource]['GoToInputs'] = {'proto': 'GoToInputs', \
'description': 'GoToInputs moves the resource to the specified inputs, in order.', \
'usage': 'GoToInputs(ctx <a href="/context">context</a>.<a href="/context#Context">Context</a>, inputSteps ...<a href="/go.viam.com/rdk/referenceframe#Input">[]referenceframe.Input</a>) <a href="/builtin#error">error</a>', \
'method_link': 'https://pkg.go.dev/go.viam.com/rdk/robot/framesystem#InputEnabled'}

## For SLAM service only, additionally fetch data for two helper methods defined outside of the resource's interface:
if resource == 'slam':
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_sdk_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def check_for_unused_methods(methods, type):
if resource in ["data_sync", "dataset", "data"]:
continue
if lang == "python" and method not in ["from_robot", "close", "get_resource_name", "get_geometries", "do_command", "proto", "transform", "updated_fields", "ListUUIDs", "GetTransform", "StreamTransformChanges", "DoCommand"] or \
lang == "go" and method not in ["Reconfigure", "ListTunnels", "Close", "DoCommand", "CurrentPosition", "AddTagsToBinaryDataByFilter", "RemoveTagsFromBinaryDataByFilter"] or \
lang == "go" and method not in ["Reconfigure", "ListTunnels", "Close", "DoCommand", "CurrentPosition", "AddTagsToBinaryDataByFilter", "RemoveTagsFromBinaryDataByFilter", "CurrentInputs", "GoToInputs"] or \
lang == "flutter" and method not in ["getResources", "getStream", "getStreamOptions", "resetStreamOptions", "setStreamOptions", "Discovery.fromProto", "addCallbacks", "getResource"] or \
lang == "typescript" and method not in ["connect", "disconnect", "dial", "isConnected", "discoverComponents", "createServiceClient", "getRoverRentalRobots", "doCommand"]:
print(f"WARNING: {lang} {type} {resource} {method} is unused")
Expand Down
Loading