gezp / universal_robot_ign

run universal robot in Ignition Gazebo simulator
MIT License
44 stars 9 forks source link
ignition ignition-gazebo moveit2 robotic-arm ros2 universal-robot ur

universal_robot_ign

universal_robot_ign : Run universal robot in Ignition Gazebo simulator .

It provides SDF models of universal robot for Ignition Gazebo. In addition, it also provides a moveit2 application demo and simple grasp demo with Gripper Robotiq140 .

Usage

Install

#install dependency
pip install xmacro
sudo apt-get install ros-galactic-moveit
export IGNITION_VERSION=fortress
#cd src of ros2 workspace and download source code
git clone https://github.com/gezp/sdformat_tools.git
git clone https://github.com/gezp/universal_robot_ign.git
#cd ros2 workspace and build
colcon build

UR10 moveit2 demo

launch Ignition Gazebo simulator for UR10

ros2 launch universal_robot_ign ur10_ign.launch.py 

launch moveit2 move_group action server for UR10.

ros2 launch universal_robot_ign ur10_moveit2_demo.launch.py 

run moveit2 client node, plan to goal

ros2 run universal_robot_ign test_pose_goal.py

the result:

UR10 + Robotiq140 Grasp demo

launch Ignition Gazebo simulator for UR10 + Robotiq140

ros2 launch universal_robot_ign ur10_robotiq140_ign.launch.py 

run gripper test node to grasp stick model by closing gripper

ros2 run universal_robot_ign test_gripper.py 
#1 : close gripper to grasp.
#0 : open gripper.

the result:

Models

the package contains some SDF models :

in addition, it also provides a combination model ur10_robotiq140 (resource/xmacro/ur10_robotiq140.sdf.xmacro), which is ur10 robotic arm attached robotiq140 gripper.

the sdf files of these models are written modularly by use xmacro which is a xml macro tool.

Controllers

UR Controller

Ignition Controller

PID parameter:

  • The PID parameter of Ignition joint position controller plugin is set roughly ,so the performance of control is not well, you can modify PID parameter by modifying SDF file of model.

ROS controller

Robotiq Ignition Controller

Ignition Plugin RobotiqController is created to control Robotiq Gripper(2 fingers gripper) .

Add plugin In SDF

<plugin filename="RobotiqController" name="ignition::gazebo::systems::RobotiqController">
    <gripper_name>gripper</gripper_name>
    <fixed>false</fixed>
    <vel_scale>1.0</vel_scale>
</plugin>    

RobotiqController can be modified to get parameters from SDF which can work for genenral 2 fingers gripper,however, it is trivial so that I have no plan to implement this function currently.

Create Node ros_ign_bridge to transfer Msg from ROS2 to Ignition

ros_ign_bridge = Node(package='ros_ign_bridge',executable='parameter_bridge',
    arguments=["/model/ur10/gripper@std_msgs/msg/Bool]ignition.msgs.Boolean"],
    remappings=[("/model/ur10/gripper","/gripper"),],
    output='screen'
)

Publish ROS2 msg

Slipping Problem

There is Gripper Slipping Problem on Gazebo-classic which need use plugin to add fixed joint between object and gripper when grasp.

Ignition Gazebo performs better than Gazebo-classic on the Grasp Task, but also exists some problem in some situations.

  • it can grasp box tightly In Ignition Gazebo
    • it performs better than Gazebo-classic.
  • it can't grasp sphere In Ignition Gazebo (RobotiqController is based on velocity control, not effort control)
    • Because the size of contact area is so small that the friction is not enough to hold grasped object, and property max_depth of contact is not implemented In Ignition Gazebo currently.
    • In this situation, a fixed joint is needed to fix object with gripper, you can modified SDF and set Tag fixed with ture.

Maintainer and License

Maintainer : Zhenpeng Ge, zhenpeng.ge@qq.com

universal_robot_ign is provided under MIT License.