From e772daefdaf05e7050a7d5931f2c1f56f95b90b4 Mon Sep 17 00:00:00 2001
From: Olivier Stasse <ostasse@laas.fr>
Date: Wed, 7 Mar 2018 10:50:42 +0100
Subject: [PATCH] Add sot_pyrene_bringup in the metapkg talos.

---
 sot_pyrene_bringup/CMakeLists.txt             | 33 ++++++++++++++++
 sot_pyrene_bringup/README.md                  | 16 ++++++++
 .../launch/geometric_simu.launch              | 25 ++++++++++++
 .../launch/geometric_simu_context.launch      | 39 +++++++++++++++++++
 sot_pyrene_bringup/package.xml                | 23 +++++++++++
 sot_pyrene_bringup/sot/pyrene.yaml            |  0
 6 files changed, 136 insertions(+)
 create mode 100644 sot_pyrene_bringup/CMakeLists.txt
 create mode 100644 sot_pyrene_bringup/README.md
 create mode 100644 sot_pyrene_bringup/launch/geometric_simu.launch
 create mode 100644 sot_pyrene_bringup/launch/geometric_simu_context.launch
 create mode 100644 sot_pyrene_bringup/package.xml
 create mode 100644 sot_pyrene_bringup/sot/pyrene.yaml

diff --git a/sot_pyrene_bringup/CMakeLists.txt b/sot_pyrene_bringup/CMakeLists.txt
new file mode 100644
index 0000000..1e6cd93
--- /dev/null
+++ b/sot_pyrene_bringup/CMakeLists.txt
@@ -0,0 +1,33 @@
+cmake_minimum_required(VERSION 2.6)
+
+project(sot_pyrene_bringup)
+
+find_package(catkin REQUIRED)
+catkin_package()
+
+#set(PROJECT_NAME sot_talos_bringup)
+#set(PROJECT_DESCRIPTION ROS package for Stack of Tasks on Talos)
+#set(PROJECT_URL "")
+
+#setup_project()
+
+INSTALL(
+  FILES 
+  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/config
+)
+
+INSTALL(
+  FILES
+  launch/geometric-simu.launch
+  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/launch
+)
+
+
+INSTALL(
+  FILES
+  package.xml
+  DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/
+)
+
+#setup_project_finalize()
+
diff --git a/sot_pyrene_bringup/README.md b/sot_pyrene_bringup/README.md
new file mode 100644
index 0000000..6801094
--- /dev/null
+++ b/sot_pyrene_bringup/README.md
@@ -0,0 +1,16 @@
+Launching geometric_simu with Talos
+===================================
+
+1/ Lancer ros et le simulateur geometric
+roslaunch sot_pyrene_bringup geometric_simu.launch
+
+2/ Lancer la connection a dynamic_graph_bridge
+rosrun dynamic_graph_bridge run_command
+
+3/ Construire son graphe dans la commande
+
+4/ Demarrer la commande
+rosservice call /start_dynamic_graph
+
+5/ Lancer rviz
+rosrun rviz rviz
diff --git a/sot_pyrene_bringup/launch/geometric_simu.launch b/sot_pyrene_bringup/launch/geometric_simu.launch
new file mode 100644
index 0000000..162b23c
--- /dev/null
+++ b/sot_pyrene_bringup/launch/geometric_simu.launch
@@ -0,0 +1,25 @@
+<!-- -*-xml-*-
+     Handle ROS simulation of the SoT.
+  -->
+<launch>
+  <!-- Which robot are we controlling ? -->
+  <arg name="robot" default="pyrene" />
+  <arg name="libsot" default="libsot-pyrene-controller.so" />   
+
+  <include file="$(find sot_pyrene_bringup)/launch/geometric_simu_context.launch" >
+    <arg name="robot" value="$(arg robot)" />       
+    <arg name="libsot" value="$(arg libsot)" />
+  </include>
+
+  <!-- Load Stack of Tasks. -->
+  <node machine="geometric_simu_machine" 
+        name="node_stack_of_tasks" 
+	pkg="dynamic_graph_bridge"
+	type="geometric_simu"
+        args=" --input-file $(arg libsot)" 
+	respawn="true">
+    <param name="/sot/dg/geometric_simu" value="" />
+  </node>
+
+
+</launch>
diff --git a/sot_pyrene_bringup/launch/geometric_simu_context.launch b/sot_pyrene_bringup/launch/geometric_simu_context.launch
new file mode 100644
index 0000000..7eb2f75
--- /dev/null
+++ b/sot_pyrene_bringup/launch/geometric_simu_context.launch
@@ -0,0 +1,39 @@
+<!-- -*-xml-*-
+     Handle ROS simulation of the SoT.
+  -->
+<launch>
+  <!-- Which robot are we controlling ? -->
+  <arg name="robot" default="pyrene" />
+  <arg name="libsot" default="libsot-pyrene-controller.so" />   
+
+  <!-- BTW we are in simulation ? -->
+
+   <!-- Load robot model. -->
+  <param name="robot_description"
+	 textfile="$(find talos_data)/urdf/talos_reduced.urdf" />
+  
+  <machine name="geometric_simu_machine"
+           address="localhost">
+  </machine >
+
+  <!--
+     Read joint_states topic and publish link positions to tf.
+
+     openhrp_bridge publishes encoder values to the joint_states topic
+     therefore, this provide the most reliable way of identifying link
+     relative position on HRP-2.
+    -->
+  <node name="robot_state_publisher"
+	pkg="robot_state_publisher"
+	type="state_publisher"
+	respawn="true">
+    <param name="tf_prefix" value="" />
+  </node>
+
+
+  <!-- Buffer Server -->
+  <node pkg="tf2_ros" type="buffer_server"
+	name="tf2_buffer_server" respawn="true">
+    <param name="buffer_size" value="120.0"/>
+  </node>
+</launch>
diff --git a/sot_pyrene_bringup/package.xml b/sot_pyrene_bringup/package.xml
new file mode 100644
index 0000000..786d79f
--- /dev/null
+++ b/sot_pyrene_bringup/package.xml
@@ -0,0 +1,23 @@
+<package>
+  <name>sot_pyrene_bringup</name>
+  <version>0.0.1</version>
+  <description>ROS package for Stack of Tasks on Pyrene</description>
+
+  <maintainer email="ostasse@laas.fr">Olivier Stasse</maintainer>
+
+  <license>BSD</license>
+
+  <url type="website">http://redmine.laas.fr/</url>
+  <author>Olivier Stasse</author>
+
+  <buildtool_depend>catkin</buildtool_depend>
+
+  <build_depend>roscpp</build_depend>
+  <build_depend>talos_description</build_depend>
+
+  <run_depend>roscpp</run_depend>
+  <run_depend>talos_description</run_depend>
+
+  <export>
+  </export>
+</package>
diff --git a/sot_pyrene_bringup/sot/pyrene.yaml b/sot_pyrene_bringup/sot/pyrene.yaml
new file mode 100644
index 0000000..e69de29
-- 
GitLab