Computational
Robotics
Lecture 2
Prof. Howida Shedeed
Dr. Dalia Shouman
Reference book
• Collective sensory response threshold in ant
colonies:
• [Link]
• Braitenberg Vehicles by Valentino Braitenberg
• [Link]
[Link]
• Robotics, Vision and control by Peter Corke
• [Link]
8-3-031-06469-2
Robot primitives in terms of inputs and outputs
• Using the relationship between the three commonly accepted
primitives ROBOT PARADIGM of robotics: SENSE, PLAN, ACT
function is taking in information
from the robot’s sensors and
producing sensing information
Robot primitives in terms of inputs and outputs
• Using the relationship between the three commonly accepted
primitives ROBOT PARADIGM of robotics: SENSE, PLAN, ACT
If the function:
• Taking in information
(either from sensors or its
own knowledge about
how the world works)
• and producing one or more
tasks for the robot to
perform.
• Example:
• go down the hall
• turn left
• proceed 3 meters
• stop
Robot primitives in terms of inputs and outputs
• Using the relationship between the three commonly accepted
primitives ROBOT PARADIGM of robotics: SENSE, PLAN, ACT
Functions which produce
output commands
to motor actuators fall into
ACT
Example:
• turn 90
• clockwise
• with a turning velocity of
0.2mps).
Hierarchical
• Example: Indoor Delivery Robot in a hospital
• the robot operates in a top-down fashion, heavy on planning.
• This was based on an introspective view of how people think. “I see a door,
I decide to head toward it, and I plot a course around the chairs.”
• The robot senses the world, plans the next action, and then acts (SENSE,
PLAN, ACT).
• All the sensing data tends to
be gathered into one global
world model, a single representation
that the planner can use and can
be routed to the actions.
Hierarchical
• The robot operates in a top-down fashion, heavy on planning.
Reactive
• Example: Obstacle Avoidance Robot ( Simple Vacuum robot
• It is a SENSE-ACT (S-A) type of organization
Reactive
• The robot has multiple instances of SENSE-ACT couplings.
• These couplings are concurrent processes, called behaviors, which take
local sensing data and compute the best action to take independently of
what the other processes are doing. One behavior can direct the robot to
“move forward 5 meters” (ACT on drive motors) to reach a goal (SENSE
the goal), while another behavior can say “turn 90” (ACT on steer motors)
to avoid a collision with an object dead ahead (SENSE obstacles).
• The robot will do a combination of both behaviors, swerving off course
temporarily at a 45 angle to avoid the collision.
• The final ACT emerged from the combination of the two behaviors.
Reactive
• The robot has multiple instances of SENSE-ACT couplings.
• Vertical decomposition of tasks into an S-A organization.
• Behavior-specific sensing organization in the Reactive Paradigm:
sensing is local, sensors can be shared, and sensors can be fused
locally by a behavior
Hybrid deliberative/reactive
• Example: Self Driving car
• The robot first plans (deliberates) how to best decompose a task into
subtasks (also called “mission planning”) and then what are the
suitable behaviors to accomplish each subtask, etc.
• Then the behaviors start executing as per the Reactive Paradigm. This
type of organization is PLAN, SENSE-ACT (P, S-A),
• where the comma indicates that planning is done at one step, then
sensing and acting are done together.
Hybrid deliberative/reactive
• PLAN, SENSE-ACT (P, S-A)
• where the comma indicates that planning is done at one step, then
sensing and acting are done together.
• Sensing organization in the Hybrid Paradigm is also a mixture of
Hierarchical and Reactive styles. Sensor data gets routed to each
behavior that needs that sensor, but is also available to the planner
for construction of a task-oriented global world model.
Hybrid deliberative/reactive
• PLAN, SENSE-ACT (P, S-A)
• Each function performs computations at its own rate; deliberative
planning, which is generally computationally expensive may update
every 5 seconds, while the reactive behaviors often execute at 1/60
second
Hybrid deliberative/reactive
• PLAN, SENSE-ACT (P, S-A)
• Hybrid Paradigm, showing that the global world model can have its
own sensors, can “eavesdrop” on sensors or percepts used/created by
behaviors, and can act as a virtual sensor for use by a behavior.
The PLAN box includes:
• all deliberation and
global world modeling
• not just task or path
planning
Reactive System
Real Life example: (Stimulus- Response)
• Stimulus:
• Garbage smell is bad
• Response:
• Cover the nose
Collective sensory response threshold in ant
colonies
• Colonies collectively evacuate the nest when the ground temperature
becomes too warm.
• The threshold temperature for this response is a function of colony
size, with larger colonies evacuating the nest at higher temperatures
• Ants decision-making process:
• Takes both temperature (external environment)
and colony size (internal state) into account.
Colonies evacuating the nest at higher temperatures.
• Ref: [Link]
Braitenberg Vehicles: Simple Agents
Exhibiting Complex Behaviors
• Definition:
• Simple autonomous agents that move based on sensor input.
• The speed of the motor is controlled by a sensor whose signal depends on
distance to nearby source
• The motor represented by (rectangular box at the tail end) is
controlled by a sensor (half circle on a stalk, at the front end).
• Motion is always forward, in the direction of the arrow.
• The more stimulus -> the faster to go (excitatory connection)
Braitenberg (2-wheel) vehicle with excitatory
connections:
• The front of the vehicle are two sensors and in the back two motors
• Excitatory connections(+) means motor speed increases proportionally
to the sensor measurement
• 2a turns away from the source (fear)
• 2b orients toward the source (aggression)
Inhibitory influence of the sensors on the
motors:
• Inhibitory connections(-) means motor speed decrease proportionally
to the sensor measurement
• Vehicle 3a will orient towards it
and come to rest facing it (Love)
• Vehicle 3b on the other hand will come
to rest facing away from the source (exploration).
Braitenberg Simulator:
• Braitenberg vehicles | Harmen de Weerd
Representing Position
and Orientation
Adapted from Andrew Vardy Slides
Primary source material:
“Robotics, Vision & Control” by Peter Corke, 2017
Pose:
• Pose is the combination of a robot’s position and orientation
• we’re interested in representing the pose of a robot, as well as the
poses of its components (e.g. sensors, motors)
• We also need to understand how different poses relate to each other
• This will require the ability to transform between different coordinate
frames. Why?
Pose:
• Pose is the combination of a robot’s position and orientation
• we’re interested in representing the pose of a robot, as well as the
poses of its components (e.g. sensors, motors)
• We also need to understand how different poses relate to each other
• This will require the ability to transform between different coordinate
frames. Why?
• Because some robots have many!
Points and Vectors
• We start with a point in space
• To describe a point’s location, we use a coordinate vector which
specifies the displacement of the point w.r.t. (with respect to) some
coordinate frame
• Vectors and points are different:
• You can add vectors, but not points
• The difference between 2 points is a vector
Points vs. Vectors in a Coordinate System
• Consider two points in a 2D space:
• 𝑃1=(2,3),𝑃2=(5,7)
• These are points because they specify locations in the coordinate plane.
• The vector from 𝑃1 to 𝑃2 is found by subtracting the coordinates:
• 𝑣=𝑃2−𝑃1=(5−2,7−3)=(3,4)
• This vector represents a displacement (direction and magnitude) rather than a fixed location.
• Example 2: Adding Vectors vs. Points:
• Suppose we have two vectors: 𝑣1 = (1,2) 𝑣2= (3,−1)
• We can add them like this: 𝑣1+𝑣2 = (1+3, 2+(−1)) = (4,1)
• Vector addition makes sense because vectors represent movement or displacement.
• However, adding two points is not meaningful: 𝑃1+𝑃2=(2,3)+(5,7)=(7,10)
(Not a valid operation)
• Points do not add up in the same way because they are absolute positions, not directions.
Rigid motion of a shape
• The object’s initial pose, shown in blue, has been transformed into the
pose shown in red.
• The object’s shape has not changed, so we call this a rigid-body
transformation.
• Its position has changed (it has translated) and its orientation has
changed (it has rotated).
• The motion is always defined with respect to an initial pose.
• The leading superscript indicates the initial pose and the trailing
subscript indicates the resulting pose.
• Therefore x ξ y means the motion from pose x to y.
• Motions can be joined up to create arbitrary motions – a process called
composition or compounding. We can write this algebraically
• the motion 0ξ2 is the same as the motion 0ξ1 followed by the motion 1ξ2
• We use the special symbol to remind ourselves
that we are adding motions not regular numbers.
Note
• It is important to note that the order of the motions is important.
• For example:
• if we walk forward 1m and then turn clockwise by 90, we have a different
pose than
• if we turned 90 clockwise and then walked forward 1 m.
• Composition of motions is not commutative.
• For any motion there is an inverse or opposite motion – the motion
that gets us back to where we started.
• A motion from pose X to pose Y the inverse motion is from pose Y to pose X
Note
• For any motion there is an inverse or opposite motion – the motion
that gets us back to where we started.
• A motion from pose X to pose Y the inverse motion is from pose Y to
pose X, that is
• Where Ø is the null motion and means no motion
• Another operator Ө that turns any motion into its inverse
Coordinate Frames
• Here is a robot with its own coordinate frame {B}
• The frame associated with a moving body, such as a vehicle, is often called the
body frame.
• The axes of {B} are xB and yB
• The pose of {B} with respect to the global frame is ξB
• If there is no leading superscript,
then the pose is w.r.t. the world frame {O}
• This pose describes {B} w.r.t. the world frame {O}
Relationships Between Frames
• The same point P can be described w.r.t. frame {A} or {B}
• The pose of frame {B} w.r.t. {A} is
• The point P can be described by coordinate vectors expressed in frame
{A} or {B}.
• The pose of {B}relative to {A} is AξB
Relationships Between Frames
• The two vectors describing point P are related as follows:
• The dot is a special operator indicating transformation of vector Bp
Composition of Poses
• Poses can be composed together
• To get the pose of {C} w.r.t. {A} we can compose as follows:
• The symbol in the middle is
another special operator indicating
composition of poses
Composition of Poses
Hint
• Given : cp , AξB , BξC
• Wanted : Ap
Composition of Poses
Hint
• Given : cp , AξB , BξC
• Wanted : Ap
• We can obtain the vector
describing P w.r.t. {A} as follows:
Notation Tip
• In pose composition the subscript immediately to the left of the
operator must match the superscript immediately to the right and they
“cancel out”
• Similarly, the transform operator should see the same match between
subscript on left and superscript on right---and they “cancel out”
Example
• Real robots are 3D and may have a number of
interrelated frames
• Here the robot’s camera observes some object
• An overhead camera (fixed to the ceiling)
may be observing both robot and object
• The thin arrows indicate known poses
Example (cont.) pose graph
• We can view this set of related poses as a pose graph.
• A pose graph is a directed graph where the nodes are poses and the
edges represent transforms between them.
Example (cont.) pose graph
• Lets say that ξB is unknown. How could we obtain it by composition of
other known transforms?
Example (cont.) pose graph
• Lets say that ξB is unknown. How could we obtain it by composition of
other known transforms?
Example (cont.) pose graph
• Lets say that ξB is unknown. How could we obtain it by composition of
other known transforms?
Inversion
• We can also invert poses, meaning
that we can change the roles of the
two coordinate frames. The following
symbol denotes taking the inverse:
• Graphically, the thin arrows indicate
transforms from a reference frame
(base of arrow) to a target frame. To
indicate inversion, the arrow should
be reversed.
• So the purple arrow corresponds to
Example: Determine
• Following the purple path, we can obtain this pose
• But the last two poses are not given and have to be obtained by
inverting known poses
• The following is another valid answer following the orange path,
Remember:
Lecture Quiz: