Skip to content

Reimplementation of RemoteRobot Autogenerated Functions #59

@JoeS51

Description

@JoeS51

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions