RoboLab Autumn Course – A/D & Mechanics
Transcript of RoboLab Autumn Course – A/D & Mechanics
by M.Sc. Samuel Knobloch
Faculty of Computer Science, Institute of Systems Architecture, Chair of Systems Engineering
RoboLab Autumn Course – A/D & Mechanics
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 2
Overview
● EV3DEV: Color Sensor
● EV3DEV: Large Motor
● EV3DEV: Text-to-Speech
● Using the Deploy-Script
● Further information about Assignment 5, the Exam and the LEGO box
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 3
EV3DEV: Color Sensor
● Can measure light intensity and color values
● Has an ambient light for better detection
● We use this sensor for reading the bar code cards and converting it into a digital representation
➔ You need to measure a threshold for detecting RED, WHITE and BLACK (or try to use the defaults)
● Example:
>>> import ev3dev.ev3 as ev3
>>> cs = ev3.ColorSensor(‘in1’)>>> cs.mode = ‘RGB-RAW‘>>> cs.bin_data(“hhh”)(354, 415, 543)
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 4
EV3DEV: Large Motor
● Belongs to the class of Tacho Motors
● Has several switches for adjusting rotation speed, ramp up/down time, how to stop, reset etc.
● We use these motors for moving the sensor and as step-wise paper feed
● Example:
import ev3dev.ev3 as ev3
lm = ev3.LargeMotor(‘outA’)lm.run_to_abs_pos(position_sp=0, speed_sp=50, stop_action=‘hold‘)lm.wait_while(‘running‘)
print(lm.position()) # Prints e.g. -120
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 5
EV3DEV: Text-to-Speech
● Your robot can speak! The sound module is capable of doing proper TTS.
● Example:
>>> import ev3dev.ev3 as ev3
>>> ev3.Sound.beep()>>> ev3.Sound.tone([(200, 100, 100), (500, 200)])>>> ev3.Sound.speak(“Hello World!“)
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 6
Using the Deploy-Script
● Is bundled together with the template repository (git submodule)
● Use the „--recursive“ flag while cloning your group repository
●
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 7
Using the Deploy-Script
● Is bundled together with the template repository (git submodule)
➔ Use the “--recursive” flag while cloning the group repository
● We recommend (for Windows) using GitBash or the WSL as environment
● How it works:
➔ Execute “./deploy“ on your local machine
➔ Your code is send to the LEGO brick
➔ A fork server will create a new environment on the brick and run your code
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 8
Sources and Additional Information
● https://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/motors.html
● https://ev3dev-lang.readthedocs.io/projects/python-ev3dev/en/stable/sensors.html
● https://robolab.inf.tu-dresden.de/dev/deploy_script/
● https://robolab.inf.tu-dresden.de/equipment/
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 9
Assignment 5 – Bring your robot to life
About the Exam
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 10
Assignment 5 – Bring your robot to life
● Construct your robot and make sure that the range for moving the color sensor is sufficient for the bar code cards
● Bring together your already implemented parts HammingCode and StackMachine
● Implement all functions and other logic needed in order to move the sensor and feed the bar code card
➔ We provided the file “robot.py“ for this
● Write a combined unit-test using a list of Hamming Codes to feed your class and execute them afterwards
● Make yourself familiar with the deploy-script (if not already done) and have fun with your robot
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 11
About the Exam
● The exam is scheduled for 17th of January 2020
➔ We will restrict your repository access to read-only on this day
➔ Will be done during our session time and in group appointments
● After receiving the notification of passing all four assignments you have to enrol into the exam
➔ HISQIS: Module 140710
➔ Will be available in CW50/CW51
● We will have a final consultation on 10th of January 2020
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 12
LEGO Mindstorms EV3 Set
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 13
LEGO Mindstorms EV3 Set
RoboLab Autumn Course – A/D & MechanicsFaculty of Computer Science, Institute of Systems Architecture, Chair of Systems EngineeringSamuel Knobloch
Slide 14
LEGO Mindstorms EV3 Set