Roboter comments added

This commit is contained in:
2023-06-06 11:28:24 +02:00
parent bd1daa0489
commit 445373a668
14 changed files with 132 additions and 96 deletions
+9
View File
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
"""
created by waldhauser
This file contains the programm to drive the arm back to middle
This file is needed for the color code drive operation
The plant where the robot is has to be passed as argument
"""
from ev3dev2.motor import Motor, OUTPUT_B, OUTPUT_C, SpeedPercent
import sys
+9 -2
View File
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
"""
created by waldhauser
This file contains the programm to drive the arm back to middle and drive the robot back to home
This file is needed for the hard code driving operations
The plant where the robot is has to be passed as argument
"""
from ev3dev2.motor import Motor, LargeMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
from ev3dev2.sensor.lego import TouchSensor, UltrasonicSensor
from ev3dev2.sensor import INPUT_1, INPUT_4
@@ -31,8 +40,6 @@ while True:
motorRight.on(SpeedPercent(-25))
break
sensorTouch.wait_for_pressed(timeout_ms=None, sleep_ms=10)
motorLeft.off()
motorRight.off()
@@ -1,4 +1,14 @@
#!/usr/bin/env python3
"""
created by waldhauser
This file contains the programm to drive the robot back to the starting position
This file is needed for the color code drive operation
No arguments are needed
The end is determined by the UltraSonic- and TouchSensor
"""
from ev3dev2.motor import LargeMotor, OUTPUT_A, OUTPUT_D, SpeedPercent
from ev3dev2.sensor.lego import TouchSensor, UltrasonicSensor
from ev3dev2.sensor import INPUT_1, INPUT_4
+6 -4
View File
@@ -1,9 +1,11 @@
#!/usr/bin/env pybricks-micropython
'''
Script to drive robot to plant.
Plant number is passed as argument.
'''
"""
created by waldhauser
This file contians the programm to drive to a specific plant based on the color codes
The plant where the robot is has to be passed as argument
"""
from ev3dev2.motor import Motor, LargeMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
from ev3dev2.sensor.lego import ColorSensor
-65
View File
@@ -1,65 +0,0 @@
#!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybricks.tools import wait, StopWatch, DataLog
from pybricks.robotics import DriveBase
from pybricks.media.ev3dev import SoundFile, ImageFile
import sys
def fun_1(ev3):
pass
def fun_2(a,b):
return 1
def move_1(mo_forward_1, mo_forward_2, mo_le_ri, mo_up_down):
wait(2000)
#move forward
mo_forward_1.run_target(500, 1250,wait=False)
mo_forward_2.run_target(500, 1250)
#move arm
mo_le_ri.run_target(200,-50)
#move sensors
mo_up_down.run_target(500,2500)
wait(2000)
mo_up_down.run_target(500,0)
#move arm
mo_le_ri.run_target(200,0)
#move backwards
mo_forward_1.run_target(500, 0,wait=False)
mo_forward_2.run_target(500, 0)
def move_2():
pass
def move_3():
pass
ev3 = EV3Brick()
motor_forward_1 = Motor(Port.A)
motor_forward_2 = Motor(Port.D)
motor_le_ri = Motor(Port.B, Direction.COUNTERCLOCKWISE, [8, 56]) #with gear for angle
motor_up_down = Motor(Port.C)
#n = int(sys.argv[1])
#if n == 1:
move_1(motor_forward_1,motor_forward_2,motor_le_ri,motor_up_down)
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env pybricks-micropython
"""
created by waldhauser
This file contians the programm to drive a specfic plant with a certain distance to drive
"""
from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
motorRight = LargeMotor(OUTPUT_A)
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env pybricks-micropython
"""
created by waldhauser
This file contians the programm to drive a specfic plant with a certain distance to drive
"""
from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
motorRight = LargeMotor(OUTPUT_A)
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env pybricks-micropython
"""
created by waldhauser
This file contians the programm to drive a specfic plant with a certain distance to drive
"""
from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
motorRight = LargeMotor(OUTPUT_A)
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env pybricks-micropython
"""
created by waldhauser
This file contians the programm to drive a specfic plant with a certain distance to drive
"""
from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
motorRight = LargeMotor(OUTPUT_A)
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env pybricks-micropython
"""
created by waldhauser
This file contians the programm to drive a specfic plant with a certain distance to drive
"""
from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
motorRight = LargeMotor(OUTPUT_A)
+6
View File
@@ -1,5 +1,11 @@
#!/usr/bin/env pybricks-micropython
"""
created by waldhauser
This file contians the programm to drive a specfic plant with a certain distance to drive
"""
from ev3dev2.motor import Motor, LargeMotor, ServoMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
motorRight = LargeMotor(OUTPUT_A)