Question? Leave a message!

Introduction to Robotics

Introduction to Robotics 27
Robotics Lecture 1: Introduction to Robotics See course website ajd/Robotics/ for up to date information. Andrew Davison Department of Computing Imperial College LondonLecture Plan Most weeks will consist of a 1 hour lecture (Monday 2pm, 308) and a compulsory 3 hour practical session (Monday 3–4pm, and Wednesday 9–11am, 219). There may some variations from week to week which will be fully detailed on the course website and announced in lectures. This week there will be a two hour lecture today, and a two hour practical on Wednesday. Next week, there will be a two hour lecture/tutorial on Monday and no practical on Wednesday (due to Commemoration Day). 1. Introduction to Robotics and Robot Motion 2. Mobile Robotics 3. Sensors 4. Probabilistic Robotics 5. Monte Carlo Localisation 6. Place Recognition and Occupancy Mapping 7. Simultaneous Localisation and Mapping 8. Review and CompetitionRobotics: An InterDisciplinary Field Robotics integrates science and engineering, and overlaps with many disciplines: • Artificial Intelligence • Computer Vision / Perception • Machine Learning / Estimation / Inference • Neuroscience • Electronic / Mechanical Engineering In fact the differentiation between these fields is sometimes artificial. I recently heard someone (Greg Dudek) wonder whether robotics is the new physics An umbrella science of the synthetic and interactive... • In this course the emphasis will be largely pragmatic.What is a Robot A physicallyembodied, artificially intelligent device with sensing and actuation. • It can sense. It can act. • It must think, or process information, to connect sensing and action. • Pixels to torques...What is a Robot • Is a washing machine a robot Most people wouldn’t say so, but it does have sensing, actuation and processing. • A possible distinction between appliance and robot (David Bisset): whether the workspace is physically inside or outside the device. • The cognitive ability required of a robot is much higher: the outside world is complex, and harder to understand and control. • What about a modern car Or smartphone Are they becoming robotsThe Classical Robot Industry: Robot Arms • The most widelyused robots today are industrial robot ‘arms’, mounted on fixed bases and used for instance in manufacturing. • The task of a robot arm is to position an endeffector through which it interacts with its environment. • Most operate in highly controlled environments.Robots for the Wider World • They need perception which gives them a suitable level of understanding of their complex and changing surroundings.A Fully Autonomous Robot for the Home There is a new wave of advanced mobile robots now aiming at much more flexible robots which can interact with the world in humanlike ways. Over recent years this has again become the current goal of significant research teams; e.g. Willow Garage in the USA. See the video at from Stanford’s Personal Robotics Program.Advanced ‘RealWorld’ Manipulation • Laundryfolding robot from UC Berkeley / Willow Garage • Learning from LargeScale Interaction / Google deeplearningforrobotslearningfrom.htmlOur Focus: Mobile Robots • A mobile robot needs actuation for locomotion and sensors for guidance. • Ideally untethered and selfcontained: power source, sensing, processing onboard (return to charging station offboard computing outsidein sensing) • Required competences include: • Obstacle avoidance • Localisation • Mapping • Path planning • As well as whatever specialised task the robot is actually trying to achieveMobile Robotics Applications Field Robotics • Exploration (planetary, undersea, polar). • Search and rescue (earthquake rescue; demining). • Mining and heavy transport; container handling. • Military (unmanned aircraft, landbased packbots, insect robots). Service Robotics • Domestic (Vacuum cleaning, lawnmowing, laundry, more general clearing and cleaning...). • Medical (surgical robots, remote doctor, hospital delivery, helping the elderly). • Transport (Autonomous cars, parcel delivery). • Entertainment (Sony AIBO, Lego Mindstorms, Robocup competition, Parrot AR Drone, many others).Autonomy and Processing for Mobile Robotics Level of autonomy: 1. Teleoperation (RemotelyOperated Vehicle ROV, e.g. Robot Wars, mine clearing). 2. Semiautonomous (e.g. Mars rovers, humanoids). 3. Fully autonomous (Roomba, Grand Challenge vehicles). Computing requirements: • Embedded processing: specialised or general PC architecture GPU, FPGA, etc. • Computer vision in particular can be very computationally expensive.Robotics: Requirements 1. Essential geometry (vectors, rotations, trigonometry). 2. Essential probability theory. 3. Programming: you will write a lot of code in Python. 4. Willingness to work with robot kit hardware, which is not always. reliable.Robotics: Learning Outcomes By the end of the course you should understand: 1. The defining properties of a robot: sensing and action, linked by processing. 2. An overview of the practical issues of modernday mobile robotics. 3. Robot locomotion methods, particularly wheel configurations and uncertainty in motion. 4. Tuning a basic motor controller; 2D path planning. 5. The use of simple sensors in reactive, behavioural programming. 6. The key concepts of advanced outward looking sensors such as sonar and vision. 7. The essentials of probabilistic techniques in robotics; probabilistic localisation and SLAM. 8. Techniques for robot programming in Python.Robotics: A Practical Course In the first practical, in groups you will be given a robotics kit which you will keep throughout term to work on practical exercises every week. We will use these kits to build mobile robots and implement techniques such as: • Wheeled configurations and uncertainty in movement. • Using simple sensors to implement reactive behaviours. • Investigating the characteristics of advanced sensors like sonar. • Implementing a probabilistic localisation filter and precise waypoint navigation. • Place recognition and free space mapping.Raspberry Pi Robotics As we started in 2014, this year we will base the practical work around the Raspberry Pi single board computer, using ‘BrickPi’ boards to interface with Lego motors and sensors (rather than using the Lego NXT Brick). This has many advantages; including: • Flexible programming in Python/Linux and all sorts of open source tools are available. • Decent processing power and much more flexibility in programming. • WiFi connection to a PC. • And new for 2015: better motor and sensor control via our new custom controller, and rechargeable battery packs.Robotics: Coursework and Assessment The coursework component is based on cumulative assessment of achievement in the practical sessions and there will be no submission of written reports. You will be set a practical task each week, most of which (and each practical sheet will very clearly say which) will be ASSESSED. • We will ask you all to organise yourself into practical groups of 4–5 members depending on final numbers; we need people to commit to the course at this point. • Each assessed practical exercise will have a number of welldefined objectives with a specified number of marks for each. Most of these objectives involve practical demonstration of your robots or oral explanation of results. • We will mark these exercises by visiting all groups at the start of the next week’s practical session, where each group must demonstrate their robot and discuss with me or a lab assistant. • We will check attendance in each group at the assessments and will ask questions to make sure each group member has been involved.Robotics: Coursework and Assessment • The total marks from the assessed practicals will form your overall coursework mark for Robotics. • No extra written coursework will be set. • All members of a group will receive the same mark by default (unless we have a strong reason to believe that certain members are not doing their share of work). • Coursework marks in Robotics are worth the same as in most courses — i.e. only around 15 of the total marks available for the whole course. is a lot of work. But this is for a good reason. The exam will be designed to tie in closely with the coursework, and those members of groups that have made a good effort during the term have historically done very well on the exam. • Previous years’ exam papers are a good starting point for seeing what the style of questions will be, but every year the exam will change to reflect the current lecture and practical content of the course.Robotics: Competition On the final day of the course (30th November), we will have a competition between the groups, testing the performance of the robots developed for the final practical exercise. See the course website for pictures and videos from previous years’ competitions ...but this year’s challenge will be different again See videos at ajd/Robotics/index.html. Extra Information • Robotics course web page (will carry course timetable, notes, practical sheets, extra handouts and other information): ajd/Robotics/index.html • You should not need to buy any books, but if you want some more background we can recommend the following: • ‘Probabilistic Robotics’, Sebastian Thrun, Wolfram Burgard and Dieter Fox • Also see relevant free online courses, e.g. from Udacity.Robot Motion • A mobile robot can move and sense, and must process information to link these two. In this lecture we concentrate on robot movement, or locomotion. What are the possible goals of a robot locomotion system • Speed and/or acceleration of movement. • Precision of positioning (repeatability). • Flexibility and robustness in different conditions. • Efficiency (low power consumption)Locomotion • Robots might want to move in water, in the air, on land, in space... AUV Micro UAV ZeroG Assistant Spider Humanoid • In this course we will concentrate on wheeled robots which move on fairly flat surfaces.Motion and Coordinate Frames W y R x yR R Coordinate Frame R z (up) Carried With Robot W θ Robot Frame R R y (left) W z R x (forward) W y W x W Fixed World Coordinate x Frame W World Frame W 2D 3D • We define two coordinate frames: a world frame W anchored in the world, and a robot frame R which is carried by and stays fixed relative to the robot at all times. • Often we are interested in knowing the robot’s location: i.e. what is the transformation between frames W and RDegrees of Motion Freedom • A rigid body which translates and rotates along a 1D path has 1 degree of freedom (DOF): translational. Example: a train. • A rigid body which translates and rotates on a 2D plane has 3 DOF: 2 translational, 1 rotational. Example: a ground robot. • A rigid body which translates and rotates in a 3D volume has 6 DOF: 3 translational, 3 rotational. Example: a flying robot. • A holonomic robot is one which is able to move instantaneously in any direction in the space of its degrees of freedom.A Holonomic Ground Robot • Holonomic robots do exist, but need many motors or unusual designs and are often impractical. • Groundbased holonomic robots can be made using omnidirectional wheels; e.g. Wheeled Robots Segway RMP Mars Rover • Segway platform with dynamic balance gives good height with small footprint and high acceleration. Selfbalancing Lego Robots built by DoC students in 2008: • Mars Rover has wheels on stalks to tackle large obstacles.Standard Wheel Configurations Rack and Pinion Differential Drive SkidSteer Synchro Drive • Simple, reliable, robust mechanisms suitable for robots which essentially move in a plane. • All of these robots are nonholonomic (each uses two motors, but has three degrees of movement freedom). For instance, a carlike robot can’t instantaneously move sideways.Differential Drive • Two motors, one per wheel: steering achieved by setting different speeds. • Wheels run at equal speeds for straightline motion. • Wheels run at equal and opposite speeds to turn on the spot. • Other combinations of speeds lead to motion in a circular arc.Circular Path of a Differential Drive Robot Δθ W R We define the wheel velocities of the left and right wheels respectively to be v and v (linear velocities of the wheels over the ground: e.g. L R v = r ω , where r is the radius of the wheel and ω is its angular L L L L L velocity). The width between the wheels of the differential drive robot is W. • Straight line motion if v = v L R • Turns on the spot if v =−v L R • More general case: moves in a circular arc.Circular Path of a Differential Drive Robot To find radius R of curved path: consider a period of motion Δt where the robot moves along a circular arc through angle Δθ. W • Left wheel: distance moved = v Δt; radius of arc = R− . L 2 W • Right wheel: distance moved = v Δt; radius of arc = R + . R 2 • Both wheel arcs subtend the same angle Δθ so: v Δt v Δt L R Δθ = = W W R− R + 2 2 W ⇒ (v +v ) = R(v −v ) L R R L 2 W(v +v ) (v −v )Δt R L R L ⇒ R = Δθ = 2(v −v ) W R LCar/Tricycle/Rack and Pinion Drive Car Tricycle • Two motors: one to drive, one to steer. • Cannot normally turn on the spot. • With a fixed speed and steering angle, it will follow a circular path. • With four wheels, need rear differential and variable (‘Ackerman’) linkage for steering wheels.Circular Path of a CarLike Tricycle Robot Robot Centre Δθ s L s R d R Assuming no sideways wheel slip, we intersect the axes of the front and back wheels to form a rightangle triangle, and obtain: L R = . tans The radius of the path that the rear driving wheel moves in is: L R = . d sinsCircular Path of a CarLike Tricycle Robot Robot Centre Δθ s L s R d R In time Δt the distance along its circular arc moved by the drive wheel is vΔt, so the angle Δθ through which the robot rotates is: vΔt vΔtsins Δθ = = . R L d L vΔtsins R = Δθ = tans LActuation of Driving Wheels: DC Motors • Most common motors, available in all sizes and types. • Simple control with voltage or Pulse Width Modulation (PWM). • For precision, encoders and feedback can be used for servo control (the NXT motors have builtin encoders).Gearing • DC motors tend to offer high speed and low torque, so gearing is nearly always required to drive a robot If Gear 1 is driven with torque t , it exerts tangential force: 1 t 1 F = r 1 on Gear 2. The torque in Gear 2 is therefore: r 2 t = r F = t . 2 2 1 r 1Gearing The change in angular velocity between Gear 1 and Gear 2 is calculated by considering velocity at the point where they meet: v = ω r = ω r 1 1 2 2 r 1 ⇒ ω = ω 2 1 r 2 • When a small gear drives a bigger gear, the second gear has higher torque and lower angular velocity in proportion to the ratio of teeth. • Gears can be chained together to achieve compound effects.Motor Control — Open Loop u y x P • Let P be a SingleInputSingleOutput (SISO) dynamic system (e.g. Lego Mindstorms geared DC motor). It is described by: • an input u, here: voltage V or corresponding PWM value, • internal states x, whose dynamics follow differential equations, ⊤ ⊤ here: x = x ,x = ω,ϕ , with rotation speed ω and angle ϕ, 1 2 • an output y as a function of x, here: angle ϕ, i.e. y = x . 2 • Qualitative openloop response on input (voltage) step: u=V y= tMotor Control — Closed Loop • How about we want to accurately reach and keep a reference angle → Closedloop control • Let C be a controller, possibly with internal states: r e u y x C P • r is a reference (desired) output, and • e is the error between reference and actual output.Motor Control — PID • PID (ProportionalIntegralDifferential): a simple controller: Z t de(t) C : u(t) = k e(t)+k e(τ)dτ +k , p i d dt t 0 • with k : proportional gain, reduces the error, p • k : integral gain, removes steadystate error, i • and k : differential gain, can reduce settling time. d • Qualitative closedloop system response to reference step (welltuned controller): r,u t • Simple (heuristic) tuning rule: ZieglerNichols: • set k and k to zero. Increase k until the system starts oscillating i d p with period P (in seconds) — remember this gain as k ; u u • set k = 0.6k , k = 2k /P , and k = k P /8. p u i p u d p uMotor Control — Additional Tweaks • Reference filtering: respect physical limits already in the reference: r,r f max. acceleration t • AntiResetWindup: stops integrating the error for the Ipart, when u is at its physical limit. • Deadband compensation: add offset to u to compensate friction. dr(t) • Feedforward controller C : u (t) = k , f f f dt reduces “work” for the feedback controller: u f C f r e u + y x C P const. speedMapping Wheel Rotation Speed to Velocity • What is the robot speed, when the wheels turn ω v=r ω w • In principle, we could measure the radius of each wheel r to turn w angular velocity into linear motion. However, in practice (due to hard to model factors, such as surface slip and tyre softness) it is much better to calibrate such things empirically. i.e., via experiments (guided trial and error), work out the scaling between the motor reference angle and distance travelled over the ground.Motion and State on a 2D Plane • If we assume that a robot is confined to moving on a plane, its location can be defined with a state vector x consisting of three parameters:   x   x = y θ • x and y specify the location of the predefined ‘robot centre’ point in the world frame. • θ specifies the rotation angle between the two coordinate frames W R (the angle between the x and x axes). • The two coordinate frame coincide when the robot is at the origin, and x = y = θ = 0.Integrating Motion in 2D • 2D motion on a plane: three degrees of positional freedom, represented by (x,y,θ) with−π θ = π. • Consider a robot which only drives ahead or turns on the spot: W y R x R y R Coordinate Frame Carried With Robot W θ W x Fixed World Coordinate Frame W • During a straightline period of motion of distance D:     x x +Dcosθ new     y = y +Dsinθ new θ θ new • During a pure rotation of angle angle α:     x x new     y = y new θ θ+α newIntegrating Circular Motion Estimates in 2D θnew Δθ y new R θ y x xnew In the cases of both differential drive and the tricycle robot, we were able to obtain expressions for R and Δθ for periods of constant circular motion. Given these:     x x +R(sin(Δθ+θ)−sinθ) new     y = y−R(cos(Δθ+θ)−cosθ) new θ θ+Δθ newPositionBased Path Planning θ y x Assuming that a robot has localisation, and knows where it is relative to a fixed coordinate frame, then positionbased path planning enables it to move in a precise way along a sequence of predefined waypoints. Paths of various curved shapes could be planned, aiming to optimise criteria such as overall time or power usage. Here we will consider the specific, simple case where we assume that: • Our robot’s movements are composed by straightline segments separated by turns on the spot. • The robot aims to minimise total distance travelled, so it always turns immediately to face the next waypoint and drives straight towards it.PositionBased Path Planning In one step of path planning, assume that the robot’s current pose is (x,y,θ) and the next waypoint to travel to is at (W ,W ). x y • It must first rotate to point towards the waypoint. The vector direction it must point in is:     d W −x x x = d W −y y y The absolute angular orientation α the robot must drive in is therefore given by: d y −1 α = tan d x Care must be taken to make sure that α is in the correct quadrant of −1 −π α≤ π. A standard tan function will return a value in the range −π/2 α = π/2. This can be also achieved directly with an atan2(dy, dx) function (available in Python’s math module).PositionBased Path Planning • The angle the robot must rotate through is therefore β = α−θ. If the robot is to move as efficiently as possible, care should be taken to shift this angle by adding or subtracting 2π so make sure that −π β≤ π. • The robot should then drive forward in a straight line through q 2 2 distance d = d +d . x yLego Mindstorms NXT and BrickPi • Please READ THE WHOLE PRACTICAL SHEET CAREFULLY. • Lab location: teaching lab 219, one floor down. • Organise yourselves into groups and come to us to fill in a form and get a kit.Week 2 Practical: Locomotion, Calibration and Accurate Motion W y 40cm Fixed World Coordinate Frame W W x 40cm • Today’s practical is on accurate robot motion. How well is it really possible to estimate robot motion from wheel odometry • Everyone should read the practical sheet fully • This is an ASSESSED practical: we will assess your achievement next week at the start of next week’s practical. Your whole group should be there to demonstrate and discuss your robot.
Website URL