-
Notifications
You must be signed in to change notification settings - Fork 11
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
Framework for Mechanisms (Active/Passive) #105
Comments
Rough Spec: A spec for a interface IMechanismSpec {
type: string;
mountFace: SensorMountingFace;
ioMap: IMechanismIOConfig[]; // 1 entry for each IO that is needed
// Getters and setters for the various IO channels
}
interface IMechanismIOConfig {
id: string; // Identifier for this IO channel
ioType: string; // Could also be an enum of "PWM" | "DIGITAL_IN" | "DIGITAL_OUT" | "ANALOG_IN"
ioChannel: number;
}
// Rough sketch of the SimMechanism base class
// Very incomplete, and this should save the spec properties somewhere
abstract class SimMechanism extends SimObject {
public abstract getValue(ioIdentifier: string): number | boolean; // Get a value from an input IO device
public abstract setValue(ioIdentifier: string, value: number | boolean): void; // Set a value to an output IO device
} General concepts:
|
Basic Gripper Mechanism For the purposes of the FTC Sim, we can define a basic gripper that is made up of a set of parallel jaws, controlled by a single DIGITAL_OUT device (if this is set to LOW, the jaw is open, and if HIGH, the jaw is closed).
interface IGripperMechanismSpec extends IMechanismSpec {
type: "gripper";
depth: number; // see crude drawing above
maxWidth: number; // see crude drawing above
minWidth: number;
}
class GripperMechanism extends SimMechanism {
constructor(.........., spec: IGripperMechanismSpec) {
// instantiate this. Should take in a single DIGITAL_OUT device
}
setValue(ioIdentifier: string, value: number | boolean): void {
// This should update the open/closed state of the jaws
// When transitioning state, check to see if there is an object within the jaws and act accordingly
}
update() {
// This function should manage the behavior of the gripper
// e.g. set flags/manipulate object position if the jaws are closed
// This should get called every update cycle
}
} |
i would guess that we need a way to see if the mechanism had grabbed something or not. i.e. setValue(close grip) |
Ah yes, we could have another DIGITAL_IN device act as a "is there an object" sensor |
We'll need some way to specify mechanisms (either active or passive) and where they are mounted on a robot. Additionally, there needs to be some sort of API that allows us to interact with an active mechanism
The text was updated successfully, but these errors were encountered: