Closed 12sliu closed 7 months ago
https://github.com/Brighton-FTC/2024/commit/943b61b352d12679ea17121939ff985aac3f246a Made a very basic implementation of the grabber code. Code is a bit sloppy, but I'll work on it tomorrow.
Here it says that ServoEx
should be initialized like this:
ServoEx servo = new SimpleServo(
hardwareMap, "servo_name", MIN_ANGLE, MAX_ANGLE
);
I think I should probably do that instead of what I did in my code; now that I think about it, it doesn't make much sense that a Servo
object should just magically get all the methods of ServoEx
, but I don't know much about type conversions in java, so i don't really know how what I did in my code would work:
ServoEx servo = (ServoEx) hardwareMap.servo.get("servo_name");
Best to follow FTCLib example, I suppose.
By the way, you do have tests this week, maybe consider taking a break from robotics to study? Engineers haven't done anything we can test on, so we won't be able to test anything we write; there's time pressure, but it's not THAT urgent. I'm swamped with tests (8 in the next 7 days), so I also won't be able to work too much on the code; I won't think less of you if you don't complete your issue as fast as possible within these few days.
https://github.com/Brighton-FTC/2024/commit/79e4caa8020a858b1e11e0bf40dfef572942a322
Ok I implemented the SimpleServo
thing.
@12sliu, do we know what the servo names are?
Also, how do we find angle the servos need to be at to open/close/tilt the grabber? I was thinking of making a separate opmode to get those values, but do you know of a better way?
Pretty sure we get to name them in the software ourselves while setting things up, though I'm not entirely sure; we'll ask Oliver today
I'll have to talk to Nick if our grabber uses 1 or 2 servos
Also, I noticed you use gamepad.WasJustPressed
, I remember there was a way to bind a command to a trigger in init; they should be the same functionally, but is there any difference between the two I haven't noticed?
Otherwise, thing looks good; we can modify it for the other components. Yay! Less work.
I remember there might have been some problem with gamepad.wasJustPressed()
last year, but I can't remember. Either way, if you think it's more elegant, or there's some problem with gamepad.wasJustPressed()
, it should be easy to change the code to bind the commands in init.
No need to change it, just leave as is.
https://github.com/Brighton-FTC/2024/commit/d267bbe28d38b214a3928da093f789c629620d1d
Made grabber into component class.
Deprecated, as we plan to use active intake instead.
Grabber is not used anymore; not sure why this is still here.
This is just making a simple grabber like last time. Shouldn't be that hard, use last year's grabber as a example and we should be fine.