0% found this document useful (0 votes)
15 views27 pages

CPE313 Week4

This document outlines the Week 4 lecture for the Robotics Technology course, focusing on how sensors provide information for robot programming and decision-making. Key learning objectives include understanding SPPA, pseudocode, and comparison operators, along with practical tasks involving the use of sensors and programming commands. Students are tasked with projects that involve programming a robot to detect lines and calculate sensor thresholds, culminating in challenges that reinforce the concepts learned.

Uploaded by

sccbos31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views27 pages

CPE313 Week4

This document outlines the Week 4 lecture for the Robotics Technology course, focusing on how sensors provide information for robot programming and decision-making. Key learning objectives include understanding SPPA, pseudocode, and comparison operators, along with practical tasks involving the use of sensors and programming commands. Students are tasked with projects that involve programming a robot to detect lines and calculate sensor thresholds, culminating in challenges that reinforce the concepts learned.

Uploaded by

sccbos31
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Duration: 120 min Lecture: Week 4 Learners: UG 3rd year Course Code: CPE313

Robotics Technology
Dr. Mohannad Farag

2021-2022, Semester I
Lesson overview

In this week, you will how sensors provide information about the world. How to block the project flow using wait until
command. Program your robot with a Pseudocode approach, calculating threshold of analog sensor values. Also, you will
learn how to use Comparison Operators to let VR robot to make its decision. You will implement these knowledge to solve
Line dectector challenge.

Learning objectives
1. Identify SPPA term and some of sensor's types.
2. Identify the wait until command using while not loop.
3. Identify the Pseudocode term.
4. Identify the threshold of analog sensor values.
5. Identify Comparison Operators.

Keywords

sensor, while not loop, wait until condition, pseudocode,


comparison operators, threshold, trajectory
Sense, Perceive, Plan, Act (SPPA)
How can the robot tell when it reaches the weight?

• The robot can tell when it reaches the weight using the Bumper Switch Sensor. And in both
cases, that’s how the robot knows when to stop.

Short distance Long distance

GIF image link GIF image link


Sense, Perceive, Plan, Act
• Sensors provide information about the world. The
program uses that information to figure out when
to stop. And then the robot acts accordingly.

• Sense, Perceive, Plan, Act (SPPA) summarizes the


four critical capabilities that every robot must have
in order to operate effectively:

A critical review on automation of steering


mechanism of load haul dump machine
Sense, Perceive, Plan, Act

• A robot needs the ability to sense important things


about its environment, like the presence of
obstacles or navigation aids.

GIF image link


Sense, Perceive, Plan, Act

• Perception answers the question “What am I


looking at?” This requires more than raw sensor
data -the robot needs to make sense of that data

• Perhaps it needs to combine information from a


few sensors to figure that out. Interpreting raw
sensor data into useful understandings about the
environment is called perception.

• Perception allows a robot to act in a way that is


appropriate and safe within the environment.
Sense, Perceive, Plan, Act

• Based on its understanding of the world around it, the robot then needs to respond
appropriately. Sometimes the strategy can be written in advance, like turning left at the first wall.

• Other times, the robot needs to figure out


the right combination of moves on the spot.
In either case, the robot will follow the
program written by the human programmer
that tells it what to do next, or how to figure
that out for itself.

GIF image link Write a program for the robot to understand


Sense, Perceive, Plan, Act

• Finally, a robot must carry out the actions that


the plan calls for.

• Robots will do exactly what you tell them to do.


If it doesn’t, that means what you said isn’t the
same as what you meant.

• Your robot will only act accordingly if your plan


is precise!

GIF image link


Robotic Paradigm

Robotic Paradigm can be divided into separate


subsystems, all communicating with each other:

• Perception Subsystem
• Planning Subsystem
• Controls Subsystem

https://medium.com/streetdrone/hello-world-sense-plan-act-aa5772e93344
Perception Subsystem

This is the vehicle’s center of understanding its environment. It receives the sensors’ output to
perform 3D scene reconstruction and to make decisions about the vehicles’ surroundings.

• Using the information from the


cameras, the lidar and the radar
(sensors), detection model performs
static obstacle detection, dynamic
object tracking and free space
detection.

• The localization module determines the vehicle’s precise location using the lidar
data and the extracted map and comparing the two-point clouds.
Planning Subsystem

Planning system uses the processed information from the perception subsystem to calculate
the vehicle’s path. It can be divided into the route planning, the behavior planning and the
trajectory generation modules. It can be divided into:

• the route planning,


• the behavior planning and
• the trajectory generation modules.

https://medium.com/streetdrone/hello-world-sense-plan-act-aa5772e93344
Controls Subsystem (the robot will act)

• The robot will act by translating the velocity requests into movement commands using
Proportional–Integral–Derivative (PID) controller and Model Predictive Control (MPC).

• The output of theses controllers are


implemented on the Drive By Wire
(DBW) actuators.
• In DBW technology, the vehicle
functions traditionally achieved by
mechanical linkages could be
performed by the electrical or
electro-mechanical systems.
https://medium.com/streetdrone/hello-world-sense-plan-act-aa5772e93344
https://en.wikipedia.org/wiki/Drive_by_wire
Week 4 Task1: wait until command with “while not” loop

1. Create a New Text Project with the Grid map playground.


2. Rename it: week4.task1
3. Set robot speed to 30%.
4. Program the robot to begin driving forward.
5. Test your code and use cash camera to observe robot’s behavior.
6. Monitor bumper sensor value
7. Add wait until command with the left bumper pressed
condition.
8. Stop driving and the project when the left bumper pressed.
9. Test your code and use cash camera to observe robot’s behavior.
10. What dose the wait until command do with the project flow?
11. Submit your code to MS teams in a word (docx.) format.
When will the robot move?
Bumper Sensor
• The VR Robot has two Bumper Sensors
located on the front.
• A Bumper Sensor is a switch that reports if
it is pressed or released.

1. The Bumper Sensor will report a sensor value


of TRUE when the Bumper Sensor is pressed.
2. The Bumper Sensor will report a sensor value
of FALSE when the Bumper Sensor is
released.
Pseudocode

https://tipsmake.com/how-to-write-pseudocode
Pseudocode
Design small steps at a time with iterative
Building all at once can lead to failure process
Pseudocode vs Algorithm

https://www.pinterest.com/pin/781867185294014231/
Describe your pseudocode in a flowchart

https://code2flow.com/
Threshold of analog sensor values
Line Tracking Sensors (Brightness, light-dark, color sensors)
• The Line Tracking Sensors can detect the basic colors of objects and surfaces by aiming
directly at them at a close range.

• They do so by illuminating a surface with their infrared LED and then measuring how
much light is reflected.

• The amount of reflected Infrared light allows the robot to know if it is above a dark or
light surface.

• The Line Trackers provide analog


values at different levels of precision
(8bit, 10bit, 12bit, 16bit)
Calculate Threshold
• High analog values vs. low analog values can be used to distinguish light surfaces from
dark ones.

• Even though the Line Tracking Sensor provides a range of values, the robot can only
make Yes-No, True-False Boolean Comparisons.

• To make these values meaningful to the robot, we


need to calculate a threshold value to create a
“cutoff” point between light and dark.
• A Threshold value is used to separate the range
of many values into two categories: Light or Dark.
Week 4 Task2: Drive until red line

1. Create a New Text Project with the Line Detector playground.


2. Rename it: week4.task2
3. Navigate the VR Robot from the start from any zone (A-E) and
stop when detects the first red line using
down_eye.detect(RED)
4. Repeat step 3 using down_eye.brightness(PERCENT)
5. Draw the flowchart of the pseudocode.
6. Save the project once the VR Robot successfully drives to the
finish.
7. Submit your code to MS teams in a word (docx.) format
Week 4 Challenge
Week 4 Challenge 1: Calculate the average of lines brightness

1. Create a New Text Project with the Playground: Line Detector


2. Rename it: week4.challenge1
3. Use the code of week4.task1 to stop the robot when bumped
into the wall.
4. Navigate the VR Robot from the start from any zone (A-E).
5. Log the brightness of each line when the robot pass on it.
6. When the robot bumped into the wall, calculate the average of
lines brightness and print it into the output counsel.
7. Draw the flowchart of the pseudocode.
8. Submit your code to MS teams in a word (docx.) format.
Week 4 Challenge 2: Sensors for Robots
A robot needs the ability to sense important things about its environment, like the presence of obstacles or
navigation aids.

● Refer to the Sensors and Vision* pdf reference attached to the week 4 assignment.
● Summarize the sensor technology in the following categories:
1. Limit switches
2. Proximity switches
3. Tactile and impact sensing
4. Position sensing
5. Sound sensing
6. Vision system
• The maximum number of pages is 6.
• Submit your work to MS teams in a word (docx.) format.
_________________________________________________
* chapter 6 in Basic Robotics textbook written by Keith Dinwiddie

You might also like