ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Connecting working Rviz/Moveit setup with Sim custom arm

asked 2020-05-08 05:32:10 -0600

matthewmarkey gravatar image

updated 2020-05-08 05:34:58 -0600

Hey friends,

I have a custom 4DOF arm I have whipped up and have been slogging through the tutorials but I feel like I am getting turned around easily now.

I am running Kinetic on Ubuntu 16.04 and have my Rviz and Moveit! setup working nicely. It can take plans and execute them as well as work quite nicely with my move group python interface. I have used the MSA to setup my Moveit files, and now would like to simulate my movements in gazebo and eventually tie in the custom arm.

My issue pops up when trying to run the files that were created by the MSA. Running demo_gazebo.launch from /arm_moveit_config yields this error:

[ERROR] [1588933219.280616367]: Failed to build tree: child link [base_link] of joint [dummy_joint] not found
[ERROR] [1588933219.518289973]: Failed to build tree: child link [base_link] of joint [dummy_joint] not found
[ERROR] [1588933219.520045115]: Unable to parse URDF from parameter '/robot_description'
[robot_state_publisher-7] process has died [pid 17994, exit code 255, cmd /opt/ros/kinetic/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/homefolder/.ros/log/83c0a11e-9115-11ea-ad2a-001c429fcd02/robot_state_publisher-7.log].
log file: /home/homefolder/.ros/log/83c0a11e-9115-11ea-ad2a-001c429fcd02/robot_state_publisher-7*.log
[robot_state_publisher-7] restarting process
process[robot_state_publisher-7]: started with pid [18108]

Which continues to repeat until the program is killed. The Rviz and Gazebo windows pop up, but the model does not appear and they both show signs of error. After killing the program, there is also a warning that pops up before it dies:

Which I am unsure is a contributing factor to the first errors, or a product of them.

I have included my arm.xacro file below as well the launch file I am attempting to call.

Any suggestions or help is greatly appreciated.

m

arm.xacro

<?xml version="1.0"?>

<robot name="arm" xmlns:xacro="http://www.ros.org/wiki/xacro">

   <xacro:include filename="$(find version1_desc)/urdf/links_joints.xacro" />
   <xacro:include filename="$(find version1_desc)/urdf/arm.gazebo" />
   <create/>
   <gazebo>
     <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
       <robotNamespace>/arm</robotNamespace>
     </plugin>
   </gazebo>

<!--Dummy Link-->
    <link name="dummy_link"/>

<!-- Dummy End Effector -->
    <joint name="dummy_joint" type="fixed">
        <parent link="dummy_link"/>
        <child link="base_link"/>
      </joint>

<!--Base Link-->

    <m_link_mesh_c name = "base_link"
                     origin_rpy = "0 0 0" origin_xyz = "0 0 0" mass = "1.0"
                     meshfile = "package://version1_desc/meshes/base_link.dae"
                     meshscale  = "1 1 1"
                     ixx = "0.00153508333333" ixy = "0" ixz = "0" iyz = "0"
                     iyy = "0.00153508333333"
                     izz = "0.00245"
                     radius = "0.07" length= "0.061"/>

<!--Plat Joint-->

    <joint name="plat_joint" type="revolute">
        <parent link="base_link"/>
        <child link="plat_link"/>
        <origin rpy="0 0 0" xyz="0 0 0.0305"/>
        <limit lower="-1.5" upper="1.5" effort="1000" velocity="0.5"/>
        <axis xyz="0 0 1"/>
    </joint>

    <transmission name = "trans_plat">
        <type> transmission_interface/SimpleTransmission</type>
        <joint name= "plat_joint">
            <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
        </joint>
        <actuator name = "motor_plat">
            <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
            <mechanicalReduction>1</mechanicalReduction>
        </actuator>
    </transmission>

< ...
(more)
edit retag flag offensive close merge delete

Comments

I haven't checked your complete URDF, but it's very likely the changes the MSA did to make it "Gazebo compatible" are not complete/entirely correct.

I would suggest to post an issue about this on the MoveIt issue tracker as it should work.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-08 06:01:03 -0600 )edit

Thank you sir I will do that.

matthewmarkey gravatar image matthewmarkey  ( 2020-05-08 06:02:55 -0600 )edit

I just wanted to add that I was building the Moveit! package from the arm.xacro file itself. I have a feeling that this may be what is causing some issues with gazebo. I actually used the function in the MSA to create a new "gazebo ready" URDF file for the original arm.xacro file and saved it to my URDF directory. I then used that URDF instead of the .xacro to build a new Moveit! package...

The MSA would make a demo_gazebo.launch with this line:

<!-- By default, use the urdf location provided from the package -->
  <arg name="urdf_path" default="$(find version1_desc)/urdf/arm1.urdf"/>

instead of this one

 <!-- By default, use the urdf location provided from the package -->
      <arg name="urdf_path" default="$(find version1_desc)/urdf/arm.xacro"/>

I was able to get the model to spawn into gazebo.

Is this an appropriate ...(more)

matthewmarkey gravatar image matthewmarkey  ( 2020-05-08 07:21:22 -0600 )edit
1

If I understand you correctly, the URDF is the one the MSA makes for you. It includes a nr of changes which are needed for Gazebo.

If your .xacro already contains those changes, then it would work of course.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-08 07:41:39 -0600 )edit

Ok thank you again for the prompt reply.

matthewmarkey gravatar image matthewmarkey  ( 2020-05-08 07:45:03 -0600 )edit

Since you posted a follow-up question it seems like this problem is solved. Please summarize the solution and post it as an answer so others can benefit from it.

fvd gravatar image fvd  ( 2020-05-13 02:17:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-13 04:37:31 -0600

matthewmarkey gravatar image

My urdf was not in the correct form. Modifying my previous work with correct <gazebo> tags ended up being the solution.

I was initially missing my <gazebo reference="xxx_link"/> tags as well as any associated <dampingfactor> tags (which I ended up needing to add later when my model was falling down due to gravity).

The URDF can be seen below as an example of what worked for me:

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from arm.xacro                      | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="arm" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!--Joints-->
  <!--Cylinder-->
  <!--Rectangular  Prism-->
  <!--Cylinder Mesh-->
  <!--Box Mesh-->
  <!-- ros_control plugin -->

  <!-- base_link -->
  <gazebo reference="base_link">
  </gazebo>
  <!-- plat_link -->
  <gazebo reference="plat_link">
    <dampingFactor>1</dampingFactor>
  </gazebo>
  <!-- lock_link -->
  <gazebo reference="lock_link">
    <dampingFactor>1</dampingFactor>
  </gazebo>
  <!-- shoulder_link -->
  <gazebo reference="shoulder_link">
    <dampingFactor>1</dampingFactor>
  </gazebo>
  <!-- forearm_link -->
  <gazebo reference="forearm_link">
    <dampingFactor>1</dampingFactor>
  </gazebo>
  <!-- wrist_link -->
  <gazebo reference="wrist_link">
    <dampingFactor>1</dampingFactor>
  </gazebo>
  <create/>
  <gazebo>
    <plugin filename="libgazebo_ros_control.so" name="gazebo_ros_control">
      <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
      <legacyModeNS>true</legacyModeNS>
    </plugin>
  </gazebo>


  <link name="dummy_link"/>
  <!-- Dummy End Effector -->
  <joint name="dummy_joint" type="fixed">
    <parent link="dummy_link"/>
    <child link="base_link"/>
  </joint>
  <!--Base Link-->
  <link name="base_link">
    <inertial>
      <mass value="1.0"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia ixx="0.00153508333333" ixy="0" ixz="0" iyy="0.00153508333333" iyz="0" izz="0.00245"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <cylinder length="0.061" radius="0.07"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://version1_desc/meshes/base_link.dae" scale="1 1 1"/>
      </geometry>
      <material name="light_black"/>
    </visual>
  </link>
  <!--Plat Joint-->
  <joint name="plat_joint" type="revolute">
    <parent link="base_link"/>
    <child link="plat_link"/>
    <origin rpy="0 0 0" xyz="0 0 0.0305"/>
    <limit effort="10" lower="-1.5" upper="1.5" velocity="0.5"/>
    <axis xyz="0 0 1"/>
  </joint>
  <transmission name="trans_plat">
    <type> transmission_interface/SimpleTransmission</type>
    <joint name="plat_joint">
      <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor_plat">
      <hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>
  <!--Plat Link-->
  <link name="plat_link">
    <inertial>
      <mass value="0.072"/>
      <origin rpy="0 0 0" xyz="0 0 0.004"/>
      <inertia ixx="6.5184e-05" ixy="0" ixz="0" iyy="6.5184e-05" iyz="0" izz="0.0001296"/>
    </inertial>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0.004"/>
      <geometry>
        <cylinder length="0.008" radius="0.06"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0.004"/>
      <geometry>
        <mesh filename="package ...
(more)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-05-08 05:32:10 -0600

Seen: 192 times

Last updated: May 13 '20