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

Build Your Own #ROS2 Robot from Scratch ver. 2

Cc568a0b1284645f9fb927b2343eb87e?s=47 Yutaka Kondo
February 20, 2022

Build Your Own #ROS2 Robot from Scratch ver. 2

I’ve made a presentation today on the monthly Seattle Robotics Society https://seattlerobotics.org meetup and introduced how to build ROS2 robot.

Google Slide: https://docs.google.com/presentation/d/1iTxHlosz5p0m-i1FsYQf6F62RVgH6VHtalxS5MAhcDg/edit?usp=sharing

Cc568a0b1284645f9fb927b2343eb87e?s=128

Yutaka Kondo

February 20, 2022
Tweet

More Decks by Yutaka Kondo

Other Decks in Technology

Transcript

  1. Build Your Own ROS 2 Robot from Scratch ver. 2

    Yutaka Kondo yutaka.kondo@youtalk.jp https://www.youtalk.jp
  2. I’m Yutaka Kondo or @youtalk Ph. D. Engineer of Preferred

    Robotics, Inc. Author of world first ROS 2 book (in Japanese) Ex-organizer of ROS Japan Users Group NVIDIA Jetson Influencer Father of 2 kids 2 http://amzn.to/2Ji8mQl
  3. Preferred Robotics, Inc. Established in 2021 A carve-out company from

    Preferred Networks, Inc. to focus on robot product and business development https://www.preferred.jp/en/news/pr20211126/ 3
  4. 4 https://youtu.be/zG4gFkLX9ec https://youtu.be/ElicLJft748 https://youtu.be/7fnhM04G3HQ https://youtu.be/DGJazkyw0Ws

  5. Agenda 1. ROS and ROS 2 2. Robot Design with

    ROS 2 3. Robot Control by ROS 2 4. Use Cases Goal: be able to build your original ROS 2 arm robot from scratch 5
  6. Build Your Own ROS 2 Robot from Scratch ver. 1

    https://youtu.be/B2hrMPb5IpY 6
  7. ROS and ROS 2 7

  8. 8 https://www.ros.org

  9. Use cases 9 Original use cases # of robots A

    single robot Computation Workstation-class computational resources on board Real-timeness No real-time requirements Network quality Excellent network connectivity Users Applications in research, mostly academia Programming style Maximum flexibility, with nothing prescribed or proscribed https://design.ros2.org/articles/why_ros2.html ROS ROS 2 New use cases Teams of multiple robots Small embedded platforms Real-time systems Non-ideal networks Production environments Prescribed patterns for building and structuring systems
  10. 10 https://roscon.ros.org/2016/presentations/ROSCon %202016%20-%20ROS%202%20Update.pdf

  11. DDS DDS is a middleware protocol and API standard for

    data-centric connectivity from the Object Management Group. 11 https://www.dds-foundation.org/what-is-dds-3/
  12. ROS 2 Architecture 12 ROS Middleware (rmw) • Interface of

    DDS vendor implementations • Message transport and serialization ROS Client library (rcl) • Interface of client programming languages https://roscon.ros.org/2016/presentations/ROSCon %202016%20-%20ROS%202%20Update.pdf
  13. ROS 2 Ecosystem rosbag 2: Data record and play tool

    RViz 2: Data visualization platform Ignition Gazebo: Simulation MoveIt 2: Manipulation Nav 2: Navigation 13
  14. Robot Design with ROS 2 14

  15. pantilt_bot Design and Build Minimum viable arm robot • Pan/tilt

    axes: ROBOTIS Dynamixel XM435-W350 • Camera: Intel RealSense D435i 15
  16. ROBOTIS Dynamixel Servo motor for robots Operation modes: • Current

    Control Mode • Velocity Control Mode • Position Control Mode • Extended Position Control Mode • Current-based Position Control Mode • PWM Control Mode There is official ROS 1 packages but no ROS 2 packages… But I’ve made them! https://emanual.robotis.com/docs/en/dxl/x/ 16
  17. ROBOTIS Dynamixel The CAD models of the motors and hinges

    are downloadable 17 http://en.robotis.com/service/downloadcenter.php
  18. Intel RealSense Color and Depth cameras with IMU Specs: •

    Field of view: 87° x 58° • Global Shutter • Ideal range: 0.6m ~ 6.0m There is official ROS 2 packages! https://github.com/IntelRealSense/realsense-ros/tree/ros2 https://www.intelrealsense.com 18
  19. Steps 1. Design the robot by 3D CAD software 2.

    Export the URDF from the CAD model 3. Migrate the ROS format to the ROS 2 fomart 4. Enable the ROS 2 control confguration 5. Run with ROS 2 applications 19
  20. URDF Unified Robot Description Format (URDF) is an XML format

    for representing a robot model Real robot URDF Applications https://robots.ros.org/PR2/ 20
  21. Fusion 360 One of the 3D CAD software There is

    a personal license for hobby use and it’s free! https://www.autodesk.com/products/fusion-360/personal 21
  22. URDF Exporter Plugin https://github.com/syuntoku14/fusion2urdf fusion2urdf can convert the Fusion 360

    model to the URDF model Note that fusion2urdf can only export ROS format 22
  23. https://youtu.be/aFr25ekHb04 23

  24. Migration to ROS 2 package https://github.com/youtalk/dynamixel_control/tree/main/pantilt_bot_description 1. Replace the package

    format to the ROS 2 format 2. Replace the launch files to ROS 2 format ones 3. Replace the ros_control tag to the ros2_control tag in the URDF files 24
  25. Intel RealSense Camera Attachment Attach the RealSense D435i sensor on

    top of the pantilt_bot Official realsense2_description package contains the D435i URDF file 25 https://github.com/youtalk/dynamixel_control/blob/main/ pantilt_bot_description/urdf/pantilt_bot.urdf.xacro
  26. Operation Check by joint_state_publisher_gui $ ros2 launch pantilt_bot_description display.launch.py 26

    https://youtu.be/2EmN7pXxZJc
  27. Robot Control by ROS 2 27

  28. ROS 2 Control 28 http://control.ros.org/resources/resources.html

  29. dynamixel_control Repository https://github.com/youtalk/dynamixel_control dynamixel_hardware: • SystemInterface implementation for Dynamixel pantilt_bot_description:

    • Use case for pantilt_bot open_manipulator_x_description: • Use case for ROBOTIS OpenManipulator-X 29
  30. dynamixel_hardware Package 30

  31. ros2_control Plugin Configuration Resource configuration hardware tag: • plugin: SystemInterface

    • usb_port • baud_rate • use_dummy: dummy mode joint tags: • id: motor ID • command_interaface • state_interface 31
  32. ros2_controllers Plugin Configuration Controller configuration controller_manager: • ROS params for

    controller manager • List up of controller plugins ***_controller: • ROS params for each controller 32
  33. Operation Check with Dummy Robot 1. Check use_dummy parameter is

    enabled 2. Launch ros2_control manager $ ros2 launch pantilt_bot_description pantilt_bot.launch.py 33 https://github.com/youtalk/dynamixel_control/blob/main/p antilt_bot_description/urdf/pantilt_bot.ros2_control.xacro
  34. Operation Check with Dummy Robot 3. Switch to joint_trajectory_controller and

    send trajectory $ ros2 control switch_controllers --start joint_state_broadcaster --start joint_trajectory_controller --stop velocity_controller $ ros2 action send_goal /joint_trajectory_controller/follow_joint_trajectory control_msgs/action/FollowJointTrajectory -f "{ trajectory: { joint_names: [joint1, joint2], points: [...] }}" 34
  35. 35 https://youtu.be/pXxyRRm-yMQ

  36. Operation Check with Real Robot Just disable use_dummy parameter 36

  37. https://youtu.be/DzizMZp3KqU 37

  38. Use Cases 38

  39. ROBOTIS OpenManipulator-X https://youtu.be/EZtBaU-otzI 39

  40. ROBOTIS OpenManipulator-X https://github.com/youtalk/dynamixel_control/tree/main/open_manipulator_x_des cription 40

  41. Original Mobile Manipulator https://youtu.be/2srDav_n2S0 41

  42. Original Mobile Manipulator https://github.com/youtalk/youfork 42

  43. Neural Network Applications Inverse Kinematics Estimation by NN Gripper Control

    by Hand Gesture Estimation https://youtu.be/62_zIF_PvxU https://youtu.be/LfvF1uWKDAc 43
  44. Neural Network Applications https://github.com/youtalk/iknet 44

  45. And More https://twitter.com/youtalk/status/1435953228122705920?s=21 https://twitter.com/shirokunet/status/1436579497810169857?s=21 Fencing Robot Digger 45

  46. Build Your Own ROS 2 Robot from Scratch Yutaka Kondo

    yutaka.kondo@youtalk.jp https://www.youtalk.jp Let’s