Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

ROS and ROS 2 7

Slide 8

Slide 8 text

8 https://www.ros.org

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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/

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

Robot Design with ROS 2 14

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

https://youtu.be/aFr25ekHb04 23

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Robot Control by ROS 2 27

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

dynamixel_hardware Package 30

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

Operation Check with Real Robot Just disable use_dummy parameter 36

Slide 37

Slide 37 text

https://youtu.be/DzizMZp3KqU 37

Slide 38

Slide 38 text

Use Cases 38

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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