diff --git a/.github/workflows/parse_go.py b/.github/workflows/parse_go.py index 2a0b2d5a6c..6d3cb8f1a4 100755 --- a/.github/workflows/parse_go.py +++ b/.github/workflows/parse_go.py @@ -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.', \ @@ -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 context.Context) ([]referenceframe.Input, error)', \ + '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 context.Context, inputSteps ...[]referenceframe.Input) error', \ + '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': diff --git a/.github/workflows/update_sdk_methods.py b/.github/workflows/update_sdk_methods.py index 47778dfcf6..25f24e3b86 100755 --- a/.github/workflows/update_sdk_methods.py +++ b/.github/workflows/update_sdk_methods.py @@ -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")