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

Create custom urdf file cannot execute in moveit #10

Open
XHao1997 opened this issue Oct 10, 2024 · 0 comments
Open

Create custom urdf file cannot execute in moveit #10

XHao1997 opened this issue Oct 10, 2024 · 0 comments

Comments

@XHao1997
Copy link

Hi,

I create a custom urdf for UR5 with a robotiq gripper according to your tutorial. But the arm saty still when I click execute in rviz, and after seconds it shows executed. Could you please provide more details on how to create the urdf and use it in moveit? I will appreciate it so much!

urdf.xacro file

<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- Include UR5 and Robotiq Gripper Macros -->
  <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>
  <xacro:include filename="$(find robotiq_description)/urdf/robotiq_2f_85_macro.urdf.xacro" />

  <!-- Macro for Robot Cell -->
  <xacro:macro name="my_robot_cell" params="
    parent
    *origin
    ur_type
    joint_limits_parameters_file
    kinematics_parameters_file
    physical_parameters_file
    visual_parameters_file
    ">

    <!-- Define the UR5 Robot -->
    <xacro:ur_robot
      name="${ur_type}"
      tf_prefix="${ur_type}_"
      parent="world"
      joint_limits_parameters_file="${joint_limits_parameters_file}"
      kinematics_parameters_file="${kinematics_parameters_file}"
      physical_parameters_file="${physical_parameters_file}"
      visual_parameters_file="${visual_parameters_file}"
    >
      <origin xyz="0 0 0" rpy="0 0 0" />
    </xacro:ur_robot>

    <!-- Attach the Robotiq Gripper to the UR5's tool0 -->
    <xacro:robotiq_gripper
      name="RobotiqGripperHardwareInterface"
      prefix=""
      parent="${ur_type}_tool0"
      use_fake_hardware="true"
    >
      <origin xyz="0 0 0" rpy="0 0 0" />
    </xacro:robotiq_gripper>

  </xacro:macro>

</robot>

macro.xacro file

<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- Include UR5 and Robotiq Gripper Macros -->
  <xacro:include filename="$(find ur_description)/urdf/ur_macro.xacro"/>
  <xacro:include filename="$(find robotiq_description)/urdf/robotiq_2f_85_macro.urdf.xacro" />

  <!-- Macro for Robot Cell -->
  <xacro:macro name="my_robot_cell" params="
    parent
    *origin
    ur_type
    joint_limits_parameters_file
    kinematics_parameters_file
    physical_parameters_file
    visual_parameters_file
    ">

    <!-- Define the UR5 Robot -->
    <xacro:ur_robot
      name="${ur_type}"
      tf_prefix="${ur_type}_"
      parent="world"
      joint_limits_parameters_file="${joint_limits_parameters_file}"
      kinematics_parameters_file="${kinematics_parameters_file}"
      physical_parameters_file="${physical_parameters_file}"
      visual_parameters_file="${visual_parameters_file}"
    >
      <origin xyz="0 0 0" rpy="0 0 0" />
    </xacro:ur_robot>

    <!-- Attach the Robotiq Gripper to the UR5's tool0 -->
    <xacro:robotiq_gripper
      name="RobotiqGripperHardwareInterface"
      prefix=""
      parent="${ur_type}_tool0"
      use_fake_hardware="true"
    >
      <origin xyz="0 0 0" rpy="0 0 0" />
    </xacro:robotiq_gripper>

  </xacro:macro>

</robot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant