Skip to content

[W4U][hrpsys_ros_bridge_tutorials] Auto-generate Euslisp interface of HIRONX#544

Closed
pazeshun wants to merge 5 commits intostart-jsk:masterfrom
pazeshun:hironx-autogen
Closed

[W4U][hrpsys_ros_bridge_tutorials] Auto-generate Euslisp interface of HIRONX#544
pazeshun wants to merge 5 commits intostart-jsk:masterfrom
pazeshun:hironx-autogen

Conversation

@pazeshun
Copy link
Contributor

@pazeshun pazeshun commented May 26, 2018

Depends on https://github.com/start-jsk/rtmros_hrp2/pull/505

hironx.l becomes automatically generated by build.
screenshot from 2018-05-28 18 09 53

@pazeshun pazeshun changed the title [WIP][W4U] Auto-generate Euslisp interface of HIRONX [WIP][W4U][hrpsys_ros_bridge_tutorials] Auto-generate Euslisp interface of HIRONX May 26, 2018
@pazeshun
Copy link
Contributor Author

pazeshun commented May 26, 2018

Current problem: generate_default_launch_eusinterface_files_for_jsk_closed_openhrp_robots macro changes launch/hironx*.launch

rtmros_tutorials/hrpsys_ros_bridge_tutorials/launch$ git status .
On branch hironx-autogen
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   hironx.launch
	modified:   hironx_nosim.launch
	modified:   hironx_ros_bridge.launch
	modified:   hironx_startup.launch

-> Remove launch/hironx*.launch

@pazeshun
Copy link
Contributor Author

pazeshun commented May 28, 2018

Auto-generated hironx-interface.l loses nothing from kawada-hironx-interface.l which is removed in this PR.
Diffs are below:

hrpsys_ros_bridge_tutorials/euslisp$ diff -u kawada-hironx-interface.l ../build/hironx-interface.l 
--- kawada-hironx-interface.l	2018-05-24 16:52:34.587796882 +0900
+++ ../build/hironx-interface.l	2018-05-28 18:07:40.079731912 +0900
@@ -1,15 +1,17 @@
 (load "package://hrpsys_ros_bridge/euslisp/rtm-ros-robot-interface.l")
-(require :kawadahironx "package://hrpsys_ros_bridge_tutorials/models/kawada-hironx.l")
+(require :hironx "package://hrpsys_ros_bridge_tutorials/models/hironx.l")
+(when (probe-file (ros::resolve-ros-path "package://hrpsys_ros_bridge_tutorials/euslisp/hironx-utils.l"))
+  (require :hironx-utils "package://hrpsys_ros_bridge_tutorials/euslisp/hironx-utils.l"))
 
-(defclass kawadahironx-interface
+(defclass hironx-interface
   :super rtm-ros-robot-interface
   :slots ())
-(defmethod kawadahironx-interface
+(defmethod hironx-interface
   (:init (&rest args)
-	  (send-super :init :robot hironx-robot)))
+         (send-super* :init :robot hironx-robot args)))
 
