From 2eca0d7d247c47b8544a74304b2bc3e613cf05b7 Mon Sep 17 00:00:00 2001 From: Rishikesh Lolapu <31lolapr@elmbrookstudents.org> Date: Sat, 4 Oct 2025 00:23:53 +0000 Subject: [PATCH 1/2] Initial commit Mission Run #5 --- missions/Bautism.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 missions/Bautism.py diff --git a/missions/Bautism.py b/missions/Bautism.py new file mode 100644 index 0000000..aeb80c2 --- /dev/null +++ b/missions/Bautism.py @@ -0,0 +1,45 @@ +from pybricks.hubs import PrimeHub +from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor +from pybricks.parameters import Button, Color, Direction, Port, Side, Stop +from pybricks.robotics import DriveBase +from pybricks.tools import wait, StopWatch, run_task + +hub = PrimeHub() + +# Initialize both motors. In this example, the motor on the +# left must turn counterclockwise to make the robot go forward. +left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE) +right_motor = Motor(Port.B) + +arm_motor = Motor(Port.D, Direction.CLOCKWISE) +arm_motor_left= Motor(Port.C, Direction.CLOCKWISE) +# Initialize the drive base. In this example, the wheel diameter is 56mm. +# The distance between the two wheel-ground contact points is 112mm. +drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180) + +print('The default settings are: ' + str(drive_base.settings())) +drive_base.settings(300,1000,300,750) +# Optionally, uncomment the line below to use the gyro for improved accuracy. +drive_base.use_gyro(True) + +async def main(): + await drive_base.straight(519) + await arm_motor_left.run_angle(300, -100) + await arm_motor_left.run_angle(300, 500) + await drive_base.straight(180) + await drive_base.turn(-37) + await drive_base.straight(50) + await arm_motor.run_angle(300, -400) + await drive_base.straight(-150) + await drive_base.turn(135) + await drive_base.straight(50) + await arm_motor.run_angle(300, 400) + await drive_base.straight(-75) + await arm_motor.run_angle(300, 300) + await drive_base.turn(-50) + await drive_base.straight(162) + await arm_motor.run_angle(100, -200) + await drive_base.straight(30) + await arm_motor.run_angle(50,-500) + +run_task(main()) \ No newline at end of file -- 2.49.1 From 4b765b0e9d5d9cba1b2417f8ca652afc6e22691d Mon Sep 17 00:00:00 2001 From: Rishikesh Lolapu <31lolapr@elmbrookstudents.org> Date: Sat, 4 Oct 2025 00:55:26 +0000 Subject: [PATCH 2/2] Update missions/M8_5.py --- missions/M8_5.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/missions/M8_5.py b/missions/M8_5.py index 69e364d..95ecc9e 100644 --- a/missions/M8_5.py +++ b/missions/M8_5.py @@ -30,14 +30,14 @@ async def main(): await right_arm.run_angle(5000,-500, Stop.HOLD) await drive_base.turn(-20) - await drive_base.straight(275) + await drive_base.straight(277) await drive_base.turn(20) - await drive_base.straight(63) + await drive_base.straight(65) await drive_base.turn(-30) right_arm.run_angle(50,500) await drive_base.turn(45) - await drive_base.straight(-135) + await drive_base.straight(-145) await drive_base.turn(-60) await drive_base.straight(90) await left_arm.run_angle(1000,-450) @@ -45,5 +45,5 @@ async def main(): await left_arm.run_angle(1000,450) await drive_base.straight(10) await drive_base.turn(35) - await drive_base.straight(-500) + await drive_base.straight(-600) run_task(main()) \ No newline at end of file -- 2.49.1