/ros2_RobotSimulation

ROS2.0 Foxy and Humble repositories which provide ready-to-use ROS2.0 Gazebo + MoveIt!2 simulation packages for different Industrial and Collaborative Robots.

Primary LanguagePythonApache License 2.0Apache-2.0


header

ROS2.0 ROBOT SIMULATION - ROS2.0 Humble

IFRA (Intelligent Flexible Robotics and Assembly) Group
Centre for Robotics and Assembly
Cranfield University

Table of Contents
  1. About
  2. Getting Started
  3. Supported Robots
  4. ROS2 Packages
  5. Contributing
  6. License
  7. Cite our work
  8. Contact
  9. Acknowledgments

About

Intelligent Flexible Robotics and Assembly Group

The IFRA (Intelligent Flexible Robotics and Assembly) Group is part of the Centre for Robotics and Assembly at Cranfield University.

IFRA Group pushes technical boundaries. At IFRA we provide high tech automation & assembly solutions, and we support smart manufacturing with Smart Industry technologies and solutions. Flexible Manufacturing Systems (FMS) are a clear example. They can improve overall operations and throughput quality by adapting to real-time changes and situations, supporting and pushing the transition towards flexible, intelligent and responsive automation, which we continuously seek and support.

The IFRA Group undertakes innovative research to design, create and improve Intelligent, Responsive and Flexible automation & assembly solutions, and this series of GitHub repositories provide background information and resources of how these developments are supported.

ros2_RobotSimulation Repository

ROS (Robotics Operating System) is a great tool that, combined with Gazebo and MoveIt! frameworks, provides a great amount of resources and capabilities to develop different Robotics Applications with a huge range of Industrial and Collaborative Robots.

Nonetheless, developing new applications in ROS requires a huge previous work, which consists in developing ROS Packages that contain all the Robot data required for the Simulation and Control, including:

  • Kinematics.
  • Control parametres.
  • CAD files.
  • Physical parametres.
  • Joint limits.
  • Extra features.

As a common rule, the software stack needed to execute and test an Industrial Robot Simulation in ROS is:

  • A "robot_gazebo" package, which simulates the behaviour of the Robot.
  • A "robot_moveit" package, which controls the performance of the Robot. With both combined, different applications and implementations can be developed using the Robotics Operating System (ROS).

ROS is now undertaking a transformation process to ROS2, a newer and improved version of ROS1. Thus, this involves that all the developments, implementations and packages released for ROS1 have to be forked/translated to ROS2 or are directly unavailable in ROS2.

The IFRA Group in Cranfield University (Bedfordshire, UK) has identified a huge gap in the availability of "ready-to-use" ROS2 Industrial Robot Simulation packages, and that is why the ros2_RobotSimulation ROS2 repository has been developed and released. The repository consists of Gazebo (simulation) + MoveIt!2 (control) package combinations for each supported Industrial Robot (or Robot + Gripper combinations), and follows a common standard for a better understanding and further development.

(back to top)

Getting Started

All packages in this repository have been developed, executed and tested in an Ubuntu 22.04 machine with ROS2.0 Humble. Please find below all the required steps to set-up a ROS2.0 Humble environment in Ubuntu and install the Robot Simulation packages.

ROS2.0 Humble Environment Set-Up

  1. Install Ubuntu 22.04: https://ubuntu.com/desktop
  2. Install Git:
    • In terminal shell:
      sudo apt install git
    • Git account configuration:
      git config --global user.name YourUsername
      git config --global user.email YourEmail
      git config --global color.ui true
      git config --global core.editor code --wait # Visual Studio Code is recommended.
      git config --global credential.helper store
  3. Install ROS2.0 Humble:
  4. Install MoveIt!2 for ROS2 Humble:
    • Reference: MoveIt!2 Humble
    • Command for binary install:
      sudo apt install ros-humble-moveit
      # Binaries are recommended for a cleaner MoveIt!2 install and usage.
  5. Create and configure the ROS2.0 Humble ~/dev_ws environment/workspace:
  6. Install ROS2 packages, which are required to launch ROS2 Robot Simulation and Control environments:
    • ROS2 Control:
      sudo apt install ros-humble-ros2-control
    • ROS2 Controllers:
      sudo apt install ros-humble-ros2-controllers
      sudo apt install ros-humble-gripper-controllers
    • Gazebo-ROS2:
      sudo apt install gazebo
      sudo apt install ros-humble-gazebo-ros2-control
      sudo apt install ros-humble-gazebo-ros-pkgs
    • xacro:
      sudo apt install ros-humble-xacro
    • Fix cycle time issues in humble-moveit (temporary fix):
      sudo apt install ros-humble-rmw-cyclonedds-cpp
      Add into .bashrc file -> export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

Import and install ros2_RobotSimulation Repository

Required to run ros2_RobotSimulation ROS2.0 packages:

  1. A small improvement of the move_group_interface.h file has been developed in order to execute the Robot/Gripper triggers in this repository. Both the upgraded file and the instructions of how to implement it can be found here: move_group_interface_improved.h
  2. Installation:
    cd ~/dev_ws/src
    git clone https://github.com/IFRA-Cranfield/ros2_RobotSimulation.git -b humble
    cd ~/dev_ws/
    colcon build

(back to top)

Supported Robots

The Simulation & Control packages of the following Robots are currently available:

(back to top)

ROS2 Packages

ros2_data

This repository contains all the custom data structures that are used for the ROS2 Robot Actions/Triggers in ros2_RobotSimulation. Every single ROS2 Action that is used to trigger a robot movement refers to a .action data structure, which contains all the data needed to run that specidic action. For further detail, please click here.

ros2_actions

The ros2_actions package gathers all the ROS2 Action Servers that execute ROS2 Robot Actions/Triggers. Every specific robot movement is contained in a ROS2 Action Server (.cpp script), which can be externally "called" (triggered) and returns some feedback after the execution. For further detail, please click here.

The following video shows how ROS2 Robot Action calls are done from the Ubuntu Terminal:

ros2_RobotSimulation.-.ros2_actions.mp4

ros2_execution

It is a cool feature to be able to execute different ROS2 actions and trigger different movements in a Robot in Gazebo, but Robotics Applications are made of sequences that execute different commands one after the other. In a nutshell, that is what this ros2_execution package does. The ros2_execution.py script contains all the Action Clients that connect to the Action Servers generated in ros2_actions, and executes robot movements one after the other according to a pre-defined sequence, which is inputted as a .txt file. For further information, please click here.

One of the main advantages of using this ros2_execution package, combined with ros2_data/ros2_actions and the Robot Simulation packages contained in this repository, is that programs/sequences can be executed in the exact same way for different Robots, which is a completely novel feature and has been made possible thanks to the MoveIt!2 framework.

The following videos showcase the execution of a program (a sequence of movements -> {MoveJ, MoveL, MoveROT, MoveR}) executed in the exact same way for the ABB-IRB120 and UR3 robots:

ros2_RobotSimulation.-.ros2_execution.irb120.mp4

ros2_RobotSimulation.-.ros2_execution.ur3.mp4

ros2_grasping

Unfortunately, Gazebo and ROS2 do not provide an effective method to properly pick and place (manipulate) objects in simulation (if it exists, it has not been found). This feature is essential in order to test and simulate different applications, and that is the main reason why this ros2_grasping package has been created.

The attacher_action.py script contains a ROS2 Action Server that performs the task of attaching/detaching a specific object to a specific end-effector in Gazebo. Apart from the attaching functionality, the spawn_object.py script enables the user to spawn custom objects (contained in .urdf of .xacro files) to a Gazebo simulation environment. For further detail, please click here.

The video below showcases a simple cube pick and place task executed by an ABB-IRB120 robot:

ros2_RobotSimulation.-.ros2_grasping.mp4

(back to top)

Contributing

Please find below a list of potential improvements and new features that have been identified for this repository:

  • Improve the ros2_grasping package. The attaching/detaching feature works well in Gazebo, but the movement (in simulation) is not very clean. The Action Server subscribes to the motion of the end-effector and replicates it into the object selected, and this is not the cleanest way to simulate a pick and place task.
  • Implement cartesian speed control. The speed control works well for all ROS2 Robot Triggers, except for the MoveL motion. This is because MoveIt!2 generates a custom (linear) trajectory in this case, where joint speed control is not applicable. A linear speed control feature has been identified in ROS1, but it is missing in ROS2.
  • Remove all unnecessary warnings/logs when launching the robot simulation environments.

This repo contains only a few number of robots, end-effectors and simulation environments (layouts). Please do let us know if you wish to include a specific robot/end-effector or application into ros2_RobotSimulation!

The exact same thing for the ROS2 Robot Actions/Triggers: A few number of robot movements have been implemented, therefore please do let us know if you have any ideas of a potential Robot motion for our repo!

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you have a suggestion that would make this better, or you find a solution to any of the issues/improvements presented above, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks you very much!

(back to top)

License

Intelligent Flexible Robotics and Assembly Group
Created on behalf of the IFRA Group at Cranfield University, United Kingdom
E-mail: IFRA@cranfield.ac.uk

Licensed under the Apache-2.0 License.
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Cranfield University
School of Aerospace, Transport and Manufacturing (SATM)
Centre for Robotics and Assembly
College Road, Cranfield
MK43 0AL, Bedfordshire, UK

(back to top)

Cite our work

You can cite our work with the following statement:
IFRA (2022) ROS2.0 ROBOT SIMULATION. URL: https://github.com/IFRA-Cranfield/ros2_RobotSimulation.

(back to top)

Contact

Mikel Bueno Viso - Research Assistant in Intelligent Automation at Cranfield University
E-mail: Mikel.Bueno-Viso@cranfield.ac.uk
LinkedIn: https://www.linkedin.com/in/mikel-bueno-viso/
Profile: https://www.cranfield.ac.uk/people/mikel-bueno-viso-32884399

Dr. Seemal Asif - Lecturer in Artificial Intelligence and Robotics at Cranfield University
E-mail: s.asif@cranfield.ac.uk
LinkedIn: https://www.linkedin.com/in/dr-seemal-asif-ceng-fhea-miet-9370515a/
Profile: https://www.cranfield.ac.uk/people/dr-seemal-asif-695915

Professor Phil Webb - Professor of Aero-Structure Design and Assembly at Cranfield University
E-mail: p.f.webb@cranfield.ac.uk
LinkedIn: https://www.linkedin.com/in/phil-webb-64283223/
Profile: https://www.cranfield.ac.uk/people/professor-phil-webb-746415

(back to top)

Acknowledgments

(back to top)