This package implements ros2 hardware interface for the CRX family Fanuc robots.
NOTE: this current version is tested for ROS humble. In the branch rolling there is the latest version, always under development.
This assumes you have the EtherNet/IP Adapter Option loaded on the robot controller, otherwise, you will get connection refused error.
The communication between the external pc and the Fanuc controller happens by means of the Ethernet/IP protocol.
In particular, this package relies on the implementation provided in EIPScanner.
Please, download it from here, and follow the instructions here to install it.
NOTE: a previous version of this driver used a python driver for the Ethernet/IP communication. Please refer to the python-driver branch.
To install the current package just
$ cd <to-your-src>
$ git clone https://github.com/paolofrance/ros2_fanuc_interface
To use it with the ros2_control framework, additional Moveit! and description packages are required. Download the packages
$ git clone https://github.com/paolofrance/crx20_moveit_config
$ git clone https://github.com/paolofrance/crx_description
$ cd ..
$ colcon build --symlink-install
The Moveit! package is currently available for the crx-20ial robot only.
If some error appears, please check the Moveit! and ros2_control installation.
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ros-<distro>-moveit
$ sudo apt install ros-<distro>-moveit-planners-chomp
$ sudo apt install ros-<distro>-ros2-control
$ sudo apt install ros-<distro>-ros2-controllers
This package contains the implementation of the communication via Ethernet/IP between the remote PC and the Fanuc controller
This package contains the implementation of the communication via Remote Motion Interface (RMI) between the remote PC and the Fanuc controller
This package contains the implementation of several services that permit useful calls to TP programs and interaction with the Fanuc controller. Most of the services require TP programs to be written and running as Background Logics, that read Registers to start an action. More details will be added in future releases.
This package implements the Hardware Interface compliant with the Ros2 control framework. Allows for controlling the robot via Ethernet/IP and RMI.
To actually move the robot, an easy teach-pendant (TP) program is required. The current version of the driver does not include it, but will be included in future releases.
To use the DPM (Dynamic Path Modification) module provided by the Fanuc robots, it is necessary to configure 6 Group Inputs and map them to the DPM settings.
This section explains what this package allows at the current status
To use it open a terminal and do the following command:
$ ros2 launch ros2_fanuc_interface robot_bringup.launch.py robot_ip:=your.robot.ip.address
Available parameters are:
- "use_mock_hardware" [true/false]: if the real robot is controlled or a virtual one
- "controllers_file" ["file location"]: where the list of available ros2_controllers is
- "robot_ip" [int]: the IP of the actual robot
- "read_only" [true/false]: useful for recording a trajectory under manual guidance
- "use_rmi" [true/false]: allows to select the communication method. If true, RMI is used. Otherwise Ethernet/IP.
It is sometimes necessary to move the robot from the Teach Pendant, or via manual guidance, but still required to read the joint states (e,g,. Kinestetic teaching). This feature requires no programs running on the TP, and an additional parameter during launch. To use it open a terminal and do the following command:
$ ros2 launch ros2_fanuc_interface robot_bringup.launch.py robot_ip:=your.robot.ip.address read_only:=true
NOTE: with some version of the robot controller software we had some issues related to loss of communication. It is still unclear the reason.
To test this with mock components just add the "use_mock_hardware:=true" param to your launch command
$ ros2 launch ros2_fanuc_interface robot_bringup.launch.py use_mock_hardware:=true
It is also possible to control the robot allowing dynamic velocity scaling of the trajectory under execution. This feature is unrelated to this package but is a useful tool that can be used for example to dynamically scale the velocity according to the distance between human and robot.
To test the velocity scaling controller you have to download the scaled_fjt_controller.
If you want to test it along with the velocity scaler controller, open a terminal and
ros2 launch ros2_fanuc_interface robot_bringup.launch.py controllers_file:=scaled_velocity_controller.yaml
You should now see the "/speed_ovr" topic, where you can publish the desired velocity (as a percentage of the maximum velocity). See the documentation here.
This package allows the use of the Dynamic Path Modification (DPM) mode from Fanuc.
The DPM communication is implemented in a ROS node.
The DPM node subscribes a topic with message type std_msgs/msg/Int64MultiArray.msg. The message required is in the form [x, y, z,rx, ry, rz].
NOTE: The values are integers because the DPM allows integers only as inputs.
In the proposed case, the integers are mapped as 0.01 mm, and a conversion factor is implemented on the robot controller side. See the DPM manual for more info.
To run the node
ros2 launch ros2_fanuc_interface dpm_example.launch.py
Then the DPM can be activated via a service std_srvs/SetBool.srv
To activate the dpm, after running the node
ros2 service call /activate_dpm std_srvs/srv/SetBool {"data: true"}
To move the robot from command line
ros2 topic pub /dpm_move std_msgs/msg/Int64MultiArray {"data:[-10,0,0,0,0,0]"}
This command will move the robot in negative x direction.
to stop the DPM
ros2 service call /activate_dpm std_srvs/srv/SetBool {"data: false"}
In the dpm_params.yaml it is possible to set some parameters.
NOTE: The DPM is not directly integrated into the Ros2 control framework since it requires Cartesian relative commands. If you want to contribute, please let us know.
- execution delay of about 0.2 seconds with Ethernet/IP - reduced compared to the previous version with python
- execution/feedback delay of about 0.6 seconds with RMI - To be tested
list of known todos and desiderata:
- integration of the Fanuc DPM into the ros control framework
Hardware Interface & Ethernet/IP driver: [email protected]
RMI driver: [email protected]
TP fanuc and services: [email protected], [email protected]
Tester and user: [email protected]
This package is developed by the ARM (Automation Robotics and Machines Laboratory) at SUPSI, Lugano, CH.
This package also uses components developed by CNR-SIIMA, Lecco.
The EU project Fluently partially funded the development of this package.