-(defun kawada-hironx-init (&rest args)
+(defun hironx-init (&rest args)
   (if (not (boundp '*ri*))
-      (setq *ri* (instance* kawadahironx-interface :init args)))
-  (if (not (boundp '*hiro*))
-      (setq *hiro* (instance hironx-robot :init))))
+      (setq *ri* (instance* hironx-interface :init args)))
+  (if (not (boundp '*hironx*))
+      (setq *hironx* (instance hironx-robot :init))))

@pazeshun
Copy link
Contributor Author

pazeshun commented May 28, 2018

Auto-generated launches of hironx lose nothing from original launches which are removed in this PR.
Diffs are below:

diff --git a/hrpsys_ros_bridge_tutorials/launch/hironx.launch b/hrpsys_ros_bridge_tutorials/launch/hironx.launch
index 825acad..5782976 100644
--- a/hrpsys_ros_bridge_tutorials/launch/hironx.launch
+++ b/hrpsys_ros_bridge_tutorials/launch/hironx.launch
@@ -1,17 +1,49 @@
 <launch>
   <arg name="KILL_SERVERS" default="false" />
+  <arg name="NOSIM" default="false" />
+  <arg name="REALTIME" default="true" />
+  <arg name="RUN_RVIZ" default="true" />
+  <arg name="GUI" default="true" />
+  <arg name="PROJECT_FILE" default="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX_nosim.xml" if="$(arg NOSIM)"/>
+  <arg name="PROJECT_FILE" default="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX.xml" unless="$(arg NOSIM)"/>
+  <arg name="SIMULATOR_NAME" default="HIRONX(Robot)0" />
+  <arg name="corbaport" default="15005" />
+  <arg name="hrpsys_precreate_rtc" default="HGcontroller"/>
+  <arg name="USE_UNSTABLE_RTC" default="true"/>
+  <!-- following rtc is used for test/hrpsys-samples, mainly full euslisp test -->
+  <arg name="USE_EMERGENCYSTOPPER" default="false" />
+  <arg name="USE_REFERENCEFORCEUPDATER" default="false" />
+  <arg name="USE_OBJECTCONTACTTURNAROUNDDETECTOR" default="false" />
   <include file="$(find hrpsys_ros_bridge_tutorials)/launch/hironx_startup.launch" >
     <arg name="KILL_SERVERS" default="$(arg KILL_SERVERS)" />
+    <arg name="NOSIM" value="$(arg NOSIM)" />
+    <arg name="PROJECT_FILE" value="$(arg PROJECT_FILE)" />
+    <arg name="SIMULATOR_NAME" value="$(arg SIMULATOR_NAME)" />
+    <arg name="REALTIME" default="$(arg REALTIME)" />
+    <arg name="corbaport" default="$(arg corbaport)" />
+    <arg name="GUI" default="$(arg GUI)" />
+    <arg name="hrpsys_precreate_rtc" default="$(arg hrpsys_precreate_rtc)" />
+    <arg name="USE_UNSTABLE_RTC" default="$(arg USE_UNSTABLE_RTC)"/>
+  </include>
+  <include file="$(find hrpsys_ros_bridge_tutorials)/launch/hironx_ros_bridge.launch" >
+    <arg name="SIMULATOR_NAME" value="$(arg SIMULATOR_NAME)" />
+    <arg name="RUN_RVIZ" default="$(arg RUN_RVIZ)" />
+    <arg name="corbaport" default="$(arg corbaport)" />
+    <arg name="USE_UNSTABLE_RTC" default="$(arg USE_UNSTABLE_RTC)"/>
+    <!-- BEGIN: development -->
+    <arg name="USE_EMERGENCYSTOPPER" default="$(arg USE_EMERGENCYSTOPPER)" />
+    <arg name="USE_REFERENCEFORCEUPDATER" default="$(arg USE_REFERENCEFORCEUPDATER)" />
+    <arg name="USE_OBJECTCONTACTTURNAROUNDDETECTOR" default="$(arg USE_OBJECTCONTACTTURNAROUNDDETECTOR)" />
+    <!-- END: development -->
   </include>
-  <include file="$(find hrpsys_ros_bridge_tutorials)/launch/hironx_ros_bridge.launch" />
 
   <sphinxdoc><![CDATA[
 
 .. code-block:: bash
 
-  rosrun roseus roseus `rospack find hrpsys_ros_bridge_tutorials`/euslisp/kawada-hironx-example.l
+  rosrun roseus roseus `rospack find hrpsys_ros_bridge_tutorials`/euslisp/hironx-interface.l
 
-This launch file shows an example of ros bridge for open kawada hironx robot, `hironx.launch` file launches folloiwng two program
+This launch file shows an example of ros bridge for open hironx robot, `hironx.launch` file launches folloiwng two program
 
 1. `roslaunch hrpsys_ros_bridge_tutorials hironx_startup.launch` : launch simulated robot environment, if you use real robot, you don't need this line
 
@@ -19,26 +51,9 @@ This launch file shows an example of ros bridge for open kawada hironx robot, `h
 
 After that, we need to invoke the client program. Following program is the example of euslisp language
 
-3. `rosrun roseus roseus kawada-hironx-example.l` : sample euslisp script to control the robot.
-
-.. video:: build/images/HIRONX_Example
-  :width: 600
-
-.. video:: build/images/hironx_rviz
-  :width: 600
+3. `rosrun roseus roseus hironx-interface.l` : sample euslisp script to control the robot.
 
   ]]></sphinxdoc>
-  <test type="test-grxui.py" pkg="openhrp3" time-limit="300"
-   test-name="HIRONX_Example"
-   args="--max-time=10
-	 --viewer-name='' #
-	 --no-start-simulation
-	 --capture-window='Irrlicht'
-	 --target-directory=$(find hrpsys_ros_bridge_tutorials)/build/images
-	 --check-tf='/WAIST /HEAD_JOINT1_Link'
-	 --script='rosrun roseus roseus $(find hrpsys_ros_bridge_tutorials)/euslisp/kawada-hironx-example.l __log:=dummy'" /> <!-- add dummy __log/= argument to invoke roseus with non-interactive mode -->
-  <test type="ogv_encode.sh" pkg="jsk_tools" test-name="z_HIRONX_Example" args="$(find hrpsys_ros_bridge_tutorials)/build/images/HIRONX_Example.ogv" time-limit="1000"/>
-  <test type="glc_encode.sh" pkg="jsk_tools" test-name="z_hironx_rviz" args="$(find hrpsys_ros_bridge_tutorials)/build/images/hironx_rviz.glc" time-limit="2000"/>
 </launch>
 
 
diff --git a/hrpsys_ros_bridge_tutorials/launch/hironx_nosim.launch b/hrpsys_ros_bridge_tutorials/launch/hironx_nosim.launch
index 15367de..f1c27fe 100644
--- a/hrpsys_ros_bridge_tutorials/launch/hironx_nosim.launch
+++ b/hrpsys_ros_bridge_tutorials/launch/hironx_nosim.launch
@@ -1,18 +1,21 @@
 <launch>
   <arg name="KILL_SERVERS" default="false" />
+  <arg name="RUN_RVIZ" default="true" />
   <include file="$(find hrpsys_ros_bridge_tutorials)/launch/hironx_startup.launch" >
     <arg name="KILL_SERVERS" default="$(arg KILL_SERVERS)" />
     <arg name="NOSIM" default="true" />
   </include>
-  <include file="$(find hrpsys_ros_bridge_tutorials)/launch/hironx_ros_bridge.launch" />
+  <include file="$(find hrpsys_ros_bridge_tutorials)/launch/hironx_ros_bridge.launch">
+    <arg name="RUN_RVIZ" default="$(arg RUN_RVIZ)" />
+  </include>
 
   <sphinxdoc><![CDATA[
 
 .. code-block:: bash
 
-  rosrun roseus roseus `rospack find hrpsys_ros_bridge_tutorials`/euslisp/kawada-hironx-example.l
+  rosrun roseus roseus `rospack find hrpsys_ros_bridge_tutorials`/euslisp/hironx-pickup.l
 
-This launch file shows an example of ros bridge for open kawada hironx robot, `hironx_nosim.launch` file launches folloiwng two program
+This launch file shows an example of ros bridge for open hironx robot, `hironx.launch` file launches folloiwng two program
 
 1. `roslaunch hrpsys_ros_bridge_tutorials hironx_startup.launch NOSIM:=true` : launch simulated robot environment, if you use real robot, you don't need this line
 
@@ -20,26 +23,9 @@ This launch file shows an example of ros bridge for open kawada hironx robot, `h
 
 After that, we need to invoke the client program. Following program is the example of euslisp language
 
-3. `rosrun roseus roseus kawada-hironx-example.l` : sample euslisp script to control the robot.
-
-.. video:: build/images/HIRONX_Example
-  :width: 600
-
-.. video:: build/images/hironx_rviz
-  :width: 600
+3. `rosrun roseus roseus hironx-interface.l` : sample euslisp script to control the robot.
 
   ]]></sphinxdoc>
-  <test type="test-grxui.py" pkg="openhrp3" time-limit="300"
-   test-name="HIRONX_Example"
-   args="--max-time=10
-	 --viewer-name='' #
-	 --no-start-simulation
-	 --capture-window='Irrlicht'
-	 --target-directory=$(find hrpsys_ros_bridge_tutorials)/build/images
-	 --check-tf='/WAIST /HEAD_JOINT1_Link'
-	 --script='rosrun roseus roseus $(find hrpsys_ros_bridge_tutorials)/euslisp/kawada-hironx-example.l __log:=dummy'" /> <!-- add dummy __log/= argument to invoke roseus with non-interactive mode -->
-  <test type="ogv_encode.sh" pkg="jsk_tools" test-name="z_HIRONX_Example" args="$(find hrpsys_ros_bridge_tutorials)/build/images/HIRONX_Example.ogv" time-limit="1000"/>
-  <test type="glc_encode.sh" pkg="jsk_tools" test-name="z_hironx_rviz" args="$(find hrpsys_ros_bridge_tutorials)/build/images/hironx_rviz.glc" time-limit="2000"/>
 </launch>
 
 
diff --git a/hrpsys_ros_bridge_tutorials/launch/hironx_ros_bridge.launch b/hrpsys_ros_bridge_tutorials/launch/hironx_ros_bridge.launch
index 5a50982..550ed37 100644
--- a/hrpsys_ros_bridge_tutorials/launch/hironx_ros_bridge.launch
+++ b/hrpsys_ros_bridge_tutorials/launch/hironx_ros_bridge.launch
@@ -1,17 +1,46 @@
 <launch>
+  <arg name="RUN_RVIZ" default="true" />
+  <arg name="SIMULATOR_NAME" default="HIRONX(Robot)0" />
+  <!-- unstable means minimum rtc set for walking demo -->
+  <arg name="USE_UNSTABLE_RTC" default="true"/>
+  <!-- following rtc is used for test/hrpsys-samples, mainly full euslisp test -->
+  <arg name="USE_EMERGENCYSTOPPER" default="false" />
+  <arg name="USE_REFERENCEFORCEUPDATER" default="false" />
+  <arg name="USE_OBJECTCONTACTTURNAROUNDDETECTOR" default="false" />
 
   <rosparam command="load"
             file="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX_controller_config.yaml" />
 
+  <arg name="corbaport" default="15005" />
+  <arg name="nameserver" default="localhost" />
   <include file="$(find hrpsys_ros_bridge)/launch/hrpsys_ros_bridge.launch">
-    <arg name="SIMULATOR_NAME" value="HiroNX(Robot)0" />
-    <arg name="MODEL_FILE" value="$(find collada_robots)/data/robots/kawada-hironx.dae" />
-    <arg name="COLLADA_FILE" value="$(find collada_robots)/data/robots/kawada-hironx.dae" />
-  </include>
+    <arg name="SIMULATOR_NAME" value="$(arg SIMULATOR_NAME)" />
+    <arg name="MODEL_FILE" value="$(find hrp2_models)/HIRONX/HIRONXmain.wrl" />
+    <arg name="COLLADA_FILE" value="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX.dae" />
+    <arg name="CONF_FILE" value="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX.conf" />
+    <arg name="corbaport" default="$(arg corbaport)" />
+    <arg name="nameserver" default="$(arg nameserver)" />
+    <!-- BEGIN: unstable : maintained-->
+    <arg name="USE_WALKING" default="true" if="$(arg USE_UNSTABLE_RTC)"/>
+    <arg name="USE_IMPEDANCECONTROLLER" default="true" if="$(arg USE_UNSTABLE_RTC)" />
+
+    <!-- END: unstable : maintained -->
+    <!-- BEGIN: development -->
+    <arg name="USE_EMERGENCYSTOPPER" default="$(arg USE_EMERGENCYSTOPPER)" />
+    <arg name="USE_REFERENCEFORCEUPDATER" default="$(arg USE_REFERENCEFORCEUPDATER)" />
+    <arg name="USE_OBJECTCONTACTTURNAROUNDDETECTOR" default="$(arg USE_OBJECTCONTACTTURNAROUNDDETECTOR)" />
+    <!-- END: development -->
+    <arg name="ROBOT_TYPE" default="hironx" if="$(arg USE_UNSTABLE_RTC)" />
+    <arg name="USE_ROBOT_TYPE_SETTING" default="true" if="$(arg USE_UNSTABLE_RTC)" />
+    <arg name="BASE_LINK" default="WAIST_LINK0" />
 
-  <node name="hironx_rviz" pkg="rviz" type="rviz" respawn="true"
-	args="-sync -d $(find hrpsys_ros_bridge_tutorials)/launch/hironx.vcg"
-        />
 
+  </include>
+
+  <group if="$(arg RUN_RVIZ)" >
+    <node name="hironx_rviz" pkg="rviz" type="rviz" respawn="true"
+          args="-sync -d $(find hrpsys_ros_bridge_tutorials)/launch/hironx.rviz" />
+  </group>
 </launch>
 
+
diff --git a/hrpsys_ros_bridge_tutorials/launch/hironx_startup.launch b/hrpsys_ros_bridge_tutorials/launch/hironx_startup.launch
index 1c63f32..21e439a 100644
--- a/hrpsys_ros_bridge_tutorials/launch/hironx_startup.launch
+++ b/hrpsys_ros_bridge_tutorials/launch/hironx_startup.launch
@@ -1,20 +1,26 @@
 <launch>
   <arg name="KILL_SERVERS" default="false" />
   <arg name="GUI" default="true" />
-  <arg name="LAUNCH_HRPSYSPY" default="true" />
   <arg name="NOSIM" default="false" />
-  <!-- begin use sim time -->
+  <arg name="REALTIME" default="true" />
+  <arg name="SIMULATOR_NAME" default="HIRONX(Robot)0" />
+  <arg name="PROJECT_FILE" default="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX_nosim.xml" if="$(arg NOSIM)"/>
+  <arg name="PROJECT_FILE" default="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX.xml" unless="$(arg NOSIM)"/>
+  <arg name="corbaport" default="15005" />
+  <arg name="hrpsys_precreate_rtc" default="HGcontroller"/>
+  <arg name="USE_UNSTABLE_RTC" default="true"/>
   <param name="use_sim_time" value="true" />
-  <!-- end use sim time -->
   <include file="$(find hrpsys_tools)/launch/hrpsys.launch">
-    <arg name="PROJECT_FILE" value="$(find hrpsys_ros_bridge_tutorials)/models/kawada-hironx_nosim.xml" if="$(arg NOSIM)"/>
-    <arg name="PROJECT_FILE" value="$(find hrpsys_ros_bridge_tutorials)/models/kawada-hironx.xml" unless="$(arg NOSIM)"/>
-    <arg name="MODEL_FILE" value="$(find collada_robots)/data/robots/kawada-hironx.dae" />
-    <arg name="CONF_FILE" value="$(find hrpsys_ros_bridge_tutorials)/models/kawada-hironx.conf" />
-    <arg name="SIMULATOR_NAME" value="HiroNX(Robot)0" />
+    <arg name="PROJECT_FILE" value="$(arg PROJECT_FILE)"/>
+    <arg name="MODEL_FILE" value="$(find hrp2_models)/HIRONX/HIRONXmain.wrl" />
+    <arg name="CONF_FILE" value="$(find hrpsys_ros_bridge_tutorials)/models/HIRONX.conf" />
+    <arg name="SIMULATOR_NAME" value="$(arg SIMULATOR_NAME)" />
     <arg name="KILL_SERVERS" default="$(arg KILL_SERVERS)" />
+    <arg name="REALTIME" default="$(arg REALTIME)" />
+    <arg name="corbaport" default="$(arg corbaport)" />
     <arg name="GUI" default="$(arg GUI)" />
-    <arg name="LAUNCH_HRPSYSPY" default="$(arg LAUNCH_HRPSYSPY)" />
-    <arg name="REALTIME" default="true" />
+    <arg name="hrpsys_precreate_rtc" default="$(arg hrpsys_precreate_rtc)" />
+    <arg name="HRPSYS_PY_PKG" default="hrpsys_ros_bridge_tutorials" if="$(arg USE_UNSTABLE_RTC)"/>
+    <arg name="HRPSYS_PY_NAME" default="hironx_hrpsys_config.py" if="$(arg USE_UNSTABLE_RTC)"/>
   </include>
 </launch>

@pazeshun pazeshun changed the title [WIP][W4U][hrpsys_ros_bridge_tutorials] Auto-generate Euslisp interface of HIRONX [W4U][hrpsys_ros_bridge_tutorials] Auto-generate Euslisp interface of HIRONX May 28, 2018
@pazeshun
Copy link
Contributor Author

Move to #549

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

Successfully merging this pull request may close these issues.

1 participant