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. 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
  2. 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
  3. 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
  4. Build Your Own ROS 2 Robot from Scratch ver. 1

    https://youtu.be/B2hrMPb5IpY 6
  5. 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
  6. 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/
  7. 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
  8. 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
  9. pantilt_bot Design and Build Minimum viable arm robot • Pan/tilt

    axes: ROBOTIS Dynamixel XM435-W350 • Camera: Intel RealSense D435i 15
  10. 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
  11. ROBOTIS Dynamixel The CAD models of the motors and hinges

    are downloadable 17 http://en.robotis.com/service/downloadcenter.php
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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