ROS Analisi introduttiva - Officine Robotiche Robotic Operative System 19/10/13 Raffaello Bonghi 3 COS¢â‚¬â„¢£†

  • View
    0

  • Download
    0

Embed Size (px)

Text of ROS Analisi introduttiva - Officine Robotiche Robotic Operative System 19/10/13 Raffaello Bonghi 3...

  • Analisi introduttiva ROS

    19/10/13 Raffaello Bonghi v1 .1

  • ¡ Cos’è ROS § Eventi

    ¡ Storia § Future distribuzioni

    ¡ Risorse § Tutorial

    ¡ Come usarlo § Pacchetti

    ¡ Applicazioni

    ¡ Install (PC, Arm, … ) ¡ Structure ROS ¡ Roscore ¡ Nodi ¡ Topic

    § Msg/Srv ¡ Service/Param ¡ How to find my Pkgs

    § Best Pkgs

    19/10/13 Raffaello Bonghi 2

    SOMMARIO

  • Robotic Operative System

    19/10/13 Raffaello Bonghi 3

    COS’È ROS

    ¡ E’ un framework per lo sviluppo di software per robot;

    ¡ ROS mette a disposizione strumenti e librerie per aiutare a sviluppare software per applicazioni robotiche;

    ¡ Rilasciato in licenza BSD (Open Source)

  • 19/10/13 Raffaello Bonghi 4

    EVENTI

    ¡  Ogni anno è organizzato il ROSCon

    ¡  Partnership:

    ¡ Nasce nel 2007 dalla Stanford Artificial Intelligence Laboratory

    ¡ Nel 2008 continua l’opera Willow Garage

  • Distribuzioni EOL (End of Life)

    19/10/13 Raffaello Bonghi 5

    STORIA 1/2

    Box Turtle 2 Marzo 2010

    C Turtle 2 Agosto 2010

    Diamodblack 2 marzo 2011

    Electric Emys 30 Agosto 2011

  • Distribuzioni correnti

    19/10/13 Raffaello Bonghi 6

    STORIA 2/2

    Fuerte 23 Aprile 2012

    Groovy 31 Dicembre 2012

    Hydro Medusa 31 Agosto 2013

    Catkin

    Raccomandata

  • 19/10/13 Raffaello Bonghi 7

    FUTURE DISTRIBUZIONI STORIA

    Introduzione di un Programma di distribuzione che seguirà quello di Ubuntu LTS

    Indigo Igloo Aprile 2014

    Ubuntu LTS supports ROS, ROS+1 LTS+1 supports ROS+1 Beta LTS+2 supports ROS+1 LTS+3 supports ROS+2 Beta ... LTS2 supports ROS+2, ROS+3

  • ¡  Il sito ufficiale di ROS: http://wiki.ros.org

    §  Installazione: http://wiki.ros.org/ROS/Installation

    §  Tutorial: http://wiki.ros.org/ROS/Tutorials §  Sensori: http://wiki.ros.org/Sensors

    §  2D sensors: Laser, … §  Camere §  Sensori di forza

    RISORSE

    19/10/13 Raffaello Bonghi 8

    §  GPS, IMU §  Motions (Kinect, Xtion, …) §  Audio

  • ¡ Il tutorial presente sul sito ufficiale: http://wiki .ros.org/ROS/Tutorials

    ¡ Guida iniziale ¡ Guide Avanzate:

    § Rviz § Gazebo § PCL (Kinect, Xtion, … ) § …

    19/10/13 Raffaello Bonghi 9

    TUTORIAL RISORSE

  • PRO

    ¡ Un grande gruppo di ricerca; § Università;

    ¡ Molti Pkgs già disponibili;

    ¡ Visualizzazione § Telemetria § Plot variabili § …

    CONTRO

    ¡ Sistema ancora non stabile;

    ¡ Buone conoscenze di: §  C/C++

    e/o § Python

    ¡ Esecuzione pesante; ¡ Richiede un PC/ARM

    almeno Raspberry PI o superiori;

    19/10/13 Raffaello Bonghi 10

    COME USARLO

  • ¡ Molti robot commerciali usano nativamente ROS, esempio: §  PR2 §  Husky §  TurtleBot §  Kobuki §  Jaguar robots § …

    19/10/13 Raffaello Bonghi 11

    APPLICAZIONI

  • ¡ Cos’è ROS § Eventi

    ¡ Storia § Future distribuzioni

    ¡ Risorse § Tutorial

    ¡ Come usarlo § Pacchetti

    ¡ Applicazioni

    ¡ Install (PC, Arm, … ) ¡ Structure ROS ¡ Roscore ¡ Nodi ¡ Topic

    § Msg/Srv ¡ Service/Param ¡ How to find my Pkgs

    § Best Pkgs

    19/10/13 Raffaello Bonghi 12

    SOMMARIO

  • 1.  sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources. l ist .d/ros- latest . l ist ’

    2.  wget http://packages.ros.org/ros.key -O - | sudo apt-key add – 3.  Instal l ROS

    §  sudo apt-get install ros-hydro-desktop-full §  sudo apt-get install ros-hydro-desktop §  sudo apt-get install ros-hydro-ros-base

    4.  sudo rosdep init 5.  rosdep update 6.  echo "source /opt/ros/hydro/setup.bash" >> ~/.bashrc 7.  source ~/.bashrc

    19/10/13 Raffaello Bonghi 13

    INSTALL

  • 19/10/13 Raffaello Bonghi 14

    STRUCTURE ROS

    workspace_folder/ -- WORKSPACE build/ devel/ src/ -- SOURCE SPACE CMakeLists.txt -- 'Toplevel' CMake file, provided by catkin package_1/ include/ launch/ msg/ src/ srv/ CMakeLists.txt -- CMakeLists.txt file for package_1 package.xml -- Package manifest for package_1 ... package_n/ CMakeLists.txt -- CMakeLists.txt file for package_n package.xml -- Package manifest for package_n

  • ¡ Roscore

    ¡ Roslaunch

    19/10/13 Raffaello Bonghi 15

    ROSCORE

    ... logging to ~/.ros/log/9cf88ce4- b14d-11df-8a75-00251148e8cf/roslaunch- machine_name-13039.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is

  • ¡  roscore = ros+core : master (prov ides name ser v ice for ROS) + rosout (s tdout/ stderr ) + parameter ser ver (parameter ser ver wi l l be int roduced later )

    ¡  rosnode = ros+node : ROS tool to get informat ion about a node. ¡  rosrun = ros+run : runs a node f rom a g iven package.

    19/10/13 Raffaello Bonghi 16

    NODE

    $ rosnode list /rosout /my_turtle

    $ rosnode ping my_turtle

    rosnode: node is [/my_turtle] pinging /my_turtle with a timeout of 3.0s xmlrpc reply from http://aqy:42235/ time=1.152992ms xmlrpc reply from http://aqy:42235/ time=1.120090ms xmlrpc reply from http://aqy:42235/ time=1.700878ms xmlrpc reply from http://aqy:42235/ time=1.127958ms

  • ¡  int8 , int16, int32, int64 (p lus u int*) ¡  f loat32, f loat64 ¡  str ing ¡  t ime, durat ion ¡  other msg f i les ¡  var iable - length array[ ] and f ixed- length array[C]

    19/10/13 Raffaello Bonghi 17

    MSG/SRV TOPIC

    string first_name string last_name uint8 age uint32 score

    int64 A int64 B --- int64 Sum

    MSG message form

    SRV service form

  • 19/10/13 Raffaello Bonghi 18

    TOPIC 1/3

    rostopic pub [topic] [msg_type] [args] $ rostopic pub -1 /trl/cmd_vel sim/Vel -- 2.0 1.8

    $ rostopic -h rostopic bw display bandwidth used by topic rostopic echo print messages to screen rostopic hz display publishing rate of topic rostopic list print information about active topics rostopic pub publish data to topic rostopic type print topic type

    Write Topic - Publish

    C++

    PYTHON

  • 19/10/13 Raffaello Bonghi 19

    TOPIC 2/3

    rostopic echo [topic]

    $ rostopic echo /turtle1/command_velocity

    linear: x: 2.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0 --- linear: x: 2.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0 ---

    Read Topic - Subscribe

    C++

    PYTHON

  • 19/10/13 Raffaello Bonghi 20

    TOPIC 2/3

    $ rostopic list -h

    $ rostopic list -v Published topics: * /turtle1/color_sensor [turtlesim/Color] 1 publisher * /turtle1/cmd_velocity [turtlesim/Velocity] 1 publisher * /rosout [roslib/Log] 2 publishers * /rosout_agg [roslib/Log] 1 publisher * /turtle1/pose [turtlesim/Pose] 1 publisher Subscribed topics: * /turtle1/cmd_velocity [turtlesim/Velocity] 1 subscriber * /rosout [roslib/Log] 1 subscriber

    Usage: rostopic list [/topic] Options: -h, --help show this help message and exit -b BAGFILE, --bag=BAGFILE list topics in .bag file -v, --verbose list full details about each topic -p list only publishers -s list only subscribers

  • 19/10/13 Raffaello Bonghi 21

    SERVICE/PARAM

    rosservice list print information about active services rosservice call call the service with the provided args rosservice type print service type rosservice find find services by service type rosservice uri print service ROSRPC uri

    rosparam set set parameter rosparam get get parameter rosparam load load parameters from file rosparam dump dump parameters to file rosparam delete delete parameter rosparam list list parameter names

    $ rosservice -h

    $ rosparam -h

  • 19/10/13 Raffaello Bonghi 22

    HOW TO FIND MY PKGS 1/2

  • 19/10/13 Raffaello Bonghi 23

    HOW TO FIND MY PKGS 2/2

  • ¡ RQT PLOT ¡ RQT CONSOLE ¡ RVIZ ¡ ROSBRIDGE ¡ ROSSERIAL

    19/10/13 Raffaello Bonghi 24

    BEST PKGS HOW T