From dd9ac7d722c4c3f7c5ab7f1fa13251ab6d56c304 Mon Sep 17 00:00:00 2001
From: Kanae Kochigami <kochigami@jsk.imi.i.u-tokyo.ac.jp>
Date: Thu, 22 Nov 2018 16:15:35 +0900
Subject: [PATCH] [naoqieus] add led fading method (new version of #812)

---
 jsk_naoqi_robot/naoqieus/naoqi-interface.l | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/jsk_naoqi_robot/naoqieus/naoqi-interface.l b/jsk_naoqi_robot/naoqieus/naoqi-interface.l
index 87febe22d7..39d86588bf 100644
--- a/jsk_naoqi_robot/naoqieus/naoqi-interface.l
+++ b/jsk_naoqi_robot/naoqieus/naoqi-interface.l
@@ -406,5 +406,31 @@
      (send res :success)
      )
    )
+  (:fade-leds
+   (led_name r g b sec)
+   (let* ((fade_rgb_msg (instance naoqi_bridge_msgs::FadeRGB :init))
+	 (ret (instance naoqi_bridge_msgs::FadeLedsRequest :init))
+	 (duration_msg (send fade_rgb_msg :fade_duration))
+	 res)
+     (ros::wait-for-service "/naoqi_driver/fade_leds")
+     (send fade_rgb_msg :led_name led_name)
+     (send fade_rgb_msg :color :r r)
+     (send fade_rgb_msg :color :g g)
+     (send fade_rgb_msg :color :b b)
+     (send duration_msg :sec sec)
+     (send fade_rgb_msg :fade_duration duration_msg)
+     (send ret :fade_rgb fade_rgb_msg)
+     (setq res (ros::service-call "/naoqi_driver/fade_leds" ret))
+     )
+   )
+  (:reset-leds
+   (led_name)
+   (let ((ret (instance naoqi_bridge_msgs::SetStringRequest :init))
+	 res)
+     (send ret :data led_name)
+     (setq res (ros::service-call "/naoqi_driver/reset_leds" ret))
+     (send res :success)
+     )
+   )
   )
 ;;