Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplementation of RemoteRobot Autogenerated Functions #59

Open
JoeS51 opened this issue Feb 3, 2023 · 0 comments
Open

Reimplementation of RemoteRobot Autogenerated Functions #59

JoeS51 opened this issue Feb 3, 2023 · 0 comments

Comments

@JoeS51
Copy link

JoeS51 commented Feb 3, 2023

Currently, operator uses incrementalMove commands for small adjustments with the lift, head, and wrist. However, incrementalMove's nature makes it much harder to read and understand what it's doing compared to one of the autogenerated functions called "lookLeft" for example. As such, we want to replace the incrementalMoves inside of the operator file with the appropriate autogenerated functions from remoterobot to make the code base cleaner and more readable.

The lines where the remoterobot autogenerated functions are being created (might need to change modifier's type to any):

for (let [groupName, groups] of Object.entries(RemoteRobot.COMMANDS)) {
for (let [name, methodName] of Object.entries(groups)) {
if (methodName === null) {
methodName = groupName + name[0].toUpperCase() + name.substr(1);
}
RemoteRobot.prototype[methodName] = function (modifier: string) {
let cmd: cmd = {
type: "command",
subtype: groupName,
name: name,
modifier: modifier,
};
this.robotChannel(cmd);
this.emitCommandEvent(cmd);
}
}
}

The commit where we changed from the autogenerated functions to incrementalMove:
b42724f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant