code-iai / iai_robots

Repo holding descriptions and launch-files for robots in the iai lab.
9 stars 33 forks source link

Problem with .stl's and MoveIt! #17

Closed ichumuh closed 8 years ago

ichumuh commented 8 years ago

I tried to create a MoveIt! config package for boxy with the moveit_setup_assistant. When i loaded boxy_description.urdf.xacro the program crashed with the following error message:

*** Error in
`/opt/ros/indigo/lib/moveit_setup_assistant/moveit_setup_assistant':
malloc(): memory corruption: 0x00000000031a5a70 ***
================================================================================REQUIRED
process [moveit_setup_assistant-2] has died!
process has died [pid 22737, exit code -6, cmd
/opt/ros/indigo/lib/moveit_setup_assistant/moveit_setup_assistant
__name:=moveit_setup_assistant
__log:=/home/ichumuh/.ros/log/377795c4-d440-11e5-9545-f0def1aaa816/moveit_setup_assistant-2.log].
log file:
/home/ichumuh/.ros/log/377795c4-d440-11e5-9545-f0def1aaa816/moveit_setup_assistant-2*.log
Initiating shutdown!
================================================================================

Since i had problems with the .stl meshes before, I tried to convert them with "ctmconv" into a different format, which fixed the problem. Then I tried to just convert the .stl to .stl, which also seems to fix it. I also tried to only convert a subset and leave the others as they are, but it always led to the same problem. I haven't tried every possible combination though. I also wrote a little python script, that replaces every .stl in iai_robots:

#!/usr/bin/env python
from glob import glob
from subprocess import call
import rospkg

"""
This script rewrites every .stl in the iai_robots repo.
"""

def replace_stl(dir):
    """
    Converts every .stl in dir and its subdirectories into a new .stl.
    :param dir: string
        target directory
    """
    files = glob(dir+"*.stl")
    for f in files:
        call(["ctmconv", f, f])
    dirs = glob(dir+"*/")
    for d in dirs:
        replace_stl(d)

rospack = rospkg.RosPack()
dir = rospack.get_path("iai_boxy_base")+"/../"
replace_stl(dir)
mgvargas commented 8 years ago

I have the same issue while loading boxy's URDF boxy_description.urdf, I already used make_urdf.sh to transform the .xacro file to a .urdf

`[ INFO] [1461225946.538365816]: Loaded boxy_description robot model.
[ INFO] [1461225946.538679185]: Setting Param Server with Robot Description
[ INFO] [1461225946.608057414]: Robot semantic model successfully loaded.
[ INFO] [1461225946.608168998]: Setting Param Server with Robot Semantic Description
[ INFO] [1461225946.638783020]: Loading robot model 'boxy_description'...
[ INFO] [1461225946.638893898]: No root joint specified. Assuming fixed joint
*** Error in `/opt/ros/indigo/lib/moveit_setup_assistant/moveit_setup_assistant': malloc(): memory corruption: 0x0000000002463fa0 ***
Aborted (core dumped) `

I could load the URDF after commenting several parts:

First part:


<!-- NEW NECK ASSEMBLY -->
        <!-- mounting plate of UR3 -->
        <!-- <<adapter_boxy_ur3_xacro prefix="neck_" parent="base_link">
          <origin xyz="0.175 -0.227 1.48" rpy="0 0 0" />
        </adapter_boxy_ur3_xacro>

        <xacro:ur3_robot prefix="neck_" parent="neck_adapter_ur3_frame_out" 
                         joint_limited="false">
          <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 -${M_PI/2.0}" />
        </xacro:ur3_robot> -->

        <!-- The following URDF has frame_in / frame_out, so it is placed at the parent -->
       <!-- <adapter_iso50_kinect2_xacro parent="neck_tool0" prefix="neck">
          <origin xyz="0 0 0" rpy="0 0 -1.570795" />
        </adapter_iso50_kinect2_xacro> -->

        <!-- /NEW NECK ASSEMBLY -->

        <!-- OLD NEW ASSEMBLY -->
    <!-- JOINT to connect the base with the pw070 -->
    <!-- -<joint name="head_joint" type="fixed">
        <origin xyz="${head_joint_x} ${head_joint_y} ${head_joint_z}" rpy="0 0 0" />
        <parent link="base_link" />
        <child link="pw070_base_link" />
            </joint> -->
    <!-- /JOINT to connect the base with the pw070 -->

    <!-- <xacro:include filename="$(find iai_schunk_pw070_v6)/robots/pw070_v6.URDF"/> -->

    <!-- Kinect2 -->
        <!-- Pose comes from tool_H_clink in the calibration
             The quaternion was converted to RPY using python and KDL
               halcon has quat: w x y z
               kdl and tf_static_transform_publisher use: x y z w
             So take the first number from the halcon quat and put it last for KDL.
               import PyKDL as p; r2 = p.Rotation.Quaternion(-0.494547,0.491515,-0.506787,0.506955) ; r2.GetRPY() 
               answer: (-1.5431199762943342, -0.0029080109443817533, -1.5676362600579434) -->

        <!-- The following kinect2_xacro defines the _kinect2_rgb_optical_frame
        And includes the fixed joint to place the kinect on the pw070  -->
       <!-- <kinect2_xacro parent="neck_adapter_iso50_kinect2_frame_out" prefix="head_mount">
        <origin xyz="-0.02 0.10 0.02" rpy="-1.570795 0 1.570795" />
        </kinect2_xacro>-->

        <!-- shoulder kinect -->
        <!-- ORIGINAL DATA FROM HALCON CALIBRATION:
             from: base_link to: shoulder_kinect_link
             translation: -0.135394 -0.00764754 1.54755 (xyz)
             quaternion: 0.0177781 0.202257 -0.0472198 0.978032 (xyzw) -->
       <!-- <kinect name="shoulder_kinect" parent="base_link">
          <origin xyz="-0.135394 -0.00764754 1.54755"
                  rpy="0.01708077682636155 0.4085798647123734 -0.09294704527264909"/> 
       </kinect> -->`

Second part:

<!-- The following URDFs have frame_in / frame_out, so they are simply placed at their parent -->
     <!--   <kms_40_xacro parent="left_arm_cabling_adaptor_link" prefix="left_arm">
          <origin xyz="0 0 0" rpy="0 0 3.14159265359" /> --> <!--places the kms40 frame 13mm from the parent -->
      <!--  </kms_40_xacro>

        <adapter_kms40_fwk050_xacro parent="left_arm_kms40_frame_out" prefix="left_arm">
          <origin xyz="0 0 0" rpy="0 0 0" /> 
        </adapter_kms40_fwk050_xacro>

        <fwk_fwa_050_xacro parent="left_arm_adapter_kms40_fwk050_frame_out" prefix="left_arm">
          <origin xyz="0 0 0" rpy="0 0 0" />
        </fwk_fwa_050_xacro>

        <adapter_fwa050_wsg50_xacro parent="left_arm_fwk_fwa_050_frame_out" prefix="left_arm">
          <origin xyz="0 0 0.0" rpy="0 0 0" />
        </adapter_fwa050_wsg50_xacro>

        <wsg_50_xacro name="left_gripper" parent="left_arm_adapter_fwa050_wsg50_frame_out">
          <origin xyz="0 0 0" rpy="0 0 3.14159265359"/>
    </wsg_50_xacro> 

  <link name="left_wrist_optical_frame_x">
    <inertial>
      <mass value="1"/>
      <origin xyz="0 0 0"/>
      <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.01 0.01 0.01"/>
      </geometry>
      <material name="White"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0.0"/>
      <geometry>
        <box size="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link> -->

        <!-- JOINT to define base_footprint -->
       <!-- <joint name="left_wrist_optical_joint_x" type="fixed">
                <origin xyz="0.000836 -0.053028 0.073603" rpy="0.007552 6.274592 3.141201"/>
                <parent link="left_gripper_base_link" />
                <child link="left_wrist_optical_frame_x" />
        </joint> -->
        <!-- /JOINT for base_footprint -->

<!--  <link name="left_wrist_optical_frame">
    <inertial>
      <mass value="1"/>
      <origin xyz="0 0 0"/>
      <inertia ixx="0.01" ixy="0" ixz="0" iyy="0.01" iyz="0" izz="0.01"/>
    </inertial>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.01 0.01 0.01"/>
      </geometry>
      <material name="White"/>
    </visual>
    <collision>
      <origin rpy="0 0 0" xyz="0 0 0.0"/>
      <geometry>
        <box size="0.001 0.001 0.001"/>
      </geometry>
    </collision>
  </link> -->

        <!-- JOINT to define base_footprint -->
       <!-- <joint name="left_wrist_optical_joint" type="fixed">
                <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 3.141519"/>
                <parent link="left_wrist_optical_frame_x" />
                <child link="left_wrist_optical_frame" />
        </joint> -->
        <!-- /JOINT for base_footprint -->

    <!--wsg_50_xacro name="left_gripper" parent="left_arm_cabling_adaptor_link">
          <origin xyz="0 0 0" rpy="0 0 2.35619183661"/>
    </wsg_50_xacro-->`

Third part:

`<!-- The following URDFs have frame_in / frame_out, so they are simply placed at their parent -->
       <!-- <kms_40_xacro parent="right_arm_cabling_adaptor_link" prefix="right_arm">
          <origin xyz="0 0 0" rpy="0 0 3.14159265359" /> --> <!--places the kms40 frame 13mm from the parent -->
       <!-- </kms_40_xacro>

        <adapter_kms40_fwk050_xacro parent="right_arm_kms40_frame_out" prefix="right_arm">
          <origin xyz="0 0 0" rpy="0 0 0" /> 
        </adapter_kms40_fwk050_xacro>

        <fwk_fwa_050_xacro parent="right_arm_adapter_kms40_fwk050_frame_out" prefix="right_arm">
          <origin xyz="0 0 0" rpy="0 0 0" />
        </fwk_fwa_050_xacro>

        <adapter_fwa050_wsg50_xacro parent="right_arm_fwk_fwa_050_frame_out" prefix="right_arm">
          <origin xyz="0 0 0.0" rpy="0 0 0" />
        </adapter_fwa050_wsg50_xacro>

        <wsg_50_xacro name="right_gripper" parent="right_arm_adapter_fwa050_wsg50_frame_out">
          <origin xyz="0 0 0" rpy="0 0 3.14159265359"/>
    </wsg_50_xacro> -->````

I think one or several of this meshes could be damaged
amaldo commented 8 years ago

The meshes have been fixed, as far as I know. It was caused by the default STL exporter from Inventor. It seems to add extra fields at the end related to color, which the STL parser can't handle.