Introduction to humanoid robot iCub, YARP and simulator

20
Martin Peniak & Anthony Morse 11/06/2010, Plymouth

description

This is a very basic introduction to humanoid robotic platform iCub, YARP (Yet Another Robotic Platform) - software that is used to facilitate communication with the robot and also iCub simulator that is a tool that we use first to develop our system before we deploy it on the real physical robot.

Transcript of Introduction to humanoid robot iCub, YARP and simulator

Page 1: Introduction to humanoid robot iCub, YARP and simulator

Martin Peniak & Anthony Morse 11/06/2010, Plymouth

Page 2: Introduction to humanoid robot iCub, YARP and simulator

OverviewOverview

• iCubiCub– IntroductionIntroduction– Hardware, software and communicationHardware, software and communication

• YARPYARP– IntroductionIntroduction– Basic use and programming applicationsBasic use and programming applications

• iCub simulatoriCub simulator– IntroductionIntroduction– Basic use Basic use

• iCubiCub– IntroductionIntroduction– Hardware, software and communicationHardware, software and communication

• YARPYARP– IntroductionIntroduction– Basic use and programming applicationsBasic use and programming applications

• iCub simulatoriCub simulator– IntroductionIntroduction– Basic use Basic use

Page 3: Introduction to humanoid robot iCub, YARP and simulator

iCub - IntroductionIntroductioniCub - IntroductionIntroduction• Designed by RobotCub ConsortiumDesigned by RobotCub Consortium

– with the goal of studying cognition through the with the goal of studying cognition through the implementation of bio-inspired algorithmsimplementation of bio-inspired algorithms

• There are about twenty iCubs in various There are about twenty iCubs in various laboratories across Europe and USlaboratories across Europe and US

• Open-source - GPL licenseOpen-source - GPL license• The dimensions of the iCub are similar to The dimensions of the iCub are similar to

that of a 3.5 year old childthat of a 3.5 year old child– 53 actuated degrees of freedom53 actuated degrees of freedom

• 7 in each arm7 in each arm• 9 in each hand9 in each hand• 6 in the head6 in the head• 3 in the torso/waist3 in the torso/waist• 6 in each leg6 in each leg

• Designed by RobotCub ConsortiumDesigned by RobotCub Consortium– with the goal of studying cognition through the with the goal of studying cognition through the

implementation of bio-inspired algorithmsimplementation of bio-inspired algorithms• There are about twenty iCubs in various There are about twenty iCubs in various

laboratories across Europe and USlaboratories across Europe and US• Open-source - GPL licenseOpen-source - GPL license• The dimensions of the iCub are similar to The dimensions of the iCub are similar to

that of a 3.5 year old childthat of a 3.5 year old child– 53 actuated degrees of freedom53 actuated degrees of freedom

• 7 in each arm7 in each arm• 9 in each hand9 in each hand• 6 in the head6 in the head• 3 in the torso/waist3 in the torso/waist• 6 in each leg6 in each leg

Page 4: Introduction to humanoid robot iCub, YARP and simulator

iCub - HardwareiCub - Hardware

• Brushless motors, DC motors and wires• Sensors– Cameras and microphones– Force-torque sensors– Absolute encoders and hall-effect sensors– Gyroscope

• PC104• Facial expression

• Brushless motors, DC motors and wires• Sensors– Cameras and microphones– Force-torque sensors– Absolute encoders and hall-effect sensors– Gyroscope

• PC104• Facial expression

Page 5: Introduction to humanoid robot iCub, YARP and simulator

• Modules– attentionSelection, audioAnalyser,

biologicalControlGazeEngine, camCalib, faceEyeDetector, Imitation Modules …

• Graphical User Interfaces– biControlGazeInterface, canLoader, robotMotorGui,

selectiveAttentionInterface …• Libraries– iDyn, iKin, iCubInterface, iCubDev …

• Tools– blobTracker, cableLengthGuard, canBusSniffer …

• Modules– attentionSelection, audioAnalyser,

biologicalControlGazeEngine, camCalib, faceEyeDetector, Imitation Modules …

• Graphical User Interfaces– biControlGazeInterface, canLoader, robotMotorGui,

selectiveAttentionInterface …• Libraries– iDyn, iKin, iCubInterface, iCubDev …

• Tools– blobTracker, cableLengthGuard, canBusSniffer …

iCub - SoftwareiCub - Software

Page 6: Introduction to humanoid robot iCub, YARP and simulator

iCub - SoftwareiCub - Software

• iCubInterface– Interface to the robot– Instantiates devices controlling the robot• CAN bus devices for all CAN networks (head-torso, legs,

rightarm and leftarm) and the inertial sensor device

– Instantiates network wrappers• Creates YARP ports that allow remote control of the

robot and access to sensory reading

• iCubInterface– Interface to the robot– Instantiates devices controlling the robot• CAN bus devices for all CAN networks (head-torso, legs,

rightarm and leftarm) and the inertial sensor device

– Instantiates network wrappers• Creates YARP ports that allow remote control of the

robot and access to sensory reading

Page 7: Introduction to humanoid robot iCub, YARP and simulator

iCub - CommunicationiCub - Communication

iCub – PC104iCub – PC104 YARP serverYARP server Computer - IIComputer - II

Computer - IComputer - I

Computer - IIIComputer - III

Page 8: Introduction to humanoid robot iCub, YARP and simulator

YARP - IntroductionYARP - Introduction• Yet Another Robot Platform

– supports building a robot control system as a collection of programs communicating via tcp, udp, multicast, local, MPI, …

• YARP can be broken down into:– libYARP_OS - interfacing with the operating system(s) to support

easy streaming of data across many threads across many machines

– libYARP_sig - performing common signal processing tasks (visual, auditory) in an open manner easily interfaced with other commonly used libraries, for example OpenCV.

– libYARP_dev - interfacing with common devices used in robotics: framegrabbers, digital cameras, motor control boards, etc.

• Yet Another Robot Platform– supports building a robot control system as a collection of

programs communicating via tcp, udp, multicast, local, MPI, …• YARP can be broken down into:

– libYARP_OS - interfacing with the operating system(s) to support easy streaming of data across many threads across many machines

– libYARP_sig - performing common signal processing tasks (visual, auditory) in an open manner easily interfaced with other commonly used libraries, for example OpenCV.

– libYARP_dev - interfacing with common devices used in robotics: framegrabbers, digital cameras, motor control boards, etc.

Page 9: Introduction to humanoid robot iCub, YARP and simulator

YARP – multiple OSs & PCsYARP – multiple OSs & PCs• Computation of visual, auditory, and tactile perception while performing elaborate

motor control in real-time requires a lot of computation• YARP can run across any number of machines with different operating systems• Supports CUDA via IGPUInterface in ibYARP_dev

• Computation of visual, auditory, and tactile perception while performing elaborate motor control in real-time requires a lot of computation• YARP can run across any number of machines with different operating systems• Supports CUDA via IGPUInterface in ibYARP_dev

Page 10: Introduction to humanoid robot iCub, YARP and simulator

YARP – Terminal useYARP – Terminal use• yarp • yarp help• yarp check• yarp clean• yarp cmake• yarp conf• yarp detect• yarp disconnect• yarp exists• yarp forward• yarp help• yarp name• yarp name check• yarp name list• yarp name unregister

• yarp • yarp help• yarp check• yarp clean• yarp cmake• yarp conf• yarp detect• yarp disconnect• yarp exists• yarp forward• yarp help• yarp name• yarp name check• yarp name list• yarp name unregister

• yarp namespace• yarp ping• yarp read• yarp regression• yarp resource• yarp rpc• yarp rpcserver• yarp run• yarp server• yarp terminate• yarp topic• yarp version• yarp wait• yarp where• yarp write

• yarp namespace• yarp ping• yarp read• yarp regression• yarp resource• yarp rpc• yarp rpcserver• yarp run• yarp server• yarp terminate• yarp topic• yarp version• yarp wait• yarp where• yarp write

Page 11: Introduction to humanoid robot iCub, YARP and simulator

YARP – Terminal use

• [terminal A] yarp server• [terminal B] yarp • [terminal B] yarp read /read• [terminal C] yarp write /write verbatim /read• [terminal D] yarp disconnect /write /• [terminal D] yarp connect /write /

Page 12: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator - Introduction

Page 13: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator - Introduction• Developed primarily by Vadim Tikhanoff• Open-source mutiplatform computer simulation based

on ODE and OpenGL– Reduces the time of experiments such as in evolutionary

robotics approach– Increases productivity when developing and testing

algorithms– Allows experimenting with changes in morphology– Allows importing 3D objects as well as on-line creation of

various objects such as boxes, cylinders, spheres, etc…– Provides the same ports as iCub, which makes the

communication with the real robot as well as the simulator and development transparent

Page 14: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – portsiCub Simulator – ports

• yarp rpc /icubSim/left_leg/rpc:i - 6 joints• yarp rpc /icubSim/right_leg/rpc:i - 6 joints• yarp rpc /icubSim/torso/rpc:i - 3 joints• yarp rpc /icubSim/left_arm/rpc:i - the arm

includes the hand for a total of 16 controlled degrees of freedom

• yarp rpc /icubSim/right_arm/rpc:i - structure is identical to the left arm

• yarp rpc /icubSim/head/rpc:i - 6 joints

• yarp rpc /icubSim/left_leg/rpc:i - 6 joints• yarp rpc /icubSim/right_leg/rpc:i - 6 joints• yarp rpc /icubSim/torso/rpc:i - 3 joints• yarp rpc /icubSim/left_arm/rpc:i - the arm

includes the hand for a total of 16 controlled degrees of freedom

• yarp rpc /icubSim/right_arm/rpc:i - structure is identical to the left arm

• yarp rpc /icubSim/head/rpc:i - 6 joints

Page 15: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – ports exampleiCub Simulator – ports example

• yarp rpc /icubSim/left_arm/rpc:I– set pos 0 45– set vel 0 10

• Moves axis 0 of the left_arm to 45 degrees• Sets the velocity of the left_arm motor

controlling axis 0 to 10

• yarp rpc /icubSim/left_arm/rpc:I– set pos 0 45– set vel 0 10

• Moves axis 0 of the left_arm to 45 degrees• Sets the velocity of the left_arm motor

controlling axis 0 to 10

Page 16: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – ports exampleVision

iCub Simulator – ports exampleVision

• Images:– It is possible to get the images from the left and right eye as well as a "world" view. The

format of the cameras are:• Cartesian ( 320 x 240 )• Fovea ( 128 x 128 )• Logpolar ( 252 x 152 )

• Ports:– /icubSim/cam/left (left camera Cartesian images)– /icubSim/cam/left/fovea (left camera fovea images)– /icubSim/cam/left/logpolar (left camera log polar images)– /icubSim/cam/right (right camera Cartesian images)– /icubSim/cam/right/fovea (right camera fovea images)– /icubSim/cam/right/logpolar (right camera log polar images)– /icubSim/cam/ for the "world" view

• Example– yarpview /example– yarp connect /icubSim/cam/left /example

• Images:– It is possible to get the images from the left and right eye as well as a "world" view. The

format of the cameras are:• Cartesian ( 320 x 240 )• Fovea ( 128 x 128 )• Logpolar ( 252 x 152 )

• Ports:– /icubSim/cam/left (left camera Cartesian images)– /icubSim/cam/left/fovea (left camera fovea images)– /icubSim/cam/left/logpolar (left camera log polar images)– /icubSim/cam/right (right camera Cartesian images)– /icubSim/cam/right/fovea (right camera fovea images)– /icubSim/cam/right/logpolar (right camera log polar images)– /icubSim/cam/ for the "world" view

• Example– yarpview /example– yarp connect /icubSim/cam/left /example

Page 17: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – creating objectsiCub Simulator – creating objects

• There are currently different objects in the world ball, cube, and box

• Port yarp rpc /icubSim/world– SET and GET example• "world set box x y z" eg: "world set ball 1.0 0.1 2.0”• "world get cube" (or ball) this will return the x y z

coordinates of the object

• There are currently different objects in the world ball, cube, and box

• Port yarp rpc /icubSim/world– SET and GET example• "world set box x y z" eg: "world set ball 1.0 0.1 2.0”• "world get cube" (or ball) this will return the x y z

coordinates of the object

Page 18: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – creating objectsExamples

iCub Simulator – creating objectsExamples

• yarp rpc /icubSim/world• world mk box (three params for size) (three params for pos) (three

params for colour) (This creates a box affected by gravity)• world mk sph (radius)(three params for pos) (three params for

colour) (This creates a sphere affected by gravity)• world mk cyl (radius lenght) (three params for pos) (three params

for colour) (This creates a cylinder affected by gravity)• world mk sbox (three params for size) (three params for pos) (three

params for colour) (This creates a static box)• world mk ssph (radius) (three params for pos) (three params for

colour) (This creates a static sphere)• world mk scyl (radius lenght) (three params for pos) (three params

for colour) (This creates a static cylinder)

• yarp rpc /icubSim/world• world mk box (three params for size) (three params for pos) (three

params for colour) (This creates a box affected by gravity)• world mk sph (radius)(three params for pos) (three params for

colour) (This creates a sphere affected by gravity)• world mk cyl (radius lenght) (three params for pos) (three params

for colour) (This creates a cylinder affected by gravity)• world mk sbox (three params for size) (three params for pos) (three

params for colour) (This creates a static box)• world mk ssph (radius) (three params for pos) (three params for

colour) (This creates a static sphere)• world mk scyl (radius lenght) (three params for pos) (three params

for colour) (This creates a static cylinder)

Page 19: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – creating objectsExamples

iCub Simulator – creating objectsExamples

• world mk box 0.03 0.03 0.03 0.3 0.2 1 1 0 0• world mk sph 0.04 0.0 1.0 0.5 1 0 1 • world mk cyl 0.1 0.2 0.0 0.9 1.0 0 0 1 • If you need to rotate the boxes or the

cylinders just use the following function:– world rot (object)(num) rotx roty rotz

• world mk box 0.03 0.03 0.03 0.3 0.2 1 1 0 0• world mk sph 0.04 0.0 1.0 0.5 1 0 1 • world mk cyl 0.1 0.2 0.0 0.9 1.0 0 0 1 • If you need to rotate the boxes or the

cylinders just use the following function:– world rot (object)(num) rotx roty rotz

Page 20: Introduction to humanoid robot iCub, YARP and simulator

iCub Simulator – creating 3D objectExample

iCub Simulator – creating 3D objectExample

• 3D models can be imported to the simulator via /icubSim/world port:– yarp rpc /icubSim/world– world set mdir full_path_to_models – sets the directory containing the 3d

model– world mk model name_of_model.x name_of_texture.bmp Xpos Ypos Zpos – this

will create a dynamic 3D model– world mk smodel name_of_model.x name_of_texture.bmp Xpos Ypos Zpos -

this will create a static 3D model– world get model (num) - this will return the X Y Z position of the 3D model– world set model (num) Xpos Ypos Zpos - this will set the model to the required

X Y Z position– world rot model (num) rotx roty rotz- this will rotate the model to the required

X Y Z angle)

• 3D models can be imported to the simulator via /icubSim/world port:– yarp rpc /icubSim/world– world set mdir full_path_to_models – sets the directory containing the 3d

model– world mk model name_of_model.x name_of_texture.bmp Xpos Ypos Zpos – this

will create a dynamic 3D model– world mk smodel name_of_model.x name_of_texture.bmp Xpos Ypos Zpos -

this will create a static 3D model– world get model (num) - this will return the X Y Z position of the 3D model– world set model (num) Xpos Ypos Zpos - this will set the model to the required

X Y Z position– world rot model (num) rotx roty rotz- this will rotate the model to the required

X Y Z angle)