Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model simulation in Gazebo9 #2

Open
bglima opened this issue Apr 21, 2019 · 5 comments
Open

Model simulation in Gazebo9 #2

bglima opened this issue Apr 21, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@bglima
Copy link

bglima commented Apr 21, 2019

Hi! Would it be possible to show an example of how to spawn your models in Gazebo 9? Like a robotiq_2f_85_gripper_simulation package, for instance.

@Danfoa
Copy link
Owner

Danfoa commented May 4, 2019

Hi @bglima, currently we are not using gazebo simulation, and thus this functionality is not yet supported. The Gazebo tutorials have information on how to add the necessary parameters to the URDF for it to be used in Gazebo.

@Danfoa Danfoa added the enhancement New feature or request label May 15, 2019
@minhkhang1795
Copy link

minhkhang1795 commented Nov 21, 2019

@bglima I'm working on ROS kinetic and Gazebo 9 for the 2f_140 gripper. Currently, the urdf version for this gripper has some issues with the mimic joints in Gazebo so you need to take some steps to make it work with Gazebo.

  1. Fix the joint limits issue: Fixed limits of the passive joints of the 2f_140 ros-industrial/robotiq#119 (comment). (@Danfoa: This is a known issue that has been fixed in the official robotiq repo. I can help make a pull request for this to your repository if you want.)

  2. Install this ROS package roboticsgroup_gazebo_plugins, which is a plugin that enables the ability to add the mimic joint functionality that exists in URDF to Gazebo.

  3. Create a xacro file like this in the robotiq_2f_140_gripper_visualization/urdf folder (you can name the file anything you want, but I named it robotiq_arg2f.gazebo.xacro):

<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro">
    <xacro:macro name="robotiq_arg2f_gazebo" params="prefix">
        <gazebo>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_1">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}right_outer_knuckle_joint</mimicJoint>
                <multiplier>-1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_2">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}left_inner_knuckle_joint</mimicJoint>
                <multiplier>-1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_3">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}right_inner_knuckle_joint</mimicJoint>
                <multiplier>-1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_4">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}left_inner_finger_joint</mimicJoint>
                <multiplier>1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_5">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}right_inner_finger_joint</mimicJoint>
                <multiplier>1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
        </gazebo>
    </xacro:macro>
</robot>
  1. Then, in robotiq_arg2f_140_model_macro.xacro, import the xacro file you just created and
    add <xacro:robotiq_arg2f_gazebo prefix="${prefix}"/> to the very last line as follows:
<!-- Import the xacro file -->
<xacro:include filename="$(find robotiq_2f_140_gripper_visualization)/urdf/robotiq_arg2f.gazebo.xacro" />

<!-- Use it in the last xacro block -->
<xacro:macro name="robotiq_arg2f_140" params="prefix">
    <xacro:robotiq_arg2f_base_link prefix="${prefix}"/>
    <xacro:finger_links prefix="${prefix}" fingerprefix="left" stroke="140"/>
    <xacro:finger_links prefix="${prefix}" fingerprefix="right" stroke="140"/>
    <xacro:finger_joint prefix="${prefix}"/>
    <xacro:right_outer_knuckle_joint prefix="${prefix}"/>
    <xacro:robotiq_arg2f_transmission prefix="${prefix}"/>
    <xacro:robotiq_arg2f_gazebo prefix="${prefix}"/>
</xacro:macro>

Here is our urdf folder we're using to work with Gazebo 9: https://github.com/olinrobotics/robotiq_2finger_grippers/tree/xamyab/robotiq_2f_140_gripper_visualization/urdf

Here is the result:
Gripper

@rcao-hk
Copy link

rcao-hk commented Dec 2, 2019

@bglima I'm working on ROS kinetic and Gazebo 9 for the 2f_140 gripper. Currently, the urdf version for this gripper has some issues with the mimic joints in Gazebo so you need to take some steps to make it work with Gazebo.

1. Fix the joint limits issue: [ros-industrial/robotiq#119 (comment)](https://github.com/ros-industrial/robotiq/pull/119#event-2449247301). (@Danfoa: This is [a known issue](https://github.com/ros-industrial/robotiq/issues/150) that has been fixed in the official robotiq repo. I can help make a pull request for this to your repository if you want.)

2. Install this ROS package [roboticsgroup_gazebo_plugins](https://github.com/olinrobotics/universal_robot/tree/hiro-xamyab/roboticsgroup_gazebo_plugins), which is a plugin that enables the ability to add the mimic joint functionality that exists in URDF to Gazebo.

3. Create a xacro file like this in the `robotiq_2f_140_gripper_visualization/urdf` folder (you can name the file anything you want, but I named it `robotiq_arg2f.gazebo.xacro`):
<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro">
    <xacro:macro name="robotiq_arg2f_gazebo" params="prefix">
        <gazebo>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_1">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}right_outer_knuckle_joint</mimicJoint>
                <multiplier>-1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_2">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}left_inner_knuckle_joint</mimicJoint>
                <multiplier>-1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_3">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}right_inner_knuckle_joint</mimicJoint>
                <multiplier>-1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_4">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}left_inner_finger_joint</mimicJoint>
                <multiplier>1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
            <plugin filename="libroboticsgroup_gazebo_mimic_joint_plugin.so" name="${prefix}mimic_robotiq_140_5">
                <joint>${prefix}finger_joint</joint>
                <mimicJoint>${prefix}right_inner_finger_joint</mimicJoint>
                <multiplier>1.0</multiplier>
                <offset>0.0</offset>
            </plugin>
        </gazebo>
    </xacro:macro>
</robot>
1. Then, in `robotiq_arg2f_140_model_macro.xacro`, import the xacro file you just created and
   add `<xacro:robotiq_arg2f_gazebo prefix="${prefix}"/>` to the very last line as follows:
<!-- Import the xacro file -->
<xacro:include filename="$(find robotiq_2f_140_gripper_visualization)/urdf/robotiq_arg2f.gazebo.xacro" />

<!-- Use it in the last xacro block -->
<xacro:macro name="robotiq_arg2f_140" params="prefix">
    <xacro:robotiq_arg2f_base_link prefix="${prefix}"/>
    <xacro:finger_links prefix="${prefix}" fingerprefix="left" stroke="140"/>
    <xacro:finger_links prefix="${prefix}" fingerprefix="right" stroke="140"/>
    <xacro:finger_joint prefix="${prefix}"/>
    <xacro:right_outer_knuckle_joint prefix="${prefix}"/>
    <xacro:robotiq_arg2f_transmission prefix="${prefix}"/>
    <xacro:robotiq_arg2f_gazebo prefix="${prefix}"/>
</xacro:macro>

Here is our urdf folder we're using to work with Gazebo 9: https://github.com/olinrobotics/robotiq_2finger_grippers/tree/xamyab/robotiq_2f_140_gripper_visualization/urdf

Here is the result:
Gripper

Hi, I am working on the dual arm system's simulation based on Gazebo. The model you built looks so cool. Would you like to share your model in the future?

@minhkhang1795
Copy link

@63445538 Here is our model: https://github.com/olinrobotics/HIRo/wiki/MoveIt!-for-Xamyab

@Danfoa
Copy link
Owner

Danfoa commented Jan 16, 2020

@minhkhang1795 Please feel free to create the pull request, any improvement to the repository is more than welcomed. I will test and monitor this enhancement as soon as I have some time.

Thank you for the support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants