Upgrade to Pro — share decks privately, control downloads, hide ads and more …

第1回ROS勉強会発表資料 ROS+Gazeboではじめるロボットシミュレーション

5e8224dd66eb7871fb05672ba08c7275?s=47 akio
June 28, 2016

第1回ROS勉強会発表資料 ROS+Gazeboではじめるロボットシミュレーション

ROS + Gazeboの紹介など。内容が大分古くなっているのでご注意。

5e8224dd66eb7871fb05672ba08c7275?s=128

akio

June 28, 2016
Tweet

More Decks by akio

Other Decks in Technology

Transcript

  1. ςΩετ ROS+GazeboͰ͸͡ΊΔϩϘοτγϛϡϨʔγϣϯ akio

  2. DISCLAIMER ͜ͷൃදͷ಺༰͸શͯެ։͞Ε͍ͯΔ৘ใ͓Αͼൃ දऀ(akio)ͷݸਓతͳҙݟʹجͮ͘΋ͷͰ͢ɻൃදऀ ͷޏ༻ऀʹҰ੾ͷؔ܎͸͋Γ·ͤΜɻ ൃද಺༰ʹ͸ࡉ৺ͷ஫ҙΛ෷͍ͬͯ·͕͢ɺهࡌ৘ ใͷ͝ར༻ʹΑΓສҰଛ֐͕ੜͯ͡΋ɺൃදऀ͸Ұ ੾ͷ੹೚Λෛ͍·ͤΜɻ

  3. ࣗݾ঺հ akio @akio(GitHub) ϩϘοτͷιϑτ΢ΣΞΛ։ൃ͢Δ࢓ࣄΛͯ͠·͢ ֶੜ࣌୅͔Β෺ཧγϛϡϨʔλͰ༡Ϳͷ͕޷͖Ͱ͢

  4. ಺༰ Gazeboʹ͍ͭͯ ROSͱͷ࿈ܞ ͙͢ࢼͤΔύοέʔδ ࣗ෼ͷϞσϧΛͭͬͯ͘ΈΑ͏ ·ͱΊ

  5. Gazeboʹ͍ͭͯ

  6. Gazeboͱ͸ ! ެࣜαΠτ͸http://gazebosim.org ΦʔϓϯιʔεʢApacheϥΠηϯεʣͷ̏DϩϘοτγϛϡϨʔλ ϦΞϧλΠϜੑΛॏࢹ OGREΛར༻ͨ͠ߴ඼࣭ͳάϥϑΟοΫ ෳ਺ͷ෺ཧΤϯδϯΛ੾Γସ͑ΒΕΔʢODE, Bullet, Simbody, DARTʣ

    ΧϝϥɺϨʔβʔϨϯδϑΝΠϯμͳͲͷηϯαʔγϛϡϨʔγϣϯ ಠࣗͷAPIΛ͕࣋ͭɺROSͱͷ࿈ܞ΋ॆ࣮
  7. ಠஅͱภݟʹΑΔGazeboͷྺ࢙ Player࣌୅ ROS࣌୅ Standalone࣌୅ɹࠓ͜͜

  8. Player࣌୅ 2DϩϘοτγϛϡϨʔλPlayer/Stageͷ༻్Λิ׬͢ Δ໨తͰ࢝ಈ ઃఆϑΝΠϧ͸XMLϕʔεͰهड़ ϥΠηϯε͸GPL ൃදऀ΋͋·ΓΑ͘஌Βͳ͍

  9. ROS࣌୅(2009 - 2011) Willow Garage͕։ൃࢧԉ ROSͱͷ࿈ܞΛ༰қʹ͢Δ౒ྗ͕ͳ͞ΕΔ PR2ͷγϛϡϨʔλͱͯ͠ར༻͞ΕΔ C++αϙʔτͷڧԽ ίʔυϕʔε͸Player࣌୅ͱಉ͡ʢGPLʣ ROS

    Wikiʹ͸·ͩ͜ͷ࣌୅ͷهड़͕࢒͓ͬͯΓɺࠞཚ͠΍͍͢
  10. Standalone࣌୅(2012 - ݱࡏ) WillowGarage͔ΒεϐϯΞ΢τͨ͠OSRF(Open Source Robotics Foundation) ͕ओʹ։ൃ શ໘తͳॻ͖௚͕͠ߦΘΕɺόʔδϣϯ΋Ϧηοτ ϥΠηϯε΋Apache

    Software License 2.0ʹ ઃఆϑΝΠϧ΋SDFʢSimulation Description Formatʣ΁ ProtobufΛར༻ͨ͠ಠࣗͷϝοηʔδ௨৴ػߏΛ࣋ͭ DARPA Robotics Challengeͷ༧બͷҰͭVRC(Virtual Robotics Challenge)༻γ ϛϡϨʔλʹ࠾༻͞ΕΔ
  11. GazeboͷΞʔΩςΫνϟ SDF gzserver gzclient (GUI) ϓϥάΠϯ Ϟσϧ Load Ϟσϧ ϓϥάΠϯ

    ϓϥάΠϯ Simulation World ϝοηʔδ௨৴ ੍ޚॲཧͳͲ
  12. ޲͖ෆ޲͖ ݩʑͷ։ൃܦҢ͔ΒɺηϯαʔʴγϯϓϧͳػߏͷϩϘοτͱ͸ൺֱత૬ੑ ͕ྑ͍Ͱ͢ ͔͠͠ɺ෺ཧγϛϡϨʔγϣϯΤϯδϯͷΞϧΰϦζϜͷӨڹ΋͋Γଟؔઅ ϩϘοτ΍าߦϩϘοτͳͲͰ͸͍ۤ͠৔໘͕… ϦΞϧλΠϜੑॏࢹͳͷͰɺݫີͳਫ਼౓Λظ଴͠ͳ͍Ͱ࢖͏ͷ͕ྑ͍ v1.9Λ࢖͍ͬͯͯ΋ಈ࡞͕ෆ҆ఆͳ͕࣌͋ΔɻకΊ੾Γʹ௥ΘΕ͍ͯΔ࣌ʹ ͸޲͔ͳ͍͔΋͠Εͳ͍ ࠓޙ(v2.2ʙʣɺ෺ཧγϛϡϨʔγϣϯΤϯδϯͷબ୒ࢶ͕޿͕ΔͷͰɺվળ ͷر๬͸͋Γ·͢

  13. ·ͱΊ ࠓޙ͸Standalone൛͕ओྲྀͰ͢ ޲͖ෆ޲͖͕͋ΔͷͰɺ༻్ͱੑೳΛߟྀͯ͠࢖͏ ͷ͕٢Ͱ͢ ࠓޙͷվળ࣍ୈͰରԠ༻్͸޿͕Δ͔΋ʁ

  14. ROSͱͷ࿈ܞ

  15. GazeboͱROSͱͷ࿈ܞػߏͷ࠶੔උ Standalone൛Ͱ͸௕Β͘ެࣜͳROSͱͷ࿈ܞػߏ͕ ͳ͔ͬͨ Standalone൛1.3ʙ͔ΒରԠ࢝͠Ί1.9Ͱ΄΅҆ఆ ROS͸Hydro͔Βͪ͜Βͷ࢓૊Έʹ४ڌ GroovyͰ͸͋ͪͪ͜ෆ੔߹͕ग़·͢

  16. SDF gzserver gzclient (GUI) ϓϥάΠϯ Ϟσϧ Load ϓϥάΠϯ Simulation World

    ϝοηʔδ௨৴ ੍ޚॲཧͳͲ ࿈ܞγεςϜͷΞʔΩςΫνϟ URDF ม׵ ROS controller manager roscpp ROSϊʔυ ROSϊʔυ Controller ϓϥάΠϯ Ϟσϧ Controller ϓϥάΠϯ roscpp roscpp ROS ϝοηʔδ౳
  17. ϞσϧΛ੍ޚ͍ͨ͠৔߹ gazebo_pluginsʹ͋Δط੒ϓϥάΠϯΛ࢖͏ GazeboϓϥάΠϯͱͯ͠։ൃ͢Δ Ϟσϧʹඥ͍ͮͯɺGazebo APIΛར༻ roscppΛ࢖ͬͯଞͷROSϊʔυͱ௨৴ ros-controlsͷControllerManagerʹରԠͨ͠ControllerϓϥάΠϯͱͯ͠։ൃ͢Δ ros-controls͸PR2ͷϦΞϧλΠϜ੍ޚϨΠϠʔͷҰൠԽ൛ ࣮ػ༻੍ޚϓϩάϥϜͱɺControllerΛڞ༗Ͱ͖Δ

  18. gazebo_pluginsͷϓϥάΠϯ Camera Multicamera Depth Camera Openni Kinect GPU Laser Laser

    Block Laser F3D (Force Feedback Ground Truth) Force IMU Joint Pose Trajectory P3D (3D Position Interface for Ground Truth) Projector Prosilica Camera Bumper Differential Drive Skid Steering Drive Video Plugin Planar Move Plugin
  19. ·ͱΊ ͠͹Β͘͸Gazebo1.9 + ROS Hydroͷ૊Έ߹Θ͕ͤ҆ఆͩͱࢥ ΘΕ·͢ ҟͳΔόʔδϣϯΛ૊Έ߹ΘͤΔͱɺ௥੻͕೉͍͠Τϥʔ͕ग़ ͨΓ͠·͢ ϞσϧΛ੍ޚ͢ΔͳΒকདྷతʹ͸ros-controlsܦ༝͔ʁ ros-controlsࣗମ͸·ͩ੒ख़͖͍ͬͯ͠ͳ͍

    ࠓ͸࢖͍෼͚͕ඞཁ
  20. ͙͢ࢼͤΔύοέʔδ

  21. ROS HydroͰϦϦʔε͞Ε͍ͯΔ GazeboγϛϡϨʔγϣϯPKG ൃදऀௐ΂ͳͷͰɺൈ͚ʗ࿙ΕͳͲଟ਺͋ΔͱࢥΘΕ·͢ Turtlebot2/Kobuki Husky Grizzly youBot Segbot UR5/10

    Hector Quadcoptor
  22. ςΩετ Turtlebot2/Kobuki Πϯετʔϧ $ apt-get install ros-hydro-turtlebot-simulator ࣮ߦ $ roslaunch

    turtlebot_gazebo turtlebot_empty_world.launch !
  23. ςΩετ Husky Πϯετʔϧ $ apt-get install ros-hydro-husky-simulator ࣮ߦ $ roslaunch

    husky_gazebo husky_empty_world.launch
  24. ςΩετ Grizzly Πϯετʔϧ $ apt-get install ros-hydro-grizzly-simulator ࣮ߦ $ roslaunch

    grizzly_gazebo grizzly_empty_world.launch
  25. ςΩετ youBot Πϯετʔϧ $ apt-get install ros-hydro-youbot-simulation ࣮ߦ $ roslaunch

    youbot_gazebo_robot youbot_dual_arm.launch
  26. ςΩετ Segbot Πϯετʔϧ $ apt-get install ros-hydro-segbot-simulator ࣮ߦ $ roslaunch

    segbot_gazebo segbot_test_world.launch (ผͷ୺຤)$ roslaunch segbot_gazebo segbot_mobile_base.launch
  27. ςΩετ UR5/10ʢUniversal Robotsʣ Πϯετʔϧ $ apt-get install ros-hydro-ur-gazebo ࣮ߦ (UR5)$

    roslaunch ur_gazebo ur5.launch (UR10)$ roslaunch ur_gazebo ur10.launch ΞʔϜ͚ͩͳͷͰɺ޷͖ͳ୆ंʹ͚ͬͭ͘Α͏
  28. ςΩετ Hector Quadrotor Πϯετʔϧ $ apt-get install ros-hydro-hector-quadrotor-gazebo ࣮ߦ $

    roslaunch hector_quadrotor_gazebo quadrotor_empty_world.launch
  29. ·ͱΊ ROS HydroͳΒ͙͢ࢼͤΔγϛϡϨʔλϞσϧଟ਺ جຊతʹඪ४తͳΠϯλʔϑΣʔεʹ४ڌ͍ͯ͠Δͷ ͰɺଞͷROSϑϨʔϜϫʔΫ(MoveIt!ͳͲʣͱ΋ൺֱ త༰қͷ͸ͣ

  30. ࣗ෼ͷϞσϧΛ࡞ͬͯΈΑ͏ ʢαϯϓϧίʔυͰֶͿฤʣ

  31. ࢀߟʹͳΔࢿྉ ެࣜͷROS࿈ܞνϡʔτϦΞϧ http://gazebosim.org/wiki/Tutorials#ROS_Integration ্هνϡʔτϦΞϧͷαϯϓϧίʔυ https://github.com/ros-simulation/gazebo_ros_demos

  32. ࠓճͷྫ୊ ެࣜνϡʔτϦΞϧྫ ୊ΛࢀߟʹΑΓ؆ུԽ ̍࣠ճసؔઅΛ࣋ͭ ΞʔϜઌ୺ʹ͸Χϝϥ Xacroແ͠Ͱॻ͘

  33. ඞཁͳύοέʔδ ros-hydro-gazebo-ros-pkgs ros-hydro-gazebo-ros-control ros-hydro-ros-controllers ֬ೝ༻ ros-hydro-image-view2

  34. αϯϓϧίʔυ sudo apt-get install git CatkinͷϫʔΫεϖʔεΛ࡞ͬͯɺsrcσΟϨΫτϦʹ clone ͍ͯͩ͘͠͞ɻ git clone

    https://github.com/akio/myrobot_demo.git
  35. ϑΝΠϧͷઆ໌ myrobot_demo myrobot_gazebo package.xmlɹɹɹී௨ CMakeLists.txtɹɹී௨ myrobot.launchɹɹશ෦ೖΓLaunch myrobot.urdf ɹɹϞσϧͷఆٛ

  36. ղઆ෇͖ίʔυͰઆ໌

  37. ϞσϧΛॻ࣌͘ͷ஫ҙ఺ URDF͔ΒSDF΁ͷม׵ϓϩάϥϜ΍ɺGazeboαʔόʔͷΤ ϥʔ΍ܯࠂ͕ൃల్্ɻ ݁ՌɺΤϥʔ͕ى͖ͯ΋ݪҼෆ໌ͱ͍͏͜ͱ͕Α͋͘Γ·͢ ৔߹ʹΑͬͯ͸ҙਤ͠ͳ͍݁Ռ͕ग़͍ͯͯ΋ΤϥʔʹͳΒͳ ͍͜ͱ΋͋Γ·͢ ͦΜͳͱ͖͸ม׵εςοϓΛҰͭҰͭ෼ղͯ֬͠ೝ͢Δͱྑ ͍Ͱ͢ʢମݧஊʣ

  38. ·ͱΊ جຊ͸URDFͳͷͰɺJointͱϦϯΫͷ܁Γฦ͠ͰϩϘοτΛ૊ ΈཱͯΔ ඞཁͳ෦෼ʹɺGazebo༻ͷઃఆΛ௥Ճ͢ΔΠϝʔδ GazeboϓϥάΠϯɺROS ControllersϓϥάΠϯͱ΋ʹ๛෋ʹ४ උ͞Ε͍ͯΔͷͰɺࣗ෼ͷ࢖͍͍ͨػೳΛΑ͘୳͠·͠ΐ͏ ෳࡶͳϩϘοτ͸ͱͯ΋هड़͕௕͘ͳΔͷͰɺXacroΛ࢖ͬͯ هड़ΛݮΒͨ͠ΓɺϑΝΠϧ෼ׂ͢ΔςΫχοΫ͕ඞཁ

  39. શମͷ·ͱΊ

  40. શମͷ·ͱΊ ಉ͡GazeboͰ΋৭ʑ͋ΔͷͰɺཁ஫ҙ ͠͹Β͘͸Gazebo1.9 + Hydro͕҆ఆ ͙͢ʹ࢖͑ΔϩϘοτϞσϧͷ഑෍͕࢝·͍ͬͯΔ ཁྖ͕Θ͔Ε͹ɺࣗ෼ͰϩϘοτϞσϧ΍৽͍͠ϓ ϥάΠϯΛ։ൃͰ͖Δ