From 6f64de8964db6c2289cd9a3d618fe10e961157aa Mon Sep 17 00:00:00 2001 From: Benjamin Maidel Date: Tue, 23 Jan 2018 20:08:14 +0100 Subject: [PATCH] added action message generation --- .../internal/message/GenerateInterfaces.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/message_generation/src/main/java/org/ros/internal/message/GenerateInterfaces.java b/message_generation/src/main/java/org/ros/internal/message/GenerateInterfaces.java index 64a16c89..33f23cdf 100644 --- a/message_generation/src/main/java/org/ros/internal/message/GenerateInterfaces.java +++ b/message_generation/src/main/java/org/ros/internal/message/GenerateInterfaces.java @@ -142,6 +142,27 @@ public void generate(File outputDirectory, Collection packages, for (File directory : packagePath) { topicDefinitionFileProvider.addDirectory(directory); serviceDefinitionFileProvider.addDirectory(directory); + + //ugly hack for action definitions + String dir = directory.getAbsolutePath(); + String actionDir = dir + "/action"; + File actionFile = new File(actionDir); + if(actionFile.exists()) { + int idx = dir.indexOf("src"); + if(idx >= 0){ + String subDir = dir.substring(idx); + dir = dir.replace(subDir,"devel/share/"); + String[] splits = directory.getAbsolutePath().split("/"); + if(splits.length >0){ + dir += splits[splits.length-1]; + File newFileDir = new File(dir); + if(newFileDir.exists()){ + topicDefinitionFileProvider.addDirectory(newFileDir); + } + } + } + } + } topicDefinitionFileProvider.update(); serviceDefinitionFileProvider.update();