Skip to content

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

License

Notifications You must be signed in to change notification settings

IFRA-Cranfield/ros2_RobotSimulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


header

ROS2.0 ROBOT SIMULATION

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

Table of Contents
  1. About
  2. Getting Started
  3. Supported Robots
  4. Usage
  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 Structures, Assembly and Intelligent Automation 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 implementation of IIoT and the use of computer numerical control equipment enable interconnectivity and the exchange of data across the shop floor, and the interconnected shop floor enables the automation of work machines to support FMS. In a nutshell, Automated Industrial Processes bring agility to production cycles and enable shop floor equipment to pivot facility operations when dealing with changing demand cycles.

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 20.04 machine with ROS2.0 Foxy. Please find below all the required steps to set-up a ROS2.0 Foxy environment in Ubuntu and install the Robot Simulation packages.

ROS2.0 Foxy Environment Set-Up

  1. Install Ubuntu 20.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 Foxy:
    • Follow instructions in: ROS2 Foxy Tutorials - Installation
    • Source the ROS2.0 Foxy installation in the .bashrc file (hidden file in /home):
      source opt/ros/foxy/setup.bash
  4. Install MoveIt!2 for ROS2 Foxy:
  5. Create and onfigure the ROS2.0 Foxy ~/dev_ws environment/workspace:
  6. Install some additional (but required) packages:
    • rqt:
      sudo apt install ~nros-foxy-rqt*
    • rosdep:
      sudo apt-get install python3-rosdep
    • colcon:
      sudo apt install python3-colcon-common-extensions
    • vcstool:
      sudo apt install python3-vcstool
  7. Create the ~/dev_ws/src/ros2setup folder for all packages required for Robot Simulation and Control in ROS2.
    mkdir -p ~/dev_ws/src/ros2setup
  8. Install ROS2-Control:
    • Import and install some required packages using git:
      cd ~/dev_ws/src/ros2setup
      git clone https://github.com/ros-controls/realtime_tools.git -b foxy-devel
      git clone https://github.com/ros2/rcl_interfaces.git -b foxy # Copy test_msgs folder, paste it onto /ros2setup folder and remove rcl_interfaces folder.
      git clone https://github.com/ros2/test_interface_files.git -b foxy
      cd ~/dev_ws
      colcon build
    • Import and install ros2_control repository:
      cd ~/dev_ws/src/ros2setup
      git clone https://github.com/ros-controls/ros2_control.git -b foxy
      cd ~/dev_ws
      colcon build
  9. Install ROS2-Controllers:
    • Import and install some required packages using git:
      cd ~/dev_ws/src/ros2setup
      git clone https://github.com/ros-controls/control_toolbox.git -b ros2-master
      cd ~/dev_ws
      colcon build
    • Import and install ros2_controllers repository:
      cd ~/dev_ws/src/ros2setup
      git clone https://github.com/ros-controls/ros2_controllers.git -b foxy 
      cd ~/dev_ws
      colcon build
  10. Install Gazebo Simulator for ROS2 Foxy:
    • Install Gazebo-11 Simulator:
      sudo apt install gazebo11
    • Install gazebo-ros-pkgs for ROS2 Foxy:
      sudo apt install ros-foxy-gazebo-ros-pkgs
    • Import and install Gazebo-ROS2-Control:
      cd ~/dev_ws/src/ros2setup
      git clone https://github.com/ros-controls/gazebo_ros2_control.git -b foxy
      cd ~/dev_ws
      colcon build

Move Group Interface

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:

Installation

cd ~/dev_ws/src
git clone https://github.com/IFRA-Cranfield/ros2_RobotSimulation.git 
cd ~/dev_ws/
colcon build

(back to top)

Supported Robots

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

(back to top)

Usage

Execute Robot Simulation

  • Panda Robot:
    ros2 launch panda_ros2_gazebo panda_simulation.launch.py
  • ABB IRB-120:
    ros2 launch irb120_ros2_gazebo irb120_simulation.launch.py
  • ABB IRB-120 + Schunk EGP-64:
    ros2 launch irb120egp64_ros2_gazebo irb120egp64_simulation.launch.py
  • ABB IRB-1200:
    ros2 launch irb1200_ros2_gazebo irb1200_simulation.launch.py
  • ABB IRB-6640:
    ros2 launch irb6640_ros2_gazebo irb6640_simulation.launch.py
  • UR3:
    ros2 launch ur3_ros2_gazebo ur3_simulation.launch.py
  • UR5:
    ros2 launch ur5_ros2_gazebo ur5_simulation.launch.py
  • UR10:
    ros2 launch ur10_ros2_gazebo ur10_simulation.launch.py
  • Fanuc CR35-iA:
    ros2 launch cr35ia_ros2_gazebo cr35ia_simulation.launch.py
  • Kuka LBR-IIWA:
    ros2 launch iiwa_ros2_gazebo iiwa_simulation.launch.py

Execute Robot Simulation w/ MoveIt!2

  • Panda Robot:
    ros2 launch panda_ros2_moveit2 panda.launch.py
  • ABB IRB-120:
    ros2 launch irb120_ros2_moveit2 irb120.launch.py
  • ABB IRB-120 + Schunk EGP-64:
    ros2 launch irb120egp64_ros2_moveit2 irb120egp64.launch.py
  • ABB IRB-1200:
    ros2 launch irb1200_ros2_moveit2 irb1200.launch.py
  • ABB IRB-6640:
    ros2 launch irb6640_ros2_moveit2 irb6640.launch.py
  • UR3:
    ros2 launch ur3_ros2_moveit2 ur3.launch.py
  • UR5:
    ros2 launch ur5_ros2_moveit2 ur5.launch.py
  • UR10:
    ros2 launch ur10_ros2_moveit2 ur10.launch.py
  • Fanuc CR35-iA:
    ros2 launch cr35ia_ros2_moveit2 cr35ia.launch.py
  • Kuka LBR-IIWA:
    ros2 launch iiwa_ros2_moveit2 iiwa.launch.py

Execute Robot Simulation w/ MoveIt!2 and Robot/Gripper Triggers (Action Servers)

  • Panda Robot:
    ros2 launch panda_ros2_moveit2 panda_interface.launch.py
  • ABB IRB-120:
    ros2 launch irb120_ros2_moveit2 irb120_interface.launch.py
  • ABB IRB-120 + Schunk EGP-64:
    ros2 launch irb120egp64_ros2_moveit2 irb120egp64_interface.launch.py
  • ABB IRB-1200:
    ros2 launch irb1200_ros2_moveit2 irb1200_interface.launch.py
  • ABB IRB-6640:
    ros2 launch irb6640_ros2_moveit2 irb6640_interface.launch.py
  • UR3:
    ros2 launch ur3_ros2_moveit2 ur3_interface.launch.py
  • UR5:
    ros2 launch ur5_ros2_moveit2 ur5_interface.launch.py
  • UR10:
    ros2 launch ur10_ros2_moveit2 ur10_interface.launch.py
  • Fanuc CR35-iA:
    ros2 launch cr35ia_ros2_moveit2 cr35ia_interface.launch.py
  • Kuka LBR-IIWA:
    ros2 launch iiwa_ros2_moveit2 iiwa_interface.launch.py

Robot/Gripper Triggers: ROS2.0 Action Calls

The list below contains all different Robot/Gripper Triggers that have been implemented in this repository, and how these are executed by making different ROS2.0 Action Calls from a terminal shell:

  • MoveJ: The Robot moves to the specific waypoint, which is specified by Joint Pose values.

    ros2 action send_goal -f /MoveJ ros2_data/action/MoveJ "{goal: {joint1: 0.00, joint2: 0.00, joint3: 0.00, joint4: 0.00, joint5: 0.00, joint6: 0.00}}" # (6-DOF)
    ros2 action send_goal -f /MoveJs ros2_data/action/MoveJs "{goal: {joint1: 0.00, joint2: 0.00, joint3: 0.00, joint4: 0.00, joint5: 0.00, joint6: 0.00, joint7: 0.00}}" # For Panda and Kuka LBR-IIWA Robots. (7-DOF)
  • MoveG: The Gripper fingers move to the specific pose.

    ros2 action send_goal -f /MoveG ros2_data/action/MoveG "{goal: 0.00}"
  • MoveL: The Robot executes a CARTESIAN/LINEAR path. The End-Effector orientation is kept constant, and the position changes by +-(x,y,z).

    ros2 action send_goal -f /MoveL ros2_data/action/MoveL "{movex: 0.00, movey: 0.00, movez: 0.00}"
  • MoveR: The Robot rotates the selected joint a specific amount of degrees.

    ros2 action send_goal -f /MoveR ros2_data/action/MoveR "{joint: '---', value: 0.00}"
  • MoveXYZW: The Robot moves to the specific waypoint, which is represented by the Position(x,y,z) + EulerAngles(yaw,pitch,roll) End-Effector coordinates.

    ros2 action send_goal -f /MoveXYZW ros2_data/action/MoveXYZW "{positionx: 0.00, positiony: 0.00, positionz: 0.00, yaw: 0.00, pitch: 0.00, roll: 0.00}"
  • MoveXYZ: The Robot moves to the specific waypoint -> Position(x,y,z) maintaining the End-Effector orientation.

    ros2 action send_goal -f /MoveXYZ ros2_data/action/MoveXYZ "{positionx: 0.00, positiony: 0.00, positionz: 0.00}"
  • MoveYPR: The Robot rotates/orientates the End-Effector frame according to the input: EulerAngles(yaw,pitch,roll). The YPR(yaw,pitch,roll)determines the FINAL ROTATION of the End-Effector, which is related to the GLOBAL COORDINATE FRAME.

    ros2 action send_goal -f /MoveYPR ros2_data/action/MoveYPR "{yaw: 0.00, pitch: 0.00, roll: 0.00}"
  • MoveROT: The Robot rotates/orientates the End-Effector frame according to the input: EulerAngles(yaw,pitch,roll). THE ROT(yaw,pitch,roll) determines the ADDED ROTATION of the End-Effector, which is applied to the END-EFFECTOR COORDINATE FRAME.

    ros2 action send_goal -f /MoveROT ros2_data/action/MoveROT "{yaw: 0.00, pitch: 0.00, roll: 0.00}"
  • MoveRP: End-Effector rotation AROUND A POINT -> The Robot rotates/orientates + moves the End-Effector frame according to the input: EulerAngles(yaw,pitch,roll) + Point(x,y,z). THE ROT(yaw,pitch,roll) determines the ADDED ROTATION of the End-Effector, which is applied to the END-EFFECTOR COORDINATE FRAME, AROUND THE (x,y,z) POINT.

    ros2 action send_goal -f /MoveRP ros2_data/action/MoveRP "{yaw: 0.00, pitch: 0.00, roll: 0.00, x: 0.0, y: 0.0, z: 0.0}"
    ``
    
  • NOTE: For the (Yaw - Pitch - Roll) Euler Angles rotation, the following coordinate system has been used as the reference frame for the rotations. In fact, all YPR action calls rotate the robot end-effector to the orientation specified by the (input) Euler Angles, relative to the reference frame.

Example: ABB IRB120 + Schunk EGP64

https://user-images.githubusercontent.com/98389310/176437077-6e583a0f-50e6-4e00-ae09-56e233f976f5.mp4

(back to top)

Contributing

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, 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 again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Intelligent Flexible Robotics and Assembly Group
Created on behalf of the IFRA Group at Cranfield University, United Kingdom
E-mail: [email protected]

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

Cranfield University
School of Aerospace, Transport and Manufacturing
Centre for Structures, Assembly and Intelligent Automation
College Road, Cranfield
MK43 0AL, 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: [email protected]
LinkedIn: https://www.linkedin.com/in/mikel-bueno-viso/

Dr. Seemal Asif - Lecturer in Artificial Intelligence and Robotics at Cranfield University
E-mail: [email protected]
LinkedIn: https://www.linkedin.com/in/dr-seemal-asif-ceng-fhea-miet-9370515a/

Professor Phil Webb - Professor of Aero-Structure Design and Assembly at Cranfield University
E-mail: [email protected]
LinkedIn: https://www.linkedin.com/in/phil-webb-64283223/

(back to top)

Acknowledgments

(back to top)