intelligent robotics - montefiore...

23
Intelligent Robotics Project and simulator Thibaut Cuvelier 16 February 2017

Upload: others

Post on 21-Mar-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Intelligent RoboticsProject and simulatorThibaut Cuvelier

16 February 2017

Page 2: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Today’s plan▪ Project details

▪ Introduction to the simulator

▪ MATLAB for the simulator

▪ http://www.montefiore.ulg.ac.be/~tcuvelier/ir

Intelligent robotics – project and simulator 2

Page 3: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

About the project

Page 4: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

youBot

Intelligent robotics – project and simulator 4

Page 5: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Your goal: deal with the groceries

Intelligent robotics – project and simulator 5

Page 6: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Milestones▪ The project is divided in a series of milestones▪ No need to do all of them! ▪ Make choices based on what you prefer

▪ Broadly: ▪ (A) Navigation▪ (B) Object manipulation▪ (C) Vision▪ (D) Manipulation with vision▪ (E) Calibration

Intelligent robotics – project and simulator 6

Page 7: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

First deadline: March 23▪ Milestone A1: your robot moves and builds a map▪ You should prepare a small demo of your exploration▪ Roughly five minutes per group

▪ What we expect▪ “Basic” exploration: no need for something complicated▪ No time constraint: no need to complete exploration in 5

minutes▪ You can do more if you wish

▪ Schedule conflicts? ▪ Contact us

Intelligent robotics – project and simulator 7

Page 8: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Final deadline: end of May, beginning of June▪ Presentation of your whole project▪ A small report will be required▪ Oral presentation of your project

▪ Think about videos if your code decides not to work

▪ You may be asked to test your robot on another map

▪ More details later

Intelligent robotics – project and simulator 8

Page 9: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Introduction to the simulator

Page 10: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Basic overview

Intelligent robotics – project and simulator 10

Page 11: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Common manipulations▪ Move an object:

▪ Rotate an object:

▪ Scaling an object:

▪ Caution: any modification while the simulator is running is lost at the end of the simulation!

Intelligent robotics – project and simulator 11

Page 12: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

MATLAB for the simulator

Page 13: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Many functions available in the simulator

▪ You will be writing MATLAB code to interact with the robot▪ Set the speed of the wheels▪ Take a picture▪ Move the gripper▪ Get the position of the robot or one of its components

▪ See examples: ▪ Complete example

https://github.com/dourouc05/trs/blob/master/youbot/youbot.m▪ More focused and much shorter examples:

https://github.com/dourouc05/trs/tree/master/youbot/focused

Intelligent robotics – project and simulator 13

Page 14: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Many functions available, but not infinitely many▪ Not all functions can be called:

http://ulgrobotics.github.io/trs/project.html#api▪ For example: forbidden to move an object into the gripper▪ But you can use forbidden functions for your tests, of course

▪ A few functions are not allowed for given milestonesSometimes, not all arguments are allowed▪ For example, B4: you cannot use VREP IK to move the arm▪ Very natural restrictions

Intelligent robotics – project and simulator 14

Page 15: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Many functions availableoutside the simulator▪ When running the installer, Peter Corke’s robotics

and vision toolbox is automatically installed▪ Many useful functions for the project▪ Reference frame transformations, navigation, trajectories…

▪ Pay attention: not always working as you would expect!

▪ If you have it: MATLAB Robotics Toolbox

Intelligent robotics – project and simulator 15

Page 16: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Programming tips▪ Use an infinite loop▪ Simulation goes on continuously for each iteration in this loop▪ Take actions at each iteration:▪ Set the speeds for the wheels▪ Plan your path through the room▪ Take a picture▪ Analyse a picture▪ …

while true% …

end

Intelligent robotics – project and simulator 16

Page 17: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Programming tips▪ Use a state machine, such as:

State 1: Explore the mapState 2: Go to the tablesState 3: Pick an objectState 4: Move to the corresponding basketState 5: Drop the objectBack to state 2 until all objects are dealt with

▪ You can of course decompose further, embed state machines within some states, etc.

Intelligent robotics – project and simulator 17

Page 18: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Debugging tips▪ When you work on an image or a point cloud▪ First run a simulation and save the image/cloud to a file▪ Then develop your algorithm▪ Finally try the integrated code

▪ Don’t tune a parameter, run the simulator, tune, run, etc.(Great loss of time!)

▪ The samples show how to store an image and a point cloud▪ You can also use MATLAB’s save and load functions

Intelligent robotics – project and simulator 18

Page 19: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

How does the simulator work? ▪ The simulator uses a physics engine▪ Must be allowed to run often enough for realistic simulations

▪ Two impacts: ▪ The simulator physics engine has an iteration every 50 ms▪ Risk of overshooting

Don’t approach waypoints at a too high speedDon’t rotate too fast

Intelligent robotics – project and simulator 19

Page 20: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

How does the simulator work? ▪ The simulator uses a physics engine▪ Must be allowed to run often enough for realistic simulations

▪ Two impacts: ▪ Your code should run within 50 ms▪ Otherwise: physics desynchronised from your measurements

Use already optimised functions! (Or optimise your code)

You can also precompute a few thingsIf not enough: multiplication factor, non-real-time mode

Intelligent robotics – project and simulator 20

Page 21: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

How does the simulator work? ▪ The simulator uses a physics engine▪ Must be allowed to run often enough for realistic simulations

▪ Two impacts:▪ Sometimes, strange robot behaviour▪ Gripper closed, object falling▪ Robot wheels straight, but robot following a bended curve▪ Mostly due to numerical errors in the simulation

Dynamic steering!

Intelligent robotics – project and simulator 21

Page 22: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Questions?

Page 23: Intelligent Robotics - Montefiore Institutemontefiore.ulg.ac.be/~nvecoven/ir/files/02_Project_and_simulator.pdfyouBot. Intelligent robotics – project and simulator 4. Your goal:

Installation ▪ Supposing MATLAB is installed

▪ Install V-REP PRO EDU: http://www.coppeliarobotics.com/downloads.html

▪ Install V-REP bindings for MATLAB: step 3 of http://ulgrobotics.github.io/trs/setup.html#install

▪ Clone or download the course’s Git repository: https://github.com/dourouc05/trs

▪ Run the script startup_robot.m▪ Installs Peter Corke’s toolbox▪ Sets MATLAB’s path▪ Must be run each time you restart MATLAB!

Intelligent robotics – project and simulator 23