                           (format "Enter service name (default %s): " (current-word t t))
                         "Enter service name: ")
                       (current-word t t))))
-  (let ((p (ros-service-package service)))
-    (if p
-        (let ((dir (ros-package-dir p)))
-          (if dir
-              (find-file (concat dir "/srv/" service ".srv"))
-            (error "Could not find directory corresponding to package %s" p)))
-      (error "Could not find package for service %s" service))))
+  (let* ((p+m (split-string service "/"))
+         (p (if (cdr p+m)
+                (car p+m)
+              (ros-service-package service)))
+         (m (car (last p+m))))
+    (unless p
+      (error "Could not find package for service %s" service))
+    (let ((dir (ros-package-dir p)))
+      (unless dir
+        (error "Could not find directory corresponding to package %s" p))
+      (find-file (concat dir "/srv/" m ".srv")))))
 
 
 ;; (defun view-ros-message (message)

                          (format "Enter service name (default %s): " (current-word t t))
                        "Enter service name: ")
                      (current-word t t))))
  (let ((p (ros-service-package service)))
    (if p
        (let ((dir (ros-package-dir p)))
          (if dir
              (view-file-other-window (concat dir "/srv/" service ".srv"))
            (error "Could not find directory corresponding to package %s" p)))
      (error "Could not find package for service %s" service))))

(defun ros-rgrep-package (ros-pkg regexp files)
  "Run a recursive grep in `ros-pkg', with `regexp' as search

                          (format "Enter message name (default %s): " (current-word t t))
                        "Enter message name: ")
                      (current-word t t))))
  (let* ((p+m (split-string message "/"))
         (p (if (cdr p+m)
                (car p+m)
              (ros-message-package message)))
         (m (car (last p+m))))
    (unless p
      (error "Could not find package for message %s" message))
    (let ((dir (ros-package-dir p)))
      (unless dir
        (error "Could not find directory corresponding to package %s" p))
      (find-file (concat dir "/msg/" m ".msg")))))

(defun find-ros-service (service)
  "Open definition of a ros service.  If used interactively, tab completion will work."
