YaskawaEurope / ros2-starter-for-yaskawa-robots

6 stars 0 forks source link

Introduction

This repository specifies the process of configuring the Moveit path planner for the YASKAWA robot GP-8 (or others in the same family) in the context of trajectory generation.

The repository offers files (Python, C++) to move robots based on the trajectory specified inside the program.

The ros2-starter-for-yaskawa-robots includes all the files needed to move the GP-8 robot using MotoROS2.

The repository can be considered as a template for the other robots. In that case the changes for the robot configuration and name have to be applied.

The repository first explains how to configure the robot for the simulation. The other part includes information on how to run a robot using the MotoROS2 interface.

The repository includes files that were verified for ROS2 Humble.

The ROS 2 interface (MotoROS2) to the Yaskawa robot controller can be found here. The instructions have to be followed accordingly in order to configure the Yaskawa Robot Controller and agent (micro-ros) Docker container to facilitate traffic to Robot controller.

As mentioned, the repository and the following information have been produced to run GP-8 robot, however, all the steps are the same for other Yaskawa robots.

The complete process of preparing configuration files and motion applications is depicted below,

image

The MotoPlus application (MotoROS2 interface) can be downloaded from:

Consider Quick Start paragraph to move robot at once. But you need to follow mandatory steps described here robot configuration . Generally you need to configure Robot Controller and upload MotoPlus application (MotoROS2 interface).

Technical background

An ROS 2 application (also known as an ROS 2 node) communicates with the Yaskawa Robot Controller (RC) through the MotoROS2 interface. To make this possible, we run a ROS 2 node (whose name is specified in a motoros2_config.yaml file) on the RC. The ROS 2 node is deployed to the RC as a MotoPlus application. This MotoPlus application (ROS 2 node) helps transfer data between ROS 2 and the RC. The specific configuration details are shown below.

image

The example of robot application can be configured as follows,

image

It is worth mentioning that MotoROS2 provides two different motion modes:

image

Content

The ros2-starter-for-yaskawa-robots is a ROS2 workspace and includes packages as follows,

Notes

Note 1

For simplicity, the original joint names have been changed as follows: From:

[joint_1_s, joint_2_l, joint_3_u, joint_4_r, joint_5_b, joint_6_t]

To:

[joint_1, joint_2, joint_3, joint_4, joint_5, joint_6]

Note 2

In motoros2_config.yaml to run robot from ROS 2 we have to change (changes reflect current configuration in colcon_picknik_ws) mostly:

agent_ip_address: 192.168.255.10
agent_port_number: 8888
node_name: motoman_ros2
node_namespace: "yaskawa"
joint_names:
  - [joint_1, joint_2, joint_3,
     joint_4, joint_5, joint_6]
joint_states: default

In this case the agent (Host PC) is configured as follows,

image

Note 3

Check if in each terminal you call ROS, you source ROS 2 (e.g for running colcon build)

source /opt/ros/humble/setup.bash

After you run colcon build you have to source

source install/setup.bash

Quick-Start robot motion

The process of moving the robot is as follows (it can be simplified as one call, but for the debugging process, we keep these steps separate):

git clone https://github.com/yeu-buchholz/ros2-starter-for-yaskawa-robots.git
cd ros2-starter-for-yaskawa-robots
colcon build
source /install/setup.bash

Launch micro-ros agent

ros2 launch moveit_resources_moto_moveit_config  yaskawa_hw.launch.py

or

sudo docker run -it --rm --net=host microros/micro-ros-agent:humble udp4 --port 8888

Enable Yaskawa drives:

ros2 run cpp_pubsub enable_client

start RViz

ros2 launch moveit_resources_moto_moveit_config  xy_start.launch.py 

or

ros2 run hello_moveit joint_hello_moveit

or

ros2 run gp8_interface move_on_traj

Disable Yaskawa drives:

ros2 run cpp_pubsub disable_client

Robot configuration

Follow https://github.com/yaskawa-global/motoros2_interfaces to configure MotoROS2 gp8_interface

Now we will configure the GP-8 robot using Moveit Setup Assistant,

First, we convert .xacro to .urdf for the robot specific.

Run following commands, folder test_ws is only temporary folder,

mkdir -p test_ws/src
cd test_ws/src
git clone https://github.com/gavanderhoorn/motoman/tree/kinetic-devel/motoman_gp8_support
git checkout ros2
cd ../..
source /opt/ros/humble/setup.bash
colcon build
source install/setup.bash
cd test_ws/src/motoman/motoman_gp8_support/urdf
xacro gp8.xacro > moto.urdf

In current folder run,

ros2 launch moveit_setup_assistant setup_assistant.launch.py 

For a completely new robot configuration, choose Create New Moveit and choose moto.urdf, as on the image below,

image

Follow the steps described here,

Assistant creates pkg with .launch files. We do not use them in the current process. We are going to use .launch files to run only simulation (in rViz) or run robot (in rViz) and command instruction to real robot GP-8.

The ros2-starter-for-yaskawa-robotsincludes all necessary files.

Run robot simulation

run following commands,

cd ros2-starter-for-yaskawa-robots
colcon build
source install/setup.bash
ros2 launch moveit_resources_moto_moveit_config sim_start.launch.py

from other terminal move robots,

cd ros2-starter-for-yaskawa-robots
source install/setup.bash
ros2 run hello_moveit sim_hello_moveit

The image below shows the expected results, image

Move robot from ROS 2

There are two options to run the robot. Option 1, we build trajectory in Python or C++. Option 2, the robot path can be generated by path-planner, here we use Moveit.

In options 1 and 2, start to micro-ros (communication with Yaskawa Robot Controller)

sudo docker run -it --rm --net=host microros/micro-ros-agent:humble udp4 --port 8888

For option 1

In other terminal, you need to enable drives,

ros2 run cpp_pubsub enable_client

Confirm drive enable (green light)

Run in other terminal C++ programs,

ros2 run cpp_pubsub client_traj

or Python program,

ros2 run gp8_interface move_on_traj

disable drives,

ros2 run cpp_pubsub disable_client

For option 2

On terminal run RViz,

run2 ros2 launch moveit_resources_moto_moveit_config xy_start.launch.py

In other terminal, you need to enable drives,

ros2 run cpp_pubsub enable_client

Confirm drive enable (green light)

Run C++ program (Moveit calculates the robot path, which is sent to the Robot Controller).

ros2 run hello_moveit hello_moveit

or

ros2 run hello_moveit joint_hello_moveit

or

ros2 run hello_moveit hello_obstacle