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

Build Your Own #ROS2 Robot from Scratch ver. 2

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

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
    [email protected]
    https://www.youtalk.jp

    View Slide

  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

    View Slide

  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

    View Slide

  4. 4
    https://youtu.be/zG4gFkLX9ec https://youtu.be/ElicLJft748
    https://youtu.be/7fnhM04G3HQ https://youtu.be/DGJazkyw0Ws

    View Slide

  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

    View Slide

  6. Build Your Own ROS 2 Robot from Scratch ver. 1
    https://youtu.be/B2hrMPb5IpY
    6

    View Slide

  7. ROS and ROS 2
    7

    View Slide

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

    View Slide

  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

    View Slide

  10. 10
    https://roscon.ros.org/2016/presentations/ROSCon
    %202016%20-%20ROS%202%20Update.pdf

    View Slide

  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/

    View Slide

  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

    View Slide

  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

    View Slide

  14. Robot Design with ROS 2
    14

    View Slide

  15. pantilt_bot Design and Build
    Minimum viable arm robot
    ● Pan/tilt axes: ROBOTIS Dynamixel
    XM435-W350
    ● Camera: Intel RealSense D435i
    15

    View Slide

  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

    View Slide

  17. ROBOTIS Dynamixel
    The CAD models of the motors and hinges are downloadable
    17
    http://en.robotis.com/service/downloadcenter.php

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  23. https://youtu.be/aFr25ekHb04
    23

    View Slide

  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

    View Slide

  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

    View Slide

  26. Operation Check by joint_state_publisher_gui
    $ ros2 launch pantilt_bot_description display.launch.py
    26
    https://youtu.be/2EmN7pXxZJc

    View Slide

  27. Robot Control by ROS 2
    27

    View Slide

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

    View Slide

  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

    View Slide

  30. dynamixel_hardware Package
    30

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  35. 35
    https://youtu.be/pXxyRRm-yMQ

    View Slide

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

    View Slide

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

    View Slide

  38. Use Cases
    38

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  44. Neural Network Applications
    https://github.com/youtalk/iknet
    44

    View Slide

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

    View Slide

  46. Build Your Own ROS 2 Robot
    from Scratch
    Yutaka Kondo
    [email protected]
    https://www.youtalk.jp
    Let’s

    View Slide