From b3ff2e539f14df7cdd5759f331a64a2288f34d7e Mon Sep 17 00:00:00 2001
From: Rohan Budhiraja <budhiraja@laas.fr>
Date: Sat, 31 Dec 2016 16:07:05 +0100
Subject: [PATCH] [cmake] Use jrl-cmakemodules standards. Rewrite
 CMakeLists.txt [urdf] Change talos_small.urdf to use the smaller STL meshes.

* depends on urdfdom>=0.2.9. does not depend on Catkin
* remove package.xml
* add submodule cmake

NOTE: ASSIMP is angry with the header of the bigger STL files like arm_1.stl
---
 .gitignore              |  1 +
 .gitmodules             |  3 +++
 CMakeLists.txt          | 29 ++++++++++++++++-------------
 cmake                   |  1 +
 package.xml             | 16 ----------------
 robots/talos_small.urdf | 28 +++++++++++++++-------------
 6 files changed, 36 insertions(+), 42 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 cmake
 delete mode 100644 package.xml

diff --git a/.gitignore b/.gitignore
index 86a9ce7..f6faf77 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
+_build*
 *.user
 *~
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..60c9164
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "cmake"]
+	path = cmake
+	url = git://github.com/jrl-umi3218/jrl-cmakemodules.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f509820..fe3b6f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,17 +1,20 @@
-cmake_minimum_required(VERSION 2.8.3)
-project(talos_description)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
+INCLUDE(cmake/base.cmake)
+#include(cmake/ros.cmake)
 
-find_package(catkin REQUIRED)
 
-catkin_package(
-#  INCLUDE_DIRS include
-#  LIBRARIES talos_description
-#  CATKIN_DEPENDS other_catkin_pkg
-#  DEPENDS system_lib
-)
+SET(PROJECT_NAME talos-data)
+SET(PROJECT_DESCRIPTION "Talos urdf model, srdf model and other data")
+SET(PROJECT_URL "https://redmine.laas.fr/projects/pyrene-talos/repository/talos-data")
 
-foreach(dir config gazebo meshes robots urdf srdf)
-    install(DIRECTORY ${dir}/
-        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
-endforeach(dir)
+SETUP_PROJECT()
 
+# Find xml_reflection
+ADD_REQUIRED_DEPENDENCY("urdfdom >= 0.2.9")
+
+FOREACH(dir config gazebo meshes robots urdf srdf)
+  INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/${dir}
+    DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${dir})
+ENDFOREACH(dir)
+
+SETUP_PROJECT_FINALIZE()
\ No newline at end of file
diff --git a/cmake b/cmake
new file mode 160000
index 0000000..54177e4
--- /dev/null
+++ b/cmake
@@ -0,0 +1 @@
+Subproject commit 54177e44a1440222184865f1449c40b708eeaaa4
diff --git a/package.xml b/package.xml
deleted file mode 100644
index 752f497..0000000
--- a/package.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<package>
-  <name>talos_description</name>
-  <version>0.0.13</version>
-  <description>The talos_description package</description>
-
-  <maintainer email="hilario.tome@pal-robotics.com">Hilario Tomé</maintainer>
-
-  <license>Proprietary</license>
-
-  <buildtool_depend>catkin</buildtool_depend>
-
-  <export>
-  </export>
-  
-</package>
diff --git a/robots/talos_small.urdf b/robots/talos_small.urdf
index 8f5eefa..e1e5221 100644
--- a/robots/talos_small.urdf
+++ b/robots/talos_small.urdf
@@ -289,6 +289,7 @@
       <!-- inertia tensor computed analytically for a solid cuboid -->
       <inertia ixx="0.000030" ixy="0.0" ixz="0.0" iyy="0.000030" iyz="0.0" izz="0.000002"/>
     </inertial>
+      <!--
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
@@ -298,6 +299,7 @@
         <color rgba="0.5 0.5 0.5 1"/>
       </material>
     </visual>
+      -->
     <collision>
       <origin rpy="0 0 0" xyz="-0.01 0.0025 0"/>
       <geometry>
@@ -454,7 +456,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_1.STL" scale="1 1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_1_collision.STL" scale="1 1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -487,7 +489,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_2.STL" scale="1 1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_2_collision.STL" scale="1 1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -520,7 +522,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_3.STL" scale="1 1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_3_collision.STL" scale="1 1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -556,7 +558,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_4.STL" scale="1 1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_4_collision.STL" scale="1 1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -627,7 +629,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_5.STL" scale="1 1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_5_collision.STL" scale="1 1 1"/>
       </geometry>
       <material name="LightGrey"/>
     </visual>
@@ -660,7 +662,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_6.STL" scale="1 1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_6_collision.STL" scale="1 1 1"/>
       </geometry>
       <material name="LightGrey"/>
     </visual>
@@ -838,7 +840,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_1.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_1_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -871,7 +873,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_2.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_2_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -904,7 +906,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_3.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_3_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -940,7 +942,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_4.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_4_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
@@ -1011,7 +1013,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_5.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_5_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="LightGrey"/>
     </visual>
@@ -1044,7 +1046,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_6.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_6_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="LightGrey"/>
     </visual>
@@ -1085,7 +1087,7 @@
     <visual>
       <origin rpy="0 0 0" xyz="0 0 0"/>
       <geometry>
-        <mesh filename="package://talos_description/meshes/arm/arm_7.STL" scale="1 -1 1"/>
+        <mesh filename="package://talos_description/meshes/arm/arm_7_collision.STL" scale="1 -1 1"/>
       </geometry>
       <material name="DarkGrey"/>
     </visual>
-- 
GitLab