diff --git a/.classpath b/.classpath deleted file mode 100644 index 0af71fdd9eee79d97d4af4c4d47f8b4b8bbcbade..0000000000000000000000000000000000000000 --- a/.classpath +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="apache_xmlrpc_client/src/main/java"/> - <classpathentry kind="src" path="apache_xmlrpc_common/src/main/java"/> - <classpathentry kind="src" path="apache_xmlrpc_server/src/main/java"/> - <classpathentry kind="src" path="message_generation_tests/src/test/java"/> - <classpathentry kind="src" path="rosjava_benchmarks/src/main/java"/> - <classpathentry kind="src" path="rosjava_geometry/src/main/java"/> - <classpathentry kind="src" path="rosjava_geometry/src/test/java"/> - <classpathentry kind="src" path="rosjava_test/src/main/java"/> - <classpathentry kind="src" path="rosjava_tutorial_pubsub/src/main/java"/> - <classpathentry kind="src" path="rosjava_tutorial_right_hand_rule/src/main/java"/> - <classpathentry kind="src" path="rosjava_tutorial_services/src/main/java"/> - <classpathentry kind="src" path="rosjava/src/main/java"/> - <classpathentry kind="src" path="rosjava/src/test/java"/> - <classpathentry kind="lib" path="gradle/wrapper/gradle-wrapper.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 7cd5193f1a3fd19e9495e652a955253db053ad9c..0000000000000000000000000000000000000000 --- a/.hgignore +++ /dev/null @@ -1,25 +0,0 @@ -syntax: glob -*.class -*.dex -*.orig -*.swp -*.pyc -*.DS_Store -*~ -*.log -*.ap_ -*.apk -.cproject -.settings -.classpath -.project -.gradle -target -build -dist -msg_gen -srv_gen -gen -libs -bin -docs/src/main/sphinx/conf.py diff --git a/.rosinstall b/.rosinstall deleted file mode 100644 index e08632f86d453fd183f7eb351550328c36637a4b..0000000000000000000000000000000000000000 --- a/.rosinstall +++ /dev/null @@ -1,4 +0,0 @@ -- git: - local-name: rosjava_core - uri: https://github.com/rosjava/rosjava_core/ - version: hydro-devel diff --git a/3rdparty/BUILD b/3rdparty/BUILD deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/3rdparty/jvm/com/google/code/findbugs/BUILD b/3rdparty/jvm/com/google/code/findbugs/BUILD deleted file mode 100644 index 2a23982e6f02fada213930e0004a199cc4019b45..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/com/google/code/findbugs/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "jsr305", - exports = [ - "//external:jar/com/google/code/findbugs/jsr305" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/com/google/guava/BUILD b/3rdparty/jvm/com/google/guava/BUILD deleted file mode 100644 index 3cb65a2e3668f4046003f6d7ed529b65bd25bf6c..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/com/google/guava/BUILD +++ /dev/null @@ -1,15 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "guava", - exports = [ - "//external:jar/com/google/guava/guava" - ], - runtime_deps = [ - "//3rdparty/jvm/com/google/code/findbugs:jsr305" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/commons_pool/BUILD b/3rdparty/jvm/commons_pool/BUILD deleted file mode 100644 index 0bbfd10c7500107d020814500cc66eb0ad09549d..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/commons_pool/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "commons_pool", - exports = [ - "//external:jar/commons_pool/commons_pool" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/dnsjava/BUILD b/3rdparty/jvm/dnsjava/BUILD deleted file mode 100644 index 7ac97e03db55e04c84acb0cf2192977a80cc36bd..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/dnsjava/BUILD +++ /dev/null @@ -1,15 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "dnsjava", - exports = [ - "//external:jar/dnsjava/dnsjava" - ], - runtime_deps = [ - "//3rdparty/jvm/junit:junit" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/io/netty/BUILD b/3rdparty/jvm/io/netty/BUILD deleted file mode 100644 index 42fed0c4a07e5be8c3be7b2d2f0b853472e25b5d..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/io/netty/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "netty", - exports = [ - "//external:jar/io/netty/netty" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/junit/BUILD b/3rdparty/jvm/junit/BUILD deleted file mode 100644 index 7be4bd9660b8c19473bb1334a692a9cb64e8c51f..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/junit/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "junit", - exports = [ - "//external:jar/junit/junit" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/org/apache/commons/BUILD b/3rdparty/jvm/org/apache/commons/BUILD deleted file mode 100644 index 3c6c77d78a79ae9da1976b0f7d3df7e036c70638..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/org/apache/commons/BUILD +++ /dev/null @@ -1,76 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "com_springsource_org_apache_commons_codec", - exports = [ - "//external:jar/org/apache/commons/com_springsource_org_apache_commons_codec" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "com_springsource_org_apache_commons_httpclient", - exports = [ - "//external:jar/org/apache/commons/com_springsource_org_apache_commons_httpclient" - ], - runtime_deps = [ - ":com_springsource_org_apache_commons_codec", - ":com_springsource_org_apache_commons_logging" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "com_springsource_org_apache_commons_io", - exports = [ - "//external:jar/org/apache/commons/com_springsource_org_apache_commons_io" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "com_springsource_org_apache_commons_lang", - exports = [ - "//external:jar/org/apache/commons/com_springsource_org_apache_commons_lang" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "com_springsource_org_apache_commons_logging", - exports = [ - "//external:jar/org/apache/commons/com_springsource_org_apache_commons_logging" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "com_springsource_org_apache_commons_net", - exports = [ - "//external:jar/org/apache/commons/com_springsource_org_apache_commons_net" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/org/apache/ws/commons/BUILD b/3rdparty/jvm/org/apache/ws/commons/BUILD deleted file mode 100644 index c538d3b9e856646a04acae5cb8e54a19ec712543..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/org/apache/ws/commons/BUILD +++ /dev/null @@ -1,16 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "ws_commons_util", - exports = [ - "//external:jar/org/apache/ws/commons/ws_commons_util" - ], - runtime_deps = [ - "//3rdparty/jvm/junit:junit", - "//3rdparty/jvm/xml_apis:xml_apis" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/org/mockito/BUILD b/3rdparty/jvm/org/mockito/BUILD deleted file mode 100644 index 025c073b30ae29c160405728404a8d5788c6c6d2..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/org/mockito/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "mockito_all", - exports = [ - "//external:jar/org/mockito/mockito_all" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/org/ros/rosjava_bootstrap/BUILD b/3rdparty/jvm/org/ros/rosjava_bootstrap/BUILD deleted file mode 100644 index b74ab7035f9b7a750f989066e8010b2bcf693f92..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/org/ros/rosjava_bootstrap/BUILD +++ /dev/null @@ -1,33 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "gradle_plugins", - exports = [ - "//external:jar/org/ros/rosjava_bootstrap/gradle_plugins" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "message_generation", - exports = [ - "//external:jar/org/ros/rosjava_bootstrap/message_generation" - ], - runtime_deps = [ - "//3rdparty/jvm/com/google/guava:guava", - "//3rdparty/jvm/commons_pool:commons_pool", - "//3rdparty/jvm/io/netty:netty", - "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_codec", - "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_io", - "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_lang", - ":gradle_plugins" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/org/ros/rosjava_messages/BUILD b/3rdparty/jvm/org/ros/rosjava_messages/BUILD deleted file mode 100644 index 91fd375dec76d52a214974526e15463733c61516..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/org/ros/rosjava_messages/BUILD +++ /dev/null @@ -1,89 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "actionlib_msgs", - exports = [ - "//external:jar/org/ros/rosjava_messages/actionlib_msgs" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "geometry_msgs", - exports = [ - "//external:jar/org/ros/rosjava_messages/geometry_msgs" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "nav_msgs", - exports = [ - "//external:jar/org/ros/rosjava_messages/nav_msgs" - ], - runtime_deps = [ - "//3rdparty/jvm/org/ros/rosjava_bootstrap:message_generation", - ":actionlib_msgs", - ":geometry_msgs", - ":std_msgs" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "rosgraph_msgs", - exports = [ - "//external:jar/org/ros/rosjava_messages/rosgraph_msgs" - ], - runtime_deps = [ - "//3rdparty/jvm/org/ros/rosjava_bootstrap:message_generation", - ":std_msgs" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "rosjava_test_msgs", - exports = [ - "//external:jar/org/ros/rosjava_messages/rosjava_test_msgs" - ], - runtime_deps = [ - "//3rdparty/jvm/org/ros/rosjava_bootstrap:message_generation", - ":std_msgs" - ], - visibility = [ - "//visibility:public" - ] -) - - - -java_library( - name = "std_msgs", - exports = [ - "//external:jar/org/ros/rosjava_messages/std_msgs" - ], - runtime_deps = [ - "//3rdparty/jvm/org/ros/rosjava_bootstrap:message_generation" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/jvm/xml_apis/BUILD b/3rdparty/jvm/xml_apis/BUILD deleted file mode 100644 index 473c5ce2f3516bc5c06f4714c3b941971d405913..0000000000000000000000000000000000000000 --- a/3rdparty/jvm/xml_apis/BUILD +++ /dev/null @@ -1,12 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. -java_library( - name = "xml_apis", - exports = [ - "//external:jar/xml_apis/xml_apis" - ], - visibility = [ - "//visibility:public" - ] -) - - diff --git a/3rdparty/workspace.bzl b/3rdparty/workspace.bzl deleted file mode 100644 index 15dcd3c44e6b155ab0d74ee0c67b3621c344bdcd..0000000000000000000000000000000000000000 --- a/3rdparty/workspace.bzl +++ /dev/null @@ -1,47 +0,0 @@ -# Do not edit. bazel-deps autogenerates this file from dependencies.yaml. - -def declare_maven(hash): - native.maven_jar( - name = hash["name"], - artifact = hash["artifact"], - sha1 = hash["sha1"], - repository = hash["repository"] - ) - native.bind( - name = hash["bind"], - actual = hash["actual"] - ) - -def list_dependencies(): - return [ - {"artifact": "com.google.code.findbugs:jsr305:1.3.9", "lang": "java", "sha1": "40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf", "repository": "https://jcenter.bintray.com/", "name": "com_google_code_findbugs_jsr305", "actual": "@com_google_code_findbugs_jsr305//jar", "bind": "jar/com/google/code/findbugs/jsr305"}, - {"artifact": "com.google.guava:guava:12.0", "lang": "java", "sha1": "5bc66dd95b79db1e437eb08adba124a3e4088dc0", "repository": "https://jcenter.bintray.com/", "name": "com_google_guava_guava", "actual": "@com_google_guava_guava//jar", "bind": "jar/com/google/guava/guava"}, - {"artifact": "commons-pool:commons-pool:1.6", "lang": "java", "sha1": "4572d589699f09d866a226a14b7f4323c6d8f040", "repository": "https://jcenter.bintray.com/", "name": "commons_pool_commons_pool", "actual": "@commons_pool_commons_pool//jar", "bind": "jar/commons_pool/commons_pool"}, - {"artifact": "dnsjava:dnsjava:2.1.1", "lang": "java", "sha1": "5708df81cf6dbff545695f0be6380b7bbc85accc", "repository": "https://jcenter.bintray.com/", "name": "dnsjava_dnsjava", "actual": "@dnsjava_dnsjava//jar", "bind": "jar/dnsjava/dnsjava"}, - {"artifact": "io.netty:netty:3.5.13.Final", "lang": "java", "sha1": "389edea561995909d5df3e70fb2c49954ac79a54", "repository": "https://jcenter.bintray.com/", "name": "io_netty_netty", "actual": "@io_netty_netty//jar", "bind": "jar/io/netty/netty"}, -# duplicates in junit:junit fixed to 4.8.2 -# - dnsjava:dnsjava:2.1.1 wanted version 3.8.2 -# - org.apache.ws.commons:ws-commons-util:1.0.1 wanted version 3.8.1 - {"artifact": "junit:junit:4.8.2", "lang": "java", "sha1": "c94f54227b08100974c36170dcb53329435fe5ad", "repository": "https://jcenter.bintray.com/", "name": "junit_junit", "actual": "@junit_junit//jar", "bind": "jar/junit/junit"}, - {"artifact": "org.apache.commons:com.springsource.org.apache.commons.codec:1.3.0", "lang": "java", "sha1": "a7c156ef67bdc69ae36a9c70adf7b8ca2633132c", "repository": "https://jcenter.bintray.com/", "name": "org_apache_commons_com_springsource_org_apache_commons_codec", "actual": "@org_apache_commons_com_springsource_org_apache_commons_codec//jar", "bind": "jar/org/apache/commons/com_springsource_org_apache_commons_codec"}, - {"artifact": "org.apache.commons:com.springsource.org.apache.commons.httpclient:3.1.0", "lang": "java", "sha1": "c493a925a091ac3d8f449d9265fe12482dabb2a7", "repository": "https://jcenter.bintray.com/", "name": "org_apache_commons_com_springsource_org_apache_commons_httpclient", "actual": "@org_apache_commons_com_springsource_org_apache_commons_httpclient//jar", "bind": "jar/org/apache/commons/com_springsource_org_apache_commons_httpclient"}, - {"artifact": "org.apache.commons:com.springsource.org.apache.commons.io:1.4.0", "lang": "java", "sha1": "51097cd000ec88214ff181c9f059947de1cf4a35", "repository": "https://jcenter.bintray.com/", "name": "org_apache_commons_com_springsource_org_apache_commons_io", "actual": "@org_apache_commons_com_springsource_org_apache_commons_io//jar", "bind": "jar/org/apache/commons/com_springsource_org_apache_commons_io"}, - {"artifact": "org.apache.commons:com.springsource.org.apache.commons.lang:2.4.0", "lang": "java", "sha1": "686e3713650c8e3a5d98723b4d3e239586bf9822", "repository": "https://jcenter.bintray.com/", "name": "org_apache_commons_com_springsource_org_apache_commons_lang", "actual": "@org_apache_commons_com_springsource_org_apache_commons_lang//jar", "bind": "jar/org/apache/commons/com_springsource_org_apache_commons_lang"}, - {"artifact": "org.apache.commons:com.springsource.org.apache.commons.logging:1.1.1", "lang": "java", "sha1": "7657caf2c78e1d79c74d36f2ae128a115f7cc180", "repository": "https://jcenter.bintray.com/", "name": "org_apache_commons_com_springsource_org_apache_commons_logging", "actual": "@org_apache_commons_com_springsource_org_apache_commons_logging//jar", "bind": "jar/org/apache/commons/com_springsource_org_apache_commons_logging"}, - {"artifact": "org.apache.commons:com.springsource.org.apache.commons.net:2.0.0", "lang": "java", "sha1": "03e78766072ff5a5cf3f5431d973c430c94ec612", "repository": "https://jcenter.bintray.com/", "name": "org_apache_commons_com_springsource_org_apache_commons_net", "actual": "@org_apache_commons_com_springsource_org_apache_commons_net//jar", "bind": "jar/org/apache/commons/com_springsource_org_apache_commons_net"}, - {"artifact": "org.apache.ws.commons:ws-commons-util:1.0.1", "lang": "java", "sha1": "126e80ff798fece634bc94e61f8be8a8da00be60", "repository": "https://jcenter.bintray.com/", "name": "org_apache_ws_commons_ws_commons_util", "actual": "@org_apache_ws_commons_ws_commons_util//jar", "bind": "jar/org/apache/ws/commons/ws_commons_util"}, - {"artifact": "org.mockito:mockito-all:1.8.5", "lang": "java", "sha1": "a927d8ae3b8d22eb745a74f94e59ce3882f2b524", "repository": "https://jcenter.bintray.com/", "name": "org_mockito_mockito_all", "actual": "@org_mockito_mockito_all//jar", "bind": "jar/org/mockito/mockito_all"}, - {"artifact": "org.ros.rosjava_bootstrap:gradle_plugins:0.3.0", "lang": "java", "sha1": "9915d897f3b5049e99b268068978a1bca0ae7b5d", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_bootstrap_gradle_plugins", "actual": "@org_ros_rosjava_bootstrap_gradle_plugins//jar", "bind": "jar/org/ros/rosjava_bootstrap/gradle_plugins"}, - {"artifact": "org.ros.rosjava_bootstrap:message_generation:0.3.0", "lang": "java", "sha1": "5141e448f0ea6a2d6f539219d4fc9b296ff07ca4", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_bootstrap_message_generation", "actual": "@org_ros_rosjava_bootstrap_message_generation//jar", "bind": "jar/org/ros/rosjava_bootstrap/message_generation"}, - {"artifact": "org.ros.rosjava_messages:actionlib_msgs:1.12.5", "lang": "java", "sha1": "aa70fb74bb8812b9f49cf95d4b44570ae8b951ee", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_messages_actionlib_msgs", "actual": "@org_ros_rosjava_messages_actionlib_msgs//jar", "bind": "jar/org/ros/rosjava_messages/actionlib_msgs"}, - {"artifact": "org.ros.rosjava_messages:geometry_msgs:1.12.5", "lang": "java", "sha1": "0cced5d3f1b4f55a4248884befce7e898856705d", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_messages_geometry_msgs", "actual": "@org_ros_rosjava_messages_geometry_msgs//jar", "bind": "jar/org/ros/rosjava_messages/geometry_msgs"}, - {"artifact": "org.ros.rosjava_messages:nav_msgs:1.12.5", "lang": "java", "sha1": "1af629301e0c1e2c5ae5dc5086127d0943f752fb", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_messages_nav_msgs", "actual": "@org_ros_rosjava_messages_nav_msgs//jar", "bind": "jar/org/ros/rosjava_messages/nav_msgs"}, - {"artifact": "org.ros.rosjava_messages:rosgraph_msgs:1.11.2", "lang": "java", "sha1": "adb731dd5181976b23c217872f61c724a3af70fe", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_messages_rosgraph_msgs", "actual": "@org_ros_rosjava_messages_rosgraph_msgs//jar", "bind": "jar/org/ros/rosjava_messages/rosgraph_msgs"}, - {"artifact": "org.ros.rosjava_messages:rosjava_test_msgs:0.3.0", "lang": "java", "sha1": "d81caa572200690bdeadf5c257f0d09d77623c1a", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_messages_rosjava_test_msgs", "actual": "@org_ros_rosjava_messages_rosjava_test_msgs//jar", "bind": "jar/org/ros/rosjava_messages/rosjava_test_msgs"}, - {"artifact": "org.ros.rosjava_messages:std_msgs:0.5.11", "lang": "java", "sha1": "a0191f0506dfecfc471eb199a119691717801c0e", "repository": "https://github.com/rosjava/rosjava_mvn_repo/raw/master", "name": "org_ros_rosjava_messages_std_msgs", "actual": "@org_ros_rosjava_messages_std_msgs//jar", "bind": "jar/org/ros/rosjava_messages/std_msgs"}, - {"artifact": "xml-apis:xml-apis:1.0.b2", "lang": "java", "sha1": "3136ca936f64c9d68529f048c2618bd356bf85c9", "repository": "https://jcenter.bintray.com/", "name": "xml_apis_xml_apis", "actual": "@xml_apis_xml_apis//jar", "bind": "jar/xml_apis/xml_apis"}, - ] - -def maven_dependencies(callback = declare_maven): - for hash in list_dependencies(): - callback(hash) diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 0be0c29135f856bbe9507367542d51d0363e3b56..0000000000000000000000000000000000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################## -# CMake -############################################################################## - -cmake_minimum_required(VERSION 2.8.3) -project(rosjava_core) - -############################################################################## -# Catkin -############################################################################## - -find_package(catkin REQUIRED - rosjava_build_tools - geometry_msgs - nav_msgs - rosjava_test_msgs - rosgraph_msgs - sensor_msgs - tf2_msgs -) - -catkin_rosjava_setup(publish installDist) - -# make sure messages get built first if genjava is enabled -add_dependencies(gradle-${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) - -catkin_package() - -############################################################################## -# Installation -############################################################################## - -install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/rosjava_core/ - DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/rosjava_core) diff --git a/WORKSPACE b/WORKSPACE deleted file mode 100644 index d946ad27218c844b7ff0b97d0a9873e6c5ddeb7a..0000000000000000000000000000000000000000 --- a/WORKSPACE +++ /dev/null @@ -1,9 +0,0 @@ -workspace(name = "com_github_rosjava_rosjava_core") - -load("//3rdparty:workspace.bzl", "maven_dependencies") - -maven_dependencies() - -load("//bazel:repositories.bzl", "rosjava_repositories") - -rosjava_repositories() diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl deleted file mode 100644 index 4a28354ec86f975fca524e3b2ea6a0cedff5e856..0000000000000000000000000000000000000000 --- a/bazel/repositories.bzl +++ /dev/null @@ -1,30 +0,0 @@ -"""External dependencies for rosjava_core, excluding Maven dependencies. - -Maven dependencies must be added to the workspace with bazel-deps. -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def rosjava_repositories(): - _maybe(http_archive, - name = "com_googlesource_gerrit_bazlets", - sha256 = "cdd1a90733cdb71ac4fb86aa6027d3fcad275fe74781175f8437a9c86a0db149", - strip_prefix = "bazlets-4459b9706a6eedb8453a98d4434fb3bc4db84211", - urls = [ - "https://github.com/GerritCodeReview/bazlets/archive/4459b9706a6eedb8453a98d4434fb3bc4db84211.tar.gz", - ], - ) - - _maybe(http_archive, - name = "com_github_rosjava_rosjava_bootstrap", - sha256 = "3c59776a8c6e22232d07f29a686c0e5f401812ec27f59405711657d54a792c08", - strip_prefix = "rosjava_bootstrap-62f865dbe8a7830b21e054dc2a5ac7d2edc6eafe", - urls = [ - "https://github.com/rosjava/rosjava_bootstrap/archive/62f865dbe8a7830b21e054dc2a5ac7d2edc6eafe.tar.gz", - ], - ) - - -def _maybe(repo_rule, name, **kwargs): - if name not in native.existing_rules(): - repo_rule(name=name, **kwargs) diff --git a/build.gradle b/build.gradle index 4f62fac066cbda5b1db8e19a224c9b19d237c833..b2fb55aeb73cc1b8d19c36e931fbff8c3e84b5f4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ task wrapper(type: Wrapper) { } buildscript { - apply from: "https://github.com/rosjava/rosjava_bootstrap/raw/kinetic/buildscript.gradle" + apply from: "buildscript.gradle" } apply plugin: "catkin" diff --git a/buildscript.gradle b/buildscript.gradle new file mode 100644 index 0000000000000000000000000000000000000000..21adffaa262c9b4ed2d278ecefb49e5da021cf12 --- /dev/null +++ b/buildscript.gradle @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2014 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +rootProject.buildscript { + String rosMavenPath = System.getenv("ROS_MAVEN_PATH") + String rosMavenRepository = System.getenv("ROS_MAVEN_REPOSITORY") + repositories { + if (rosMavenPath != null) { + rosMavenPath.tokenize(":").each { path -> + maven { + // We can't use uri() here because we aren't running inside something + // that implements the Script interface. + url "file:${path}" + } + } + } + maven { + url "http://repository.springsource.com/maven/bundles/release" + } + maven { + url "http://repository.springsource.com/maven/bundles/external" + } + if (rosMavenRepository != null) { + maven { + url rosMavenRepository + } + } + maven { + url "https://github.com/rosjava/rosjava_mvn_repo/raw/master" + } + google() + jcenter() + } + dependencies { + classpath "org.ros.rosjava_bootstrap:gradle_plugins:[0.3,0.4)" + } +} diff --git a/dependencies.yaml b/dependencies.yaml deleted file mode 100644 index 9320f2b1c182f7ee8276500e5f3b80c7e5da9e9b..0000000000000000000000000000000000000000 --- a/dependencies.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# If you edit this file, follow these instructions to generate the output -# files: -# -# cd .. -# git clone https://github.com/johnynek/bazel-deps -# cd bazel-deps -# bazel build src/scala/com/github/johnynek/bazel_deps:parseproject_deploy.jar -# cd ../rosjava_core -# ../bazel-deps/gen_maven_deps.sh generate -r $PWD -s 3rdparty/workspace.bzl -d dependencies.yaml - -options: - languages: [ "java" ] - resolvers: - - id: "jcenter" - type: "default" - url: https://jcenter.bintray.com/ - - id: "rosjava_mvn_repo" - type: "default" - url: https://github.com/rosjava/rosjava_mvn_repo/raw/master - resolverCache: bazel_output_base - transitivity: runtime_deps - versionConflictPolicy: highest - buildHeader: - - "# Do not edit. bazel-deps autogenerates this file from dependencies.yaml." - -dependencies: - commons-pool: - commons-pool: - lang: java - version: "1.6" - com.google.guava: - guava: - lang: java - version: "12.0" - dnsjava: - dnsjava: - lang: java - version: "2.1.1" - io.netty: - netty: - lang: java - version: "3.5.13.Final" - junit: - junit: - lang: java - version: "4.8.2" - org.apache.commons: - com.springsource.org.apache.commons.codec: - lang: java - version: "1.3.0" - com.springsource.org.apache.commons.httpclient: - lang: java - version: "3.1.0" - com.springsource.org.apache.commons.io: - lang: java - version: "1.4.0" - com.springsource.org.apache.commons.lang: - lang: java - version: "2.4.0" - com.springsource.org.apache.commons.logging: - lang: java - version: "1.1.1" - com.springsource.org.apache.commons.net: - lang: java - version: "2.0.0" - org.apache.ws.commons: - ws-commons-util: - lang: java - version: "1.0.1" - org.mockito: - mockito-all: - lang: java - version: "1.8.5" - org.ros.rosjava_messages: - nav_msgs: - lang: java - version: "1.12.5" - rosgraph_msgs: - lang: java - version: "1.11.2" - rosjava_test_msgs: - lang: java - version: "0.3.0" - std_msgs: - lang: java - version: "0.5.11" diff --git a/misc/rosjava_formatter.xml b/misc/rosjava_formatter.xml deleted file mode 100644 index 1afde53f4d03a5dbef55d9de45499efbc71048ad..0000000000000000000000000000000000000000 --- a/misc/rosjava_formatter.xml +++ /dev/null @@ -1,279 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<profiles version="11"> -<profile kind="CodeFormatterProfile" name="rosjava" version="11"> -<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> -<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="100"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/> -<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/> -<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/> -<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/> -<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/> -<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/> -<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/> -<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/> -<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> -<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/> -<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> -<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/> -<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/> -</profile> -</profiles> diff --git a/misc/rosjava_import_order.importorder b/misc/rosjava_import_order.importorder deleted file mode 100644 index 1655a2141d125b7a79da96a5145bec74eb1e8ddc..0000000000000000000000000000000000000000 --- a/misc/rosjava_import_order.importorder +++ /dev/null @@ -1,6 +0,0 @@ -#Organize Import Order -#Wed Feb 23 23:44:47 PST 2011 -3=javax -2=java -1= -0=com.google diff --git a/misc/rospack_nosubdirs b/misc/rospack_nosubdirs deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rosjava/build.gradle b/rosjava/build.gradle index 33867f8a4911a16748e9f42a563db78b2cc98d08..31face1892f6fbea250d20adf40df7280a7ead5a 100644 --- a/rosjava/build.gradle +++ b/rosjava/build.gradle @@ -19,17 +19,12 @@ dependencies { compile project(':apache_xmlrpc_server') compile project(':apache_xmlrpc_client') compile 'org.ros.rosjava_bootstrap:message_generation:[0.3,0.4)' - compile 'org.ros.rosjava_messages:rosjava_test_msgs:[0.3,0.4)' compile 'org.ros.rosjava_messages:rosgraph_msgs:[1.11,1.12)' - compile 'org.ros.rosjava_messages:geometry_msgs:[1.12,1.13)' - compile 'org.ros.rosjava_messages:nav_msgs:[1.12,1.13)' compile 'org.ros.rosjava_messages:tf2_msgs:[0.5,0.6)' compile 'dnsjava:dnsjava:2.1.1' compile 'org.apache.commons:com.springsource.org.apache.commons.logging:1.1.1' compile 'org.apache.commons:com.springsource.org.apache.commons.net:2.0.0' compile 'com.google.guava:guava:12.0' - testCompile 'junit:junit:4.8.2' - testCompile 'org.mockito:mockito-all:1.8.5' } jar { diff --git a/rosjava_benchmarks/build.gradle b/rosjava_benchmarks/build.gradle deleted file mode 100644 index 8853d321d032a13da92f5f0e7d5d54fe75a21d87..0000000000000000000000000000000000000000 --- a/rosjava_benchmarks/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -apply plugin: 'application' - -mainClassName = 'org.ros.RosRun' - -dependencies { - compile project(':rosjava') - compile project(':rosjava_geometry') -} diff --git a/rosjava_benchmarks/scripts/pubsub_benchmark.py b/rosjava_benchmarks/scripts/pubsub_benchmark.py deleted file mode 100755 index b669f7712f4dfcc0baf46eabff7e42940eea58c8..0000000000000000000000000000000000000000 --- a/rosjava_benchmarks/scripts/pubsub_benchmark.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2012 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -import threading - -import roslib; roslib.load_manifest('rosjava_benchmarks') -import rospy - -import tf.msg as tf_msgs -import std_msgs.msg as std_msgs - - -class PubsubBenchmark(object): - - def __init__(self): - self.count = itertools.count() - self.time = rospy.Time.now() - self.lock = threading.Lock() - - def callback(self, _): - with self.lock: - self.count.next() - - def run(self): - tf_publisher = rospy.Publisher('tf', tf_msgs.tfMessage) - status_publisher = rospy.Publisher('status', std_msgs.String) - rospy.Subscriber('tf', tf_msgs.tfMessage, self.callback) - while not rospy.is_shutdown(): - tf_publisher.publish(tf_msgs.tfMessage()) - if (rospy.Time.now() - self.time) > rospy.Duration(5): - status_publisher.publish(std_msgs.String('%.2f Hz' % (self.count.next() / 5.0))) - with self.lock: - self.count = itertools.count() - self.time = rospy.Time.now() - - -if __name__ == '__main__': - try: - rospy.init_node('benchmark') - PubsubBenchmark().run() - except rospy.ROSInterruptException: - pass diff --git a/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/MessagesBenchmark.java b/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/MessagesBenchmark.java deleted file mode 100644 index 4ab11ac83c55fd26a37f9c3529291d5ff55ea5f4..0000000000000000000000000000000000000000 --- a/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/MessagesBenchmark.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_benchmarks; - -import org.ros.concurrent.CancellableLoop; -import org.ros.concurrent.Rate; -import org.ros.concurrent.WallTimeRate; -import org.ros.message.Duration; -import org.ros.message.Time; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.topic.Publisher; - -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class MessagesBenchmark extends AbstractNodeMain { - - private final AtomicInteger counter; - - private Time time; - - public MessagesBenchmark() { - counter = new AtomicInteger(); - } - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("messages_benchmark"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - geometry_msgs.TransformStamped message = - connectedNode.getTopicMessageFactory() - .newFromType(geometry_msgs.TransformStamped._TYPE); - message.getHeader().setFrameId("world"); - message.setChildFrameId("turtle"); - message.getHeader().setStamp(connectedNode.getCurrentTime()); - message.getTransform().getRotation().setW(Math.random()); - message.getTransform().getRotation().setX(Math.random()); - message.getTransform().getRotation().setY(Math.random()); - message.getTransform().getRotation().setZ(Math.random()); - message.getTransform().getTranslation().setX(Math.random()); - message.getTransform().getTranslation().setY(Math.random()); - message.getTransform().getTranslation().setZ(Math.random()); - counter.incrementAndGet(); - } - }); - - time = connectedNode.getCurrentTime(); - final Publisher<std_msgs.String> statusPublisher = - connectedNode.newPublisher("status", std_msgs.String._TYPE); - final Rate rate = new WallTimeRate(1); - final std_msgs.String status = statusPublisher.newMessage(); - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - Time now = connectedNode.getCurrentTime(); - Duration delta = now.subtract(time); - if (delta.totalNsecs() > TimeUnit.NANOSECONDS.convert(5, TimeUnit.SECONDS)) { - double hz = counter.getAndSet(0) * 1e9 / delta.totalNsecs(); - status.setData(String.format("%.2f Hz", hz)); - statusPublisher.publish(status); - time = now; - } - rate.sleep(); - } - }); - } -} diff --git a/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/PubsubBenchmark.java b/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/PubsubBenchmark.java deleted file mode 100644 index 4b43ae0ca1daed4230ecd9e5c00aba5409e8b8cc..0000000000000000000000000000000000000000 --- a/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/PubsubBenchmark.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_benchmarks; - -import org.ros.concurrent.CancellableLoop; -import org.ros.concurrent.Rate; -import org.ros.concurrent.WallTimeRate; -import org.ros.message.Duration; -import org.ros.message.MessageListener; -import org.ros.message.Time; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.topic.Publisher; -import org.ros.node.topic.Subscriber; -import tf2_msgs.TFMessage; - -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class PubsubBenchmark extends AbstractNodeMain { - - private final AtomicInteger counter; - - private Publisher<std_msgs.String> statusPublisher; - private Publisher<tf2_msgs.TFMessage> tfPublisher; - private Subscriber<tf2_msgs.TFMessage> tfSubscriber; - private Time time; - - public PubsubBenchmark() { - counter = new AtomicInteger(); - } - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("pubsub_benchmark"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - tfSubscriber = connectedNode.newSubscriber("tf", tf2_msgs.TFMessage._TYPE); - tfSubscriber.addMessageListener(new MessageListener<tf2_msgs.TFMessage>() { - @Override - public void onNewMessage(tf2_msgs.TFMessage message) { - counter.incrementAndGet(); - } - }); - - tfPublisher = connectedNode.newPublisher("tf", tf2_msgs.TFMessage._TYPE); - final tf2_msgs.TFMessage tfMessage = tfPublisher.newMessage(); - geometry_msgs.TransformStamped transformStamped = - connectedNode.getTopicMessageFactory().newFromType(geometry_msgs.TransformStamped._TYPE); - tfMessage.getTransforms().add(transformStamped); - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - tfPublisher.publish(tfMessage); - } - }); - - time = connectedNode.getCurrentTime(); - statusPublisher = connectedNode.newPublisher("status", std_msgs.String._TYPE); - final Rate rate = new WallTimeRate(1); - final std_msgs.String status = statusPublisher.newMessage(); - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - Time now = connectedNode.getCurrentTime(); - Duration delta = now.subtract(time); - if (delta.totalNsecs() > TimeUnit.NANOSECONDS.convert(5, TimeUnit.SECONDS)) { - double hz = counter.getAndSet(0) * 1e9 / delta.totalNsecs(); - status.setData(String.format("%.2f Hz", hz)); - statusPublisher.publish(status); - time = now; - } - rate.sleep(); - } - }); - } -} diff --git a/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/TransformBenchmark.java b/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/TransformBenchmark.java deleted file mode 100644 index 300b70d1312e362df3c0f32d8aa13e7e3b017fec..0000000000000000000000000000000000000000 --- a/rosjava_benchmarks/src/main/java/org/ros/rosjava_benchmarks/TransformBenchmark.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_benchmarks; - -import org.ros.concurrent.CancellableLoop; -import org.ros.concurrent.Rate; -import org.ros.concurrent.WallTimeRate; -import org.ros.message.Duration; -import org.ros.message.Time; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.topic.Publisher; -import org.ros.rosjava_geometry.FrameTransformTree; - -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class TransformBenchmark extends AbstractNodeMain { - - private final AtomicInteger counter; - - private Time time; - - public TransformBenchmark() { - counter = new AtomicInteger(); - } - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("transform_benchmark"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - final geometry_msgs.TransformStamped turtle1 = - connectedNode.getTopicMessageFactory().newFromType(geometry_msgs.TransformStamped._TYPE); - turtle1.getHeader().setFrameId("world"); - turtle1.setChildFrameId("turtle1"); - final geometry_msgs.TransformStamped turtle2 = - connectedNode.getTopicMessageFactory().newFromType(geometry_msgs.TransformStamped._TYPE); - turtle2.getHeader().setFrameId("world"); - turtle2.setChildFrameId("turtle2"); - final FrameTransformTree frameTransformTree = new FrameTransformTree(); - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - updateTransform(turtle1, connectedNode, frameTransformTree); - updateTransform(turtle2, connectedNode, frameTransformTree); - frameTransformTree.transform("turtle1", "turtle2"); - counter.incrementAndGet(); - } - }); - - time = connectedNode.getCurrentTime(); - final Publisher<std_msgs.String> statusPublisher = - connectedNode.newPublisher("status", std_msgs.String._TYPE); - final Rate rate = new WallTimeRate(1); - final std_msgs.String status = statusPublisher.newMessage(); - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - Time now = connectedNode.getCurrentTime(); - Duration delta = now.subtract(time); - if (delta.totalNsecs() > TimeUnit.NANOSECONDS.convert(5, TimeUnit.SECONDS)) { - double hz = counter.getAndSet(0) * 1e9 / delta.totalNsecs(); - status.setData(String.format("%.2f Hz", hz)); - statusPublisher.publish(status); - time = now; - } - rate.sleep(); - } - }); - } - - private void updateTransform(geometry_msgs.TransformStamped transformStamped, - ConnectedNode connectedNode, FrameTransformTree frameTransformTree) { - transformStamped.getHeader().setStamp(connectedNode.getCurrentTime()); - transformStamped.getTransform().getRotation().setW(Math.random()); - transformStamped.getTransform().getRotation().setX(Math.random()); - transformStamped.getTransform().getRotation().setY(Math.random()); - transformStamped.getTransform().getRotation().setZ(Math.random()); - transformStamped.getTransform().getTranslation().setX(Math.random()); - transformStamped.getTransform().getTranslation().setY(Math.random()); - transformStamped.getTransform().getTranslation().setZ(Math.random()); - frameTransformTree.update(transformStamped); - } -} diff --git a/rosjava_geometry/build.gradle b/rosjava_geometry/build.gradle deleted file mode 100644 index e02ee7c6bff3d1e81cb10d98cf40155cc8bbe78a..0000000000000000000000000000000000000000 --- a/rosjava_geometry/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -dependencies { - compile project(':rosjava') - testCompile 'junit:junit:4.8.2' -} diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/FrameTransform.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/FrameTransform.java deleted file mode 100644 index c484d0a80d6518279596de0cfe4c30ca9ea2918e..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/FrameTransform.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import org.ros.message.Time; -import org.ros.namespace.GraphName; - -import com.google.common.base.Preconditions; - -/** - * Describes a {@link Transform} from data in the source frame to data in the - * target frame at a specified {@link Time}. - * - * @author damonkohler@google.com (Damon Kohler) - */ -public class FrameTransform { - - private final Transform transform; - private final GraphName source; - private final GraphName target; - private final Time time; - - public static FrameTransform fromTransformStampedMessage( - geometry_msgs.TransformStamped transformStamped) { - Transform transform = Transform.fromTransformMessage(transformStamped.getTransform()); - String target = transformStamped.getHeader().getFrameId(); - String source = transformStamped.getChildFrameId(); - Time stamp = transformStamped.getHeader().getStamp(); - return new FrameTransform(transform, GraphName.of(source), GraphName.of(target), stamp); - } - - /** - * Allocates a new {@link FrameTransform}. - * - * @param transform - * the {@link Transform} that transforms data in the {@code source} - * frame to data in the {@code target} frame - * @param source - * the source frame - * @param target - * the target frame - * @param time - * the time associated with this {@link FrameTransform}, can be - * {@null} - */ - public FrameTransform(Transform transform, GraphName source, GraphName target, Time time) { - Preconditions.checkNotNull(transform); - Preconditions.checkNotNull(source); - Preconditions.checkNotNull(target); - this.transform = transform; - this.source = source.toRelative(); - this.target = target.toRelative(); - this.time = time; - } - - public Transform getTransform() { - return transform; - } - - public GraphName getSourceFrame() { - return source; - } - - public GraphName getTargetFrame() { - return target; - } - - public FrameTransform invert() { - return new FrameTransform(transform.invert(), target, source, time); - } - - /** - * @return the time associated with the {@link FrameTransform} or {@code null} - * if there is no associated time - */ - public Time getTime() { - return time; - } - - public geometry_msgs.TransformStamped toTransformStampedMessage( - geometry_msgs.TransformStamped result) { - Preconditions.checkNotNull(time); - result.getHeader().setFrameId(target.toString()); - result.getHeader().setStamp(time); - result.setChildFrameId(source.toString()); - transform.toTransformMessage(result.getTransform()); - return result; - } - - @Override - public String toString() { - return String.format("FrameTransform<Source: %s, Target: %s, %s, Time: %s>", source, target, - transform, time); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((source == null) ? 0 : source.hashCode()); - result = prime * result + ((target == null) ? 0 : target.hashCode()); - result = prime * result + ((time == null) ? 0 : time.hashCode()); - result = prime * result + ((transform == null) ? 0 : transform.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - FrameTransform other = (FrameTransform) obj; - if (source == null) { - if (other.source != null) - return false; - } else if (!source.equals(other.source)) - return false; - if (target == null) { - if (other.target != null) - return false; - } else if (!target.equals(other.target)) - return false; - if (time == null) { - if (other.time != null) - return false; - } else if (!time.equals(other.time)) - return false; - if (transform == null) { - if (other.transform != null) - return false; - } else if (!transform.equals(other.transform)) - return false; - return true; - } -} diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/FrameTransformTree.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/FrameTransformTree.java deleted file mode 100644 index 2bc3dda252a060ab83a55e7aec1b1663ab57312d..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/FrameTransformTree.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; -import com.google.common.collect.Maps; - -import geometry_msgs.TransformStamped; -import org.ros.concurrent.CircularBlockingDeque; -import org.ros.message.Time; -import org.ros.namespace.GraphName; - -import java.util.Map; - -/** - * A tree of {@link FrameTransform}s. - * <p> - * {@link FrameTransformTree} does not currently support time travel. Lookups - * always use the newest {@link TransformStamped}. - * - * @author damonkohler@google.com (Damon Kohler) - * @author moesenle@google.com (Lorenz Moesenlechner) - */ -public class FrameTransformTree { - - private static final int TRANSFORM_QUEUE_CAPACITY = 16; - - private final Object mutex; - - /** - * A {@link Map} of the most recent {@link LazyFrameTransform} by source - * frame. Lookups by target frame or by the pair of source and target are both - * unnecessary because every frame can only have exactly one target. - */ - private final Map<GraphName, CircularBlockingDeque<LazyFrameTransform>> transforms; - - public FrameTransformTree() { - mutex = new Object(); - transforms = Maps.newConcurrentMap(); - } - - /** - * Updates the tree with the provided {@link geometry_msgs.TransformStamped} - * message. - * <p> - * Note that the tree is updated lazily. Modifications to the provided - * {@link geometry_msgs.TransformStamped} message may cause unpredictable - * results. - * - * @param transformStamped - * the {@link geometry_msgs.TransformStamped} message to update with - */ - public void update(geometry_msgs.TransformStamped transformStamped) { - Preconditions.checkNotNull(transformStamped); - GraphName source = GraphName.of(transformStamped.getChildFrameId()); - LazyFrameTransform lazyFrameTransform = new LazyFrameTransform(transformStamped); - add(source, lazyFrameTransform); - } - - @VisibleForTesting - void update(FrameTransform frameTransform) { - Preconditions.checkNotNull(frameTransform); - GraphName source = frameTransform.getSourceFrame(); - LazyFrameTransform lazyFrameTransform = new LazyFrameTransform(frameTransform); - add(source, lazyFrameTransform); - } - - private void add(GraphName source, LazyFrameTransform lazyFrameTransform) { - // This adds support for tf2 while maintaining backward compatibility with tf. - GraphName relativeSource = source.toRelative(); - if (!transforms.containsKey(relativeSource)) { - transforms.put(relativeSource, new CircularBlockingDeque<LazyFrameTransform>( - TRANSFORM_QUEUE_CAPACITY)); - } - synchronized (mutex) { - transforms.get(relativeSource).addFirst(lazyFrameTransform); - } - } - - /** - * Returns the most recent {@link FrameTransform} for target {@code source}. - * - * @param source - * the frame to look up - * @return the most recent {@link FrameTransform} for {@code source} or - * {@code null} if no transform for {@code source} is available - */ - public FrameTransform lookUp(GraphName source) { - Preconditions.checkNotNull(source); - // This adds support for tf2 while maintaining backward compatibility with tf. - return getLatest(source.toRelative()); - } - - private FrameTransform getLatest(GraphName source) { - CircularBlockingDeque<LazyFrameTransform> deque = transforms.get(source); - if (deque == null) { - return null; - } - LazyFrameTransform lazyFrameTransform = deque.peekFirst(); - if (lazyFrameTransform == null) { - return null; - } - return lazyFrameTransform.get(); - } - - /** - * @see #lookUp(GraphName) - */ - public FrameTransform get(String source) { - Preconditions.checkNotNull(source); - return lookUp(GraphName.of(source)); - } - - /** - * Returns the {@link FrameTransform} for {@code source} closest to - * {@code time}. - * - * @param source - * the frame to look up - * @param time - * the transform for {@code frame} closest to this {@link Time} will - * be returned - * @return the most recent {@link FrameTransform} for {@code source} or - * {@code null} if no transform for {@code source} is available - */ - public FrameTransform lookUp(GraphName source, Time time) { - Preconditions.checkNotNull(source); - Preconditions.checkNotNull(time); - return get(source, time); - } - - // TODO(damonkohler): Use an efficient search. - private FrameTransform get(GraphName source, Time time) { - CircularBlockingDeque<LazyFrameTransform> deque = transforms.get(source); - if (deque == null) { - return null; - } - LazyFrameTransform result = null; - synchronized (mutex) { - long offset = 0; - for (LazyFrameTransform lazyFrameTransform : deque) { - if (result == null) { - result = lazyFrameTransform; - offset = Math.abs(time.subtract(result.get().getTime()).totalNsecs()); - continue; - } - long newOffset = Math.abs(time.subtract(lazyFrameTransform.get().getTime()).totalNsecs()); - if (newOffset < offset) { - result = lazyFrameTransform; - offset = newOffset; - } - } - } - if (result == null) { - return null; - } - return result.get(); - } - - /** - * @see #lookUp(GraphName, Time) - */ - public FrameTransform get(String source, Time time) { - Preconditions.checkNotNull(source); - return lookUp(GraphName.of(source), time); - } - - /** - * @return the {@link FrameTransform} from source the frame to the target - * frame, or {@code null} if no {@link FrameTransform} could be found - */ - public FrameTransform transform(GraphName source, GraphName target) { - Preconditions.checkNotNull(source); - Preconditions.checkNotNull(target); - // This adds support for tf2 while maintaining backward compatibility with tf. - GraphName relativeSource = source.toRelative(); - GraphName relativeTarget = target.toRelative(); - if (relativeSource.equals(relativeTarget)) { - return new FrameTransform(Transform.identity(), relativeSource, relativeTarget, null); - } - FrameTransform sourceToRoot = transformToRoot(relativeSource); - FrameTransform targetToRoot = transformToRoot(relativeTarget); - if (sourceToRoot == null && targetToRoot == null) { - return null; - } - if (sourceToRoot == null) { - if (targetToRoot.getTargetFrame().equals(relativeSource)) { - // relativeSource is root. - return targetToRoot.invert(); - } else { - return null; - } - } - if (targetToRoot == null) { - if (sourceToRoot.getTargetFrame().equals(relativeTarget)) { - // relativeTarget is root. - return sourceToRoot; - } else { - return null; - } - } - if (sourceToRoot.getTargetFrame().equals(targetToRoot.getTargetFrame())) { - // Neither relativeSource nor relativeTarget is root and both share the - // same root. - Transform transform = - targetToRoot.getTransform().invert().multiply(sourceToRoot.getTransform()); - return new FrameTransform(transform, relativeSource, relativeTarget, sourceToRoot.getTime()); - } - // No known transform. - return null; - } - - /** - * @see #transform(GraphName, GraphName) - */ - public FrameTransform transform(String source, String target) { - Preconditions.checkNotNull(source); - Preconditions.checkNotNull(target); - return transform(GraphName.of(source), GraphName.of(target)); - } - - /** - * @param source - * the source frame - * @return the {@link Transform} from {@code source} to root - */ - @VisibleForTesting - FrameTransform transformToRoot(GraphName source) { - FrameTransform result = getLatest(source); - if (result == null) { - return null; - } - while (true) { - FrameTransform resultToParent = lookUp(result.getTargetFrame(), result.getTime()); - if (resultToParent == null) { - return result; - } - // Now resultToParent.getSourceFrame() == result.getTargetFrame() - Transform transform = resultToParent.getTransform().multiply(result.getTransform()); - GraphName target = resultToParent.getTargetFrame(); - result = new FrameTransform(transform, source, target, result.getTime()); - } - } -} diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/LazyFrameTransform.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/LazyFrameTransform.java deleted file mode 100644 index acf378e0ed16503164c534bdd8b1094d51009aad..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/LazyFrameTransform.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import com.google.common.annotations.VisibleForTesting; - -/** - * Lazily converts a {@link geometry_msgs.Transform} message to a - * {@link Transform} on the first call to {@link #get()} and caches the result. - * <p> - * This class is thread-safe. - * - * @author damonkohler@google.com (Damon Kohler) - */ -public class LazyFrameTransform { - - private final geometry_msgs.TransformStamped message; - - // Avoiding constructor code duplication. - private final Object mutex = new Object(); - - private FrameTransform frameTransform; - - public LazyFrameTransform(geometry_msgs.TransformStamped message) { - this.message = message; - } - - @VisibleForTesting - LazyFrameTransform(FrameTransform frameTransform) { - message = null; - this.frameTransform = frameTransform; - } - - /** - * @return the {@link FrameTransform} for the wrapped - * {@link geometry_msgs.TransformStamped} message - */ - public FrameTransform get() { - synchronized (mutex) { - if (frameTransform != null) { - return frameTransform; - } - frameTransform = FrameTransform.fromTransformStampedMessage(message); - } - return frameTransform; - } -} \ No newline at end of file diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Quaternion.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Quaternion.java deleted file mode 100644 index b4c7e72e5ab3a7678b17822bb67b073dd5a1a112..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Quaternion.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import com.google.common.base.Preconditions; -import com.google.common.collect.Lists; - -import java.util.List; - -/** - * A quaternion. - * - * @author damonkohler@google.com (Damon Kohler) - * @author moesenle@google.com (Lorenz Moesenlechner) - */ -public class Quaternion { - - private final double x; - private final double y; - private final double z; - private final double w; - - public static Quaternion fromAxisAngle(Vector3 axis, double angle) { - Vector3 normalized = axis.normalize(); - double sin = Math.sin(angle / 2.0d); - double cos = Math.cos(angle / 2.0d); - return new Quaternion(normalized.getX() * sin, normalized.getY() * sin, - normalized.getZ() * sin, cos); - } - - public static Quaternion fromQuaternionMessage(geometry_msgs.Quaternion message) { - return new Quaternion(message.getX(), message.getY(), message.getZ(), message.getW()); - } - - public static Quaternion rotationBetweenVectors(Vector3 vector1, Vector3 vector2) { - Preconditions.checkArgument(vector1.getMagnitude() > 0, - "Cannot calculate rotation between zero-length vectors."); - Preconditions.checkArgument(vector2.getMagnitude() > 0, - "Cannot calculate rotation between zero-length vectors."); - if (vector1.normalize().equals(vector2.normalize())) { - return identity(); - } - double angle = - Math.acos(vector1.dotProduct(vector2) / (vector1.getMagnitude() * vector2.getMagnitude())); - double axisX = vector1.getY() * vector2.getZ() - vector1.getZ() * vector2.getY(); - double axisY = vector1.getZ() * vector2.getX() - vector1.getX() * vector2.getZ(); - double axisZ = vector1.getX() * vector2.getY() - vector1.getY() * vector2.getX(); - return fromAxisAngle(new Vector3(axisX, axisY, axisZ), angle); - } - - public static Quaternion identity() { - return new Quaternion(0, 0, 0, 1); - } - - public Quaternion(double x, double y, double z, double w) { - this.x = x; - this.y = y; - this.z = z; - this.w = w; - } - - public Quaternion scale(double factor) { - return new Quaternion(x * factor, y * factor, z * factor, w * factor); - } - - public Quaternion conjugate() { - return new Quaternion(-x, -y, -z, w); - } - - public Quaternion invert() { - double mm = getMagnitudeSquared(); - Preconditions.checkState(mm != 0); - return conjugate().scale(1 / mm); - } - - public Quaternion normalize() { - return scale(1 / getMagnitude()); - } - - public Quaternion multiply(Quaternion other) { - return new Quaternion(w * other.x + x * other.w + y * other.z - z * other.y, w * other.y + y - * other.w + z * other.x - x * other.z, w * other.z + z * other.w + x * other.y - y - * other.x, w * other.w - x * other.x - y * other.y - z * other.z); - } - - public Vector3 rotateAndScaleVector(Vector3 vector) { - Quaternion vectorQuaternion = new Quaternion(vector.getX(), vector.getY(), vector.getZ(), 0); - Quaternion rotatedQuaternion = multiply(vectorQuaternion.multiply(conjugate())); - return new Vector3(rotatedQuaternion.getX(), rotatedQuaternion.getY(), rotatedQuaternion.getZ()); - } - - public double getX() { - return x; - } - - public double getY() { - return y; - } - - public double getZ() { - return z; - } - - public double getW() { - return w; - } - - public double getMagnitudeSquared() { - return x * x + y * y + z * z + w * w; - } - - public double getMagnitude() { - return Math.sqrt(getMagnitudeSquared()); - } - - public boolean isAlmostNeutral(double epsilon) { - return Math.abs(1 - x * x - y * y - z * z - w * w) < epsilon; - } - - public geometry_msgs.Quaternion toQuaternionMessage(geometry_msgs.Quaternion result) { - result.setX(x); - result.setY(y); - result.setZ(z); - result.setW(w); - return result; - } - - public boolean almostEquals(Quaternion other, double epsilon) { - List<Double> epsilons = Lists.newArrayList(); - epsilons.add(x - other.x); - epsilons.add(y - other.y); - epsilons.add(z - other.z); - epsilons.add(w - other.w); - for (double e : epsilons) { - if (Math.abs(e) > epsilon) { - return false; - } - } - return true; - } - - @Override - public String toString() { - return String.format("Quaternion<x: %.4f, y: %.4f, z: %.4f, w: %.4f>", x, y, z, w); - } - - @Override - public int hashCode() { - // Ensure that -0 and 0 are considered equal. - double w = this.w == 0 ? 0 : this.w; - double x = this.x == 0 ? 0 : this.x; - double y = this.y == 0 ? 0 : this.y; - double z = this.z == 0 ? 0 : this.z; - final int prime = 31; - int result = 1; - long temp; - temp = Double.doubleToLongBits(w); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(x); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(y); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(z); - result = prime * result + (int) (temp ^ (temp >>> 32)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Quaternion other = (Quaternion) obj; - // Ensure that -0 and 0 are considered equal. - double w = this.w == 0 ? 0 : this.w; - double x = this.x == 0 ? 0 : this.x; - double y = this.y == 0 ? 0 : this.y; - double z = this.z == 0 ? 0 : this.z; - double otherW = other.w == 0 ? 0 : other.w; - double otherX = other.x == 0 ? 0 : other.x; - double otherY = other.y == 0 ? 0 : other.y; - double otherZ = other.z == 0 ? 0 : other.z; - if (Double.doubleToLongBits(w) != Double.doubleToLongBits(otherW)) - return false; - if (Double.doubleToLongBits(x) != Double.doubleToLongBits(otherX)) - return false; - if (Double.doubleToLongBits(y) != Double.doubleToLongBits(otherY)) - return false; - if (Double.doubleToLongBits(z) != Double.doubleToLongBits(otherZ)) - return false; - return true; - } -} diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Transform.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Transform.java deleted file mode 100644 index c79c141590202abb7917b47a9b0f563cd0ebae88..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Transform.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import org.ros.message.Time; -import org.ros.namespace.GraphName; - -/** - * A transformation in terms of translation, rotation, and scale. - * - * @author damonkohler@google.com (Damon Kohler) - * @author moesenle@google.com (Lorenz Moesenlechner) - */ -public class Transform { - - private Vector3 translation; - private Quaternion rotationAndScale; - - public static Transform fromTransformMessage(geometry_msgs.Transform message) { - return new Transform(Vector3.fromVector3Message(message.getTranslation()), - Quaternion.fromQuaternionMessage(message.getRotation())); - } - - public static Transform fromPoseMessage(geometry_msgs.Pose message) { - return new Transform(Vector3.fromPointMessage(message.getPosition()), - Quaternion.fromQuaternionMessage(message.getOrientation())); - } - - public static Transform identity() { - return new Transform(Vector3.zero(), Quaternion.identity()); - } - - public static Transform xRotation(double angle) { - return new Transform(Vector3.zero(), Quaternion.fromAxisAngle(Vector3.xAxis(), angle)); - } - - public static Transform yRotation(double angle) { - return new Transform(Vector3.zero(), Quaternion.fromAxisAngle(Vector3.yAxis(), angle)); - } - - public static Transform zRotation(double angle) { - return new Transform(Vector3.zero(), Quaternion.fromAxisAngle(Vector3.zAxis(), angle)); - } - - public static Transform translation(double x, double y, double z) { - return new Transform(new Vector3(x, y, z), Quaternion.identity()); - } - - public static Transform translation(Vector3 vector) { - return new Transform(vector, Quaternion.identity()); - } - - public Transform(Vector3 translation, Quaternion rotation) { - this.translation = translation; - this.rotationAndScale = rotation; - } - - /** - * Apply another {@link Transform} to this {@link Transform}. - * - * @param other - * the {@link Transform} to apply to this {@link Transform} - * @return the resulting {@link Transform} - */ - public Transform multiply(Transform other) { - return new Transform(apply(other.translation), apply(other.rotationAndScale)); - } - - public Transform invert() { - Quaternion inverseRotationAndScale = rotationAndScale.invert(); - return new Transform(inverseRotationAndScale.rotateAndScaleVector(translation.invert()), - inverseRotationAndScale); - } - - public Vector3 apply(Vector3 vector) { - return rotationAndScale.rotateAndScaleVector(vector).add(translation); - } - - public Quaternion apply(Quaternion quaternion) { - return rotationAndScale.multiply(quaternion); - } - - public Transform scale(double factor) { - return new Transform(translation, rotationAndScale.scale(Math.sqrt(factor))); - } - - public double getScale() { - return rotationAndScale.getMagnitudeSquared(); - } - - /** - * @see <a - * href="http://en.wikipedia.org/wiki/Rotation_matrix#Quaternion">Quaternion - * rotation matrix</a> - */ - public double[] toMatrix() { - double x = rotationAndScale.getX(); - double y = rotationAndScale.getY(); - double z = rotationAndScale.getZ(); - double w = rotationAndScale.getW(); - double mm = rotationAndScale.getMagnitudeSquared(); - return new double[] { mm - 2 * y * y - 2 * z * z, 2 * x * y + 2 * z * w, 2 * x * z - 2 * y * w, - 0, 2 * x * y - 2 * z * w, mm - 2 * x * x - 2 * z * z, 2 * y * z + 2 * x * w, 0, - 2 * x * z + 2 * y * w, 2 * y * z - 2 * x * w, mm - 2 * x * x - 2 * y * y, 0, - translation.getX(), translation.getY(), translation.getZ(), 1 }; - } - - public geometry_msgs.Transform toTransformMessage(geometry_msgs.Transform result) { - result.setTranslation(translation.toVector3Message(result.getTranslation())); - result.setRotation(rotationAndScale.toQuaternionMessage(result.getRotation())); - return result; - } - - public geometry_msgs.Pose toPoseMessage(geometry_msgs.Pose result) { - result.setPosition(translation.toPointMessage(result.getPosition())); - result.setOrientation(rotationAndScale.toQuaternionMessage(result.getOrientation())); - return result; - } - - public geometry_msgs.PoseStamped toPoseStampedMessage(GraphName frame, Time stamp, - geometry_msgs.PoseStamped result) { - result.getHeader().setFrameId(frame.toString()); - result.getHeader().setStamp(stamp); - result.setPose(toPoseMessage(result.getPose())); - return result; - } - - public boolean almostEquals(Transform other, double epsilon) { - return translation.almostEquals(other.translation, epsilon) - && rotationAndScale.almostEquals(other.rotationAndScale, epsilon); - } - - public Vector3 getTranslation() { - return translation; - } - - public Quaternion getRotationAndScale() { - return rotationAndScale; - } - - @Override - public String toString() { - return String.format("Transform<%s, %s>", translation, rotationAndScale); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((rotationAndScale == null) ? 0 : rotationAndScale.hashCode()); - result = prime * result + ((translation == null) ? 0 : translation.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Transform other = (Transform) obj; - if (rotationAndScale == null) { - if (other.rotationAndScale != null) - return false; - } else if (!rotationAndScale.equals(other.rotationAndScale)) - return false; - if (translation == null) { - if (other.translation != null) - return false; - } else if (!translation.equals(other.translation)) - return false; - return true; - } -} diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Vector3.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Vector3.java deleted file mode 100644 index b5c84ebf330962f05b6949dcbe2706f2c4dcca5f..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/Vector3.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import com.google.common.collect.Lists; - -import java.util.List; - -/** - * A three dimensional vector. - * - * @author damonkohler@google.com (Damon Kohler) - * @author moesenle@google.com (Lorenz Moesenlechner) - */ -public class Vector3 { - - private static final Vector3 ZERO = new Vector3(0, 0, 0); - private static final Vector3 X_AXIS = new Vector3(1, 0, 0); - private static final Vector3 Y_AXIS = new Vector3(0, 1, 0); - private static final Vector3 Z_AXIS = new Vector3(0, 0, 1); - - private final double x; - private final double y; - private final double z; - - public static Vector3 fromVector3Message(geometry_msgs.Vector3 message) { - return new Vector3(message.getX(), message.getY(), message.getZ()); - } - - public static Vector3 fromPointMessage(geometry_msgs.Point message) { - return new Vector3(message.getX(), message.getY(), message.getZ()); - } - - public static Vector3 zero() { - return ZERO; - } - - public static Vector3 xAxis() { - return X_AXIS; - } - - public static Vector3 yAxis() { - return Y_AXIS; - } - - public static Vector3 zAxis() { - return Z_AXIS; - } - - public Vector3(double x, double y, double z) { - this.x = x; - this.y = y; - this.z = z; - } - - public Vector3 add(Vector3 other) { - return new Vector3(x + other.x, y + other.y, z + other.z); - } - - public Vector3 subtract(Vector3 other) { - return new Vector3(x - other.x, y - other.y, z - other.z); - } - - public Vector3 invert() { - return new Vector3(-x, -y, -z); - } - - public double dotProduct(Vector3 other) { - return x * other.x + y * other.y + z * other.z; - } - - public Vector3 normalize() { - return new Vector3(x / getMagnitude(), y / getMagnitude(), z / getMagnitude()); - } - - public Vector3 scale(double factor) { - return new Vector3(x * factor, y * factor, z * factor); - } - - public double getX() { - return x; - } - - public double getY() { - return y; - } - - public double getZ() { - return z; - } - - public double getMagnitudeSquared() { - return x * x + y * y + z * z; - } - - public double getMagnitude() { - return Math.sqrt(getMagnitudeSquared()); - } - - public geometry_msgs.Vector3 toVector3Message(geometry_msgs.Vector3 result) { - result.setX(x); - result.setY(y); - result.setZ(z); - return result; - } - - public geometry_msgs.Point toPointMessage(geometry_msgs.Point result) { - result.setX(x); - result.setY(y); - result.setZ(z); - return result; - } - - public boolean almostEquals(Vector3 other, double epsilon) { - List<Double> epsilons = Lists.newArrayList(); - epsilons.add(x - other.x); - epsilons.add(y - other.y); - epsilons.add(z - other.z); - for (double e : epsilons) { - if (Math.abs(e) > epsilon) { - return false; - } - } - return true; - } - - @Override - public String toString() { - return String.format("Vector3<x: %.4f, y: %.4f, z: %.4f>", x, y, z); - } - - @Override - public int hashCode() { - // Ensure that -0 and 0 are considered equal. - double x = this.x == 0 ? 0 : this.x; - double y = this.y == 0 ? 0 : this.y; - double z = this.z == 0 ? 0 : this.z; - final int prime = 31; - int result = 1; - long temp; - temp = Double.doubleToLongBits(x); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(y); - result = prime * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(z); - result = prime * result + (int) (temp ^ (temp >>> 32)); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Vector3 other = (Vector3) obj; - // Ensure that -0 and 0 are considered equal. - double x = this.x == 0 ? 0 : this.x; - double y = this.y == 0 ? 0 : this.y; - double z = this.z == 0 ? 0 : this.z; - double otherX = other.x == 0 ? 0 : other.x; - double otherY = other.y == 0 ? 0 : other.y; - double otherZ = other.z == 0 ? 0 : other.z; - if (Double.doubleToLongBits(x) != Double.doubleToLongBits(otherX)) - return false; - if (Double.doubleToLongBits(y) != Double.doubleToLongBits(otherY)) - return false; - if (Double.doubleToLongBits(z) != Double.doubleToLongBits(otherZ)) - return false; - return true; - } -} diff --git a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/package-info.java b/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/package-info.java deleted file mode 100644 index e66a3a4b54a7a411877c8386102be2947cb7b8b1..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/main/java/org/ros/rosjava_geometry/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -/** - * Provides the classes for common geometry operations and representations (e.g. transformations). - */ -package org.ros.rosjava_geometry; \ No newline at end of file diff --git a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/FrameTransformTreeTest.java b/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/FrameTransformTreeTest.java deleted file mode 100644 index bbcdfacbcb9ae472ae6c1e0eced42117bf33c117..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/FrameTransformTreeTest.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Before; -import org.junit.Test; -import org.ros.internal.message.DefaultMessageFactory; -import org.ros.internal.message.definition.MessageDefinitionReflectionProvider; -import org.ros.message.MessageDefinitionProvider; -import org.ros.message.MessageFactory; -import org.ros.message.Time; -import org.ros.namespace.GraphName; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class FrameTransformTreeTest { - - private FrameTransformTree frameTransformTree; - private MessageDefinitionProvider messageDefinitionProvider; - private MessageFactory messageFactory; - - @Before - public void before() { - frameTransformTree = new FrameTransformTree(); - messageDefinitionProvider = new MessageDefinitionReflectionProvider(); - messageFactory = new DefaultMessageFactory(messageDefinitionProvider); - } - - @Test - public void testUpdateAndGet() { - FrameTransform frameTransform = new FrameTransform(Transform.identity(), - GraphName.of("foo"), GraphName.of("bar"), new Time()); - frameTransformTree.update(frameTransform); - assertEquals(frameTransform, frameTransformTree.get("foo")); - } - - @Test - public void testUpdateAndGetWithTransformStampedMessage() { - FrameTransform frameTransform = new FrameTransform(Transform.identity(), - GraphName.of("foo"), GraphName.of("bar"), new Time()); - frameTransformTree.update(newTransformStampedMessage(Transform.identity(), - "foo", "bar", new Time())); - assertEquals(frameTransform, frameTransformTree.get("foo")); - } - - private geometry_msgs.TransformStamped newTransformStampedMessage( - Transform transform, String source, String target, Time time) { - geometry_msgs.TransformStamped message = messageFactory - .newFromType(geometry_msgs.TransformStamped._TYPE); - FrameTransform frameTransform = new FrameTransform(transform, - GraphName.of(source), GraphName.of(target), time); - frameTransform.toTransformStampedMessage(message); - return message; - } - - @Test - public void testIdentityTransforms() { - frameTransformTree.update(newTransformStampedMessage(Transform.identity(), - "baz", "bar", new Time())); - frameTransformTree.update(newTransformStampedMessage(Transform.identity(), - "bar", "foo", new Time())); - - // Full tree transform. - { - FrameTransform frameTransform = frameTransformTree - .transform("baz", "foo"); - assertTrue(frameTransform != null); - assertEquals(GraphName.of("baz"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("foo"), frameTransform.getTargetFrame()); - assertEquals(Transform.identity(), frameTransform.getTransform()); - } - - // Same node transform. - { - FrameTransform frameTransform = frameTransformTree - .transform("baz", "baz"); - assertTrue(frameTransform != null); - assertEquals(GraphName.of("baz"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("baz"), frameTransform.getTargetFrame()); - assertEquals(Transform.identity(), frameTransform.getTransform()); - } - - // Same node transform. - { - FrameTransform frameTransform = frameTransformTree - .transform("bar", "bar"); - assertTrue(frameTransform != null); - assertEquals(GraphName.of("bar"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("bar"), frameTransform.getTargetFrame()); - assertEquals(Transform.identity(), frameTransform.getTransform()); - } - - // Root-to-root transform. - { - FrameTransform frameTransform = frameTransformTree - .transform("foo", "foo"); - assertTrue(frameTransform != null); - assertEquals(GraphName.of("foo"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("foo"), frameTransform.getTargetFrame()); - assertEquals(Transform.identity(), frameTransform.getTransform()); - } - - // Root-to-leaf transform. - { - FrameTransform frameTransform = frameTransformTree - .transform("foo", "baz"); - assertTrue(frameTransform != null); - assertEquals(GraphName.of("foo"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("baz"), frameTransform.getTargetFrame()); - assertEquals(Transform.identity(), frameTransform.getTransform()); - } - } - - /** - * Fills the {@link FrameTransformTree} with the following frame topography: - * - * <pre> - * foo - * bar bop - * baz fuz - * </pre> - */ - private void updateFrameTransformTree() { - { - Transform transform = Transform.translation(0, 1, 0); - frameTransformTree.update(newTransformStampedMessage(transform, "bar", - "foo", new Time())); - } - { - Transform transform = Transform.xRotation(Math.PI / 2); - frameTransformTree.update(newTransformStampedMessage(transform, "baz", - "bar", new Time())); - } - { - Transform transform = Transform.translation(1, 0, 0); - frameTransformTree.update(newTransformStampedMessage(transform, "bop", - "foo", new Time())); - } - { - Transform transform = Transform.yRotation(Math.PI / 2); - frameTransformTree.update(newTransformStampedMessage(transform, "fuz", - "bop", new Time())); - } - } - - private void checkBazToFooTransform(FrameTransform frameTransform) { - // If we were to reverse the order of the transforms in our implementation, - // we would expect the translation vector to be <0, 0, 1> instead. - Transform transform = Transform.translation(0, 1, 0).multiply( - Transform.xRotation(Math.PI / 2)); - Quaternion rotationAndScale = transform.getRotationAndScale(); - assertTrue(String.format("%s is not neutral.", rotationAndScale), - rotationAndScale.isAlmostNeutral(1e-9)); - assertEquals(GraphName.of("baz"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("foo"), frameTransform.getTargetFrame()); - assertTrue(transform.almostEquals(frameTransform.getTransform(), 1e-9)); - } - - @Test - public void testTransformBazToRoot() { - updateFrameTransformTree(); - checkBazToFooTransform(frameTransformTree.transformToRoot(GraphName - .of("baz"))); - } - - @Test - public void testTransformBazToFoo() { - updateFrameTransformTree(); - checkBazToFooTransform(frameTransformTree.transform("baz", "foo")); - checkBazToFooTransform(frameTransformTree.transform("foo", "baz").invert()); - } - - private void checkFuzToFooTransform(FrameTransform frameTransform) { - // If we were to reverse the order of the transforms in our implementation, - // we would expect the translation vector to be <0, 0, 1> instead. - Transform transform = Transform.translation(1, 0, 0).multiply( - Transform.yRotation(Math.PI / 2)); - Quaternion rotationAndScale = transform.getRotationAndScale(); - assertTrue(String.format("%s is not neutral.", rotationAndScale), - rotationAndScale.isAlmostNeutral(1e-9)); - assertEquals(GraphName.of("fuz"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("foo"), frameTransform.getTargetFrame()); - assertTrue( - String.format("Expected %s != %s", transform, - frameTransform.getTransform()), - transform.almostEquals(frameTransform.getTransform(), 1e-9)); - } - - @Test - public void testTransformFuzToRoot() { - updateFrameTransformTree(); - checkFuzToFooTransform(frameTransformTree.transformToRoot(GraphName - .of("fuz"))); - } - - @Test - public void testTransformFuzToFoo() { - updateFrameTransformTree(); - checkFuzToFooTransform(frameTransformTree.transform("fuz", "foo")); - checkFuzToFooTransform(frameTransformTree.transform("foo", "fuz").invert()); - } - - @Test - public void testTransformBazToFuz() { - updateFrameTransformTree(); - FrameTransform frameTransform = frameTransformTree.transform("baz", "fuz"); - Transform transform = Transform.yRotation(Math.PI / 2).invert() - .multiply(Transform.translation(1, 0, 0).invert()) - .multiply(Transform.translation(0, 1, 0)) - .multiply(Transform.xRotation(Math.PI / 2)); - assertTrue(transform.getRotationAndScale().isAlmostNeutral(1e-9)); - assertEquals(GraphName.of("baz"), frameTransform.getSourceFrame()); - assertEquals(GraphName.of("fuz"), frameTransform.getTargetFrame()); - assertTrue( - String.format("Expected %s != %s", transform, - frameTransform.getTransform()), - transform.almostEquals(frameTransform.getTransform(), 1e-9)); - } - - @Test - public void testTimeTravel() { - FrameTransform frameTransform1 = new FrameTransform(Transform.identity(), - GraphName.of("foo"), GraphName.of("bar"), new Time()); - FrameTransform frameTransform2 = new FrameTransform(Transform.identity(), - GraphName.of("foo"), GraphName.of("bar"), new Time(2)); - FrameTransform frameTransform3 = new FrameTransform(Transform.identity(), - GraphName.of("foo"), GraphName.of("bar"), new Time(4)); - frameTransformTree.update(frameTransform1); - frameTransformTree.update(frameTransform2); - frameTransformTree.update(frameTransform3); - assertEquals(frameTransform3, frameTransformTree.get("foo")); - assertEquals(frameTransform1, frameTransformTree.get("foo", new Time())); - assertEquals(frameTransform1, frameTransformTree.get("foo", new Time(0.5))); - assertEquals(frameTransform2, frameTransformTree.get("foo", new Time(1.5))); - assertEquals(frameTransform2, frameTransformTree.get("foo", new Time(2))); - assertEquals(frameTransform3, frameTransformTree.get("foo", new Time(10))); - } -} diff --git a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/QuaternionTest.java b/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/QuaternionTest.java deleted file mode 100644 index 5a2717c6437dc02a5ded54ad2a507636ea0140f1..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/QuaternionTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class QuaternionTest { - - @Test - public void testAxisAngleToQuaternion() { - Quaternion quaternion; - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), 0); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(0, quaternion.getZ(), 1e-9); - assertEquals(1, quaternion.getW(), 1e-9); - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(1, quaternion.getZ(), 1e-9); - assertEquals(0, quaternion.getW(), 1e-9); - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI / 2); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(0.7071067811865475, quaternion.getZ(), 1e-9); - assertEquals(0.7071067811865475, quaternion.getW(), 1e-9); - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), -Math.PI / 2); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(-0.7071067811865475, quaternion.getZ(), 1e-9); - assertEquals(0.7071067811865475, quaternion.getW(), 1e-9); - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), 0.75 * Math.PI); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(0.9238795325112867, quaternion.getZ(), 1e-9); - assertEquals(0.38268343236508984, quaternion.getW(), 1e-9); - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), -0.75 * Math.PI); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(-0.9238795325112867, quaternion.getZ(), 1e-9); - assertEquals(0.38268343236508984, quaternion.getW(), 1e-9); - - quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), 1.5 * Math.PI); - assertEquals(0, quaternion.getX(), 1e-9); - assertEquals(0, quaternion.getY(), 1e-9); - assertEquals(0.7071067811865475, quaternion.getZ(), 1e-9); - assertEquals(-0.7071067811865475, quaternion.getW(), 1e-9); - } - - @Test - public void testInvert() { - Quaternion inverse = Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI / 2).invert(); - assertEquals(0, inverse.getX(), 1e-9); - assertEquals(0, inverse.getY(), 1e-9); - assertEquals(-0.7071067811865475, inverse.getZ(), 1e-9); - assertEquals(0.7071067811865475, inverse.getW(), 1e-9); - } - - @Test - public void testMultiply() { - Quaternion quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI / 2); - Quaternion inverse = quaternion.invert(); - Quaternion rotated = quaternion.multiply(inverse); - assertEquals(1, rotated.getW(), 1e-9); - } - - @Test - public void testRotateVector() { - Quaternion quaternion = Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI / 2); - Vector3 vector = new Vector3(1, 0, 0); - Vector3 rotated = quaternion.rotateAndScaleVector(vector); - assertEquals(0, rotated.getX(), 1e-9); - assertEquals(1, rotated.getY(), 1e-9); - assertEquals(0, rotated.getZ(), 1e-9); - } -} diff --git a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/TransformTest.java b/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/TransformTest.java deleted file mode 100644 index f1c73e374c9678533f90e09c94dd188f34df2708..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/TransformTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import java.util.Random; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class TransformTest { - - @Test - public void testMultiply() { - Transform transform1 = new Transform(Vector3.xAxis(), Quaternion.identity()); - Transform transform2 = - new Transform(Vector3.yAxis(), Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI / 2)); - - Transform result1 = transform1.multiply(transform2); - assertEquals(1.0, result1.getTranslation().getX(), 1e-9); - assertEquals(1.0, result1.getTranslation().getY(), 1e-9); - assertEquals(0.0, result1.getTranslation().getZ(), 1e-9); - assertEquals(0.0, result1.getRotationAndScale().getX(), 1e-9); - assertEquals(0.0, result1.getRotationAndScale().getY(), 1e-9); - assertEquals(0.7071067811865475, result1.getRotationAndScale().getZ(), 1e-9); - assertEquals(0.7071067811865475, result1.getRotationAndScale().getW(), 1e-9); - - Transform result2 = transform2.multiply(transform1); - assertEquals(0.0, result2.getTranslation().getX(), 1e-9); - assertEquals(2.0, result2.getTranslation().getY(), 1e-9); - assertEquals(0.0, result2.getTranslation().getZ(), 1e-9); - assertEquals(0.0, result2.getRotationAndScale().getX(), 1e-9); - assertEquals(0.0, result2.getRotationAndScale().getY(), 1e-9); - assertEquals(0.7071067811865475, result2.getRotationAndScale().getZ(), 1e-9); - assertEquals(0.7071067811865475, result2.getRotationAndScale().getW(), 1e-9); - } - - @Test - public void testInvert() { - Transform transform = - new Transform(Vector3.yAxis(), Quaternion.fromAxisAngle(Vector3.zAxis(), Math.PI / 2)); - Transform inverse = transform.invert(); - - assertEquals(-1.0, inverse.getTranslation().getX(), 1e-9); - assertEquals(0.0, inverse.getTranslation().getY(), 1e-9); - assertEquals(0.0, inverse.getTranslation().getZ(), 1e-9); - assertEquals(0.0, inverse.getRotationAndScale().getX(), 1e-9); - assertEquals(0.0, inverse.getRotationAndScale().getY(), 1e-9); - assertEquals(-0.7071067811865475, inverse.getRotationAndScale().getZ(), 1e-9); - assertEquals(0.7071067811865475, inverse.getRotationAndScale().getW(), 1e-9); - - Transform neutral = transform.multiply(inverse); - assertTrue(neutral.almostEquals(Transform.identity(), 1e-9)); - } - - @Test - public void testInvertRandom() { - Random random = new Random(); - random.setSeed(42); - for (int i = 0; i < 10000; i++) { - Vector3 vector = randomVector(random); - Quaternion quaternion = randomQuaternion(random); - Transform transform = new Transform(vector, quaternion); - Transform inverse = transform.invert(); - Transform neutral = transform.multiply(inverse); - assertTrue(neutral.almostEquals(Transform.identity(), 1e-9)); - } - } - - @Test - public void testMultiplyRandom() { - Random random = new Random(); - random.setSeed(42); - for (int i = 0; i < 10000; i++) { - Vector3 data = randomVector(random); - Vector3 vector1 = randomVector(random); - Vector3 vector2 = randomVector(random); - Quaternion quaternion1 = randomQuaternion(random); - Quaternion quaternion2 = randomQuaternion(random); - Transform transform1 = new Transform(vector1, quaternion1); - Transform transform2 = new Transform(vector2, quaternion2); - Vector3 result1 = transform1.apply(transform2.apply(data)); - Vector3 result2 = transform1.multiply(transform2).apply(data); - assertTrue(result1.almostEquals(result2, 1e-9)); - } - } - - @Test - public void testScale() { - assertTrue(Vector3.xAxis().scale(2) - .almostEquals(Transform.identity().scale(2).apply(Vector3.xAxis()), 1e-9)); - } - - private Quaternion randomQuaternion(Random random) { - return new Quaternion(random.nextDouble(), random.nextDouble(), random.nextDouble(), - random.nextDouble()); - } - - private Vector3 randomVector(Random random) { - return new Vector3(random.nextDouble(), random.nextDouble(), random.nextDouble()); - } -} diff --git a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/Vector3Test.java b/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/Vector3Test.java deleted file mode 100644 index f6d3e6c3a1763dd88fb557a5ec08175a728d6fe6..0000000000000000000000000000000000000000 --- a/rosjava_geometry/src/test/java/org/ros/rosjava_geometry/Vector3Test.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_geometry; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class Vector3Test { - - @Test - public void testAdd() { - Vector3 vector1 = new Vector3(1, 2, 3); - Vector3 vector2 = new Vector3(2, 3, 4); - Vector3 result = vector1.add(vector2); - assertEquals(result.getX(), 3, 1e-9); - assertEquals(result.getY(), 5, 1e-9); - assertEquals(result.getZ(), 7, 1e-9); - } - - @Test - public void testSubtract() { - Vector3 vector1 = new Vector3(1, 2, 3); - Vector3 vector2 = new Vector3(2, 3, 4); - Vector3 result = vector1.subtract(vector2); - assertEquals(result.getX(), -1, 1e-9); - assertEquals(result.getY(), -1, 1e-9); - assertEquals(result.getZ(), -1, 1e-9); - } - - @Test - public void testInvert() { - Vector3 result = new Vector3(1, 1, 1).invert(); - assertEquals(result.getX(), -1, 1e-9); - assertEquals(result.getY(), -1, 1e-9); - assertEquals(result.getZ(), -1, 1e-9); - } - - @Test - public void testDotProduct() { - Vector3 vector1 = new Vector3(1, 2, 3); - Vector3 vector2 = new Vector3(2, 3, 4); - assertEquals(20.0, vector1.dotProduct(vector2), 1e-9); - } - - @Test - public void testLength() { - assertEquals(2, new Vector3(2, 0, 0).getMagnitude(), 1e-9); - assertEquals(2, new Vector3(0, 2, 0).getMagnitude(), 1e-9); - assertEquals(2, new Vector3(0, 0, 2).getMagnitude(), 1e-9); - assertEquals(Math.sqrt(3), new Vector3(1, 1, 1).getMagnitude(), 1e-9); - } -} diff --git a/rosjava_test/build.gradle b/rosjava_test/build.gradle deleted file mode 100644 index 0ce12fbc8feb62a86f3c40a5313e98748d9a28dd..0000000000000000000000000000000000000000 --- a/rosjava_test/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -apply plugin: 'application' - -mainClassName = 'org.ros.RosRun' - -dependencies { - compile project(':rosjava') - compile 'junit:junit:4.8.2' -} diff --git a/rosjava_test/scripts/serialized_message.py b/rosjava_test/scripts/serialized_message.py deleted file mode 100644 index 56a6340dc7339afead3e38b7b03afaa33ad05e13..0000000000000000000000000000000000000000 --- a/rosjava_test/scripts/serialized_message.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2012 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -"""Prints the serialized bytese of a nav_msgs.Odometry message in hex. - -This can be modified slightly to print the serialized bytes in hex for -arbitrary ROS messages and is useful for generating test cases for rosjava -message serialization. -""" - -__author__ = 'damonkohler@google.com (Damon Kohler)' - -import StringIO - -import roslib; roslib.load_manifest('rosjava_test') -import rospy - -import nav_msgs.msg as nav_msgs - -message = nav_msgs.Odometry() -buf = StringIO.StringIO() -message.serialize(buf) -print ''.join('0x%02x,' % ord(c) for c in buf.getvalue())[:-1] - diff --git a/rosjava_test/src/main/java/org/ros/MessageSerializationTestNode.java b/rosjava_test/src/main/java/org/ros/MessageSerializationTestNode.java deleted file mode 100644 index fe6ce6807b0befe659186bfc8c20130f0686723e..0000000000000000000000000000000000000000 --- a/rosjava_test/src/main/java/org/ros/MessageSerializationTestNode.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros; - -import nav_msgs.Odometry; -import org.ros.message.MessageListener; -import org.ros.namespace.GraphName; -import org.ros.node.ConnectedNode; -import org.ros.node.Node; -import org.ros.node.NodeMain; -import org.ros.node.topic.Publisher; -import org.ros.node.topic.Subscriber; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class MessageSerializationTestNode implements NodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("message_serialization_test_node"); - } - - @Override - public void onStart(ConnectedNode connectedNode) { - final Publisher<nav_msgs.Odometry> publisher = - connectedNode.newPublisher("odom_echo", nav_msgs.Odometry._TYPE); - Subscriber<nav_msgs.Odometry> subscriber = - connectedNode.newSubscriber("odom", nav_msgs.Odometry._TYPE); - subscriber.addMessageListener(new MessageListener<Odometry>() { - @Override - public void onNewMessage(Odometry message) { - publisher.publish(message); - } - }); - } - - @Override - public void onShutdown(Node node) { - } - - @Override - public void onShutdownComplete(Node node) { - } - - @Override - public void onError(Node node, Throwable throwable) { - } -} diff --git a/rosjava_test/src/main/java/org/ros/ParameterServerTestNode.java b/rosjava_test/src/main/java/org/ros/ParameterServerTestNode.java deleted file mode 100644 index 523f0b08fd59204fb879826f2ca00f2943181b62..0000000000000000000000000000000000000000 --- a/rosjava_test/src/main/java/org/ros/ParameterServerTestNode.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros; - -import org.apache.commons.logging.Log; -import org.ros.concurrent.CancellableLoop; -import org.ros.message.MessageFactory; -import org.ros.namespace.GraphName; -import org.ros.namespace.NameResolver; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.parameter.ParameterTree; -import org.ros.node.topic.Publisher; - -import java.util.List; -import java.util.Map; - -/** - * This node is used in rostest end-to-end integration tests with other client - * libraries. - * - * @author kwc@willowgarage.com (Ken Conley) - */ -public class ParameterServerTestNode extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava/parameter_server_test_node"); - } - - @SuppressWarnings("rawtypes") - @Override - public void onStart(ConnectedNode connectedNode) { - final Publisher<std_msgs.String> pub_tilde = - connectedNode.newPublisher("tilde", std_msgs.String._TYPE); - final Publisher<std_msgs.String> pub_string = - connectedNode.newPublisher("string", std_msgs.String._TYPE); - final Publisher<std_msgs.Int64> pub_int = - connectedNode.newPublisher("int", std_msgs.Int64._TYPE); - final Publisher<std_msgs.Bool> pub_bool = - connectedNode.newPublisher("bool", std_msgs.Bool._TYPE); - final Publisher<std_msgs.Float64> pub_float = - connectedNode.newPublisher("float", std_msgs.Float64._TYPE); - final Publisher<rosjava_test_msgs.Composite> pub_composite = - connectedNode.newPublisher("composite", rosjava_test_msgs.Composite._TYPE); - final Publisher<rosjava_test_msgs.TestArrays> pub_list = - connectedNode.newPublisher("list", rosjava_test_msgs.TestArrays._TYPE); - - ParameterTree param = connectedNode.getParameterTree(); - - Log log = connectedNode.getLog(); - MessageFactory topicMessageFactory = connectedNode.getTopicMessageFactory(); - - final std_msgs.String tilde_m = topicMessageFactory.newFromType(std_msgs.String._TYPE); - tilde_m.setData(param.getString(connectedNode.resolveName("~tilde").toString())); - log.info("tilde: " + tilde_m.getData()); - - GraphName paramNamespace = GraphName.of(param.getString("parameter_namespace")); - GraphName targetNamespace = GraphName.of(param.getString("target_namespace")); - log.info("parameter_namespace: " + paramNamespace); - log.info("target_namespace: " + targetNamespace); - NameResolver resolver = connectedNode.getResolver().newChild(paramNamespace); - NameResolver setResolver = connectedNode.getResolver().newChild(targetNamespace); - - final std_msgs.String string_m = topicMessageFactory.newFromType(std_msgs.String._TYPE); - string_m.setData(param.getString(resolver.resolve("string"))); - log.info("string: " + string_m.getData()); - final std_msgs.Int64 int_m = topicMessageFactory.newFromType(std_msgs.Int64._TYPE); - int_m.setData(param.getInteger(resolver.resolve("int"))); - log.info("int: " + int_m.getData()); - - final std_msgs.Bool bool_m = topicMessageFactory.newFromType(std_msgs.Bool._TYPE); - bool_m.setData(param.getBoolean(resolver.resolve("bool"))); - log.info("bool: " + bool_m.getData()); - final std_msgs.Float64 float_m = topicMessageFactory.newFromType(std_msgs.Float64._TYPE); - float_m.setData(param.getDouble(resolver.resolve("float"))); - log.info("float: " + float_m.getData()); - - final rosjava_test_msgs.Composite composite_m = - topicMessageFactory.newFromType(rosjava_test_msgs.Composite._TYPE); - Map composite_map = param.getMap(resolver.resolve("composite")); - composite_m.getA().setW((Double) ((Map) composite_map.get("a")).get("w")); - composite_m.getA().setX((Double) ((Map) composite_map.get("a")).get("x")); - composite_m.getA().setY((Double) ((Map) composite_map.get("a")).get("y")); - composite_m.getA().setZ((Double) ((Map) composite_map.get("a")).get("z")); - composite_m.getB().setX((Double) ((Map) composite_map.get("b")).get("x")); - composite_m.getB().setY((Double) ((Map) composite_map.get("b")).get("y")); - composite_m.getB().setZ((Double) ((Map) composite_map.get("b")).get("z")); - - final rosjava_test_msgs.TestArrays list_m = topicMessageFactory.newFromType(rosjava_test_msgs.TestArrays._TYPE); - // only using the integer part for easier (non-float) comparison - @SuppressWarnings("unchecked") - List<Integer> list = (List<Integer>) param.getList(resolver.resolve("list")); - int[] data = new int[list.size()]; - for (int i = 0; i < list.size(); i++) { - data[i] = list.get(i); - } - list_m.setInt32Array(data); - - // Set parameters - param.set(setResolver.resolve("string"), string_m.getData()); - param.set(setResolver.resolve("int"), (int) int_m.getData()); - param.set(setResolver.resolve("float"), float_m.getData()); - param.set(setResolver.resolve("bool"), bool_m.getData()); - param.set(setResolver.resolve("composite"), composite_map); - param.set(setResolver.resolve("list"), list); - - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - pub_tilde.publish(tilde_m); - pub_string.publish(string_m); - pub_int.publish(int_m); - pub_bool.publish(bool_m); - pub_float.publish(float_m); - pub_composite.publish(composite_m); - pub_list.publish(list_m); - Thread.sleep(100); - } - }); - } -} diff --git a/rosjava_test/src/main/java/org/ros/PassthroughTestNode.java b/rosjava_test/src/main/java/org/ros/PassthroughTestNode.java deleted file mode 100644 index 2d251bdd11d230f1000224e4a6132ba49bb91ac5..0000000000000000000000000000000000000000 --- a/rosjava_test/src/main/java/org/ros/PassthroughTestNode.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros; - -import org.ros.message.MessageListener; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.topic.Publisher; -import org.ros.node.topic.Subscriber; - -/** - * This node is used in rostest end-to-end integration tests with other client - * libraries. - * - * @author kwc@willowgarage.com (Ken Conley) - */ -public class PassthroughTestNode extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava/passthrough_test_node"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - // The goal of the passthrough node is simply to retransmit the messages - // sent to it. This allows us to external verify that the node is compatible - // with multiple publishers, multiple subscribers, etc... - - // String pass through - final Publisher<std_msgs.String> pub_string = - connectedNode.newPublisher("string_out", std_msgs.String._TYPE); - MessageListener<std_msgs.String> string_cb = new MessageListener<std_msgs.String>() { - @Override - public void onNewMessage(std_msgs.String m) { - pub_string.publish(m); - } - }; - Subscriber<std_msgs.String> stringSubscriber = - connectedNode.newSubscriber("string_in", "std_msgs/String"); - stringSubscriber.addMessageListener(string_cb); - - // Int64 pass through - final Publisher<std_msgs.Int64> pub_int64 = connectedNode.newPublisher("int64_out", "std_msgs/Int64"); - MessageListener<std_msgs.Int64> int64_cb = new MessageListener<std_msgs.Int64>() { - @Override - public void onNewMessage(std_msgs.Int64 m) { - pub_int64.publish(m); - } - }; - Subscriber<std_msgs.Int64> int64Subscriber = connectedNode.newSubscriber("int64_in", "std_msgs/Int64"); - int64Subscriber.addMessageListener(int64_cb); - - // TestHeader pass through - final Publisher<rosjava_test_msgs.TestHeader> pub_header = - connectedNode.newPublisher("test_header_out", rosjava_test_msgs.TestHeader._TYPE); - MessageListener<rosjava_test_msgs.TestHeader> header_cb = new MessageListener<rosjava_test_msgs.TestHeader>() { - @Override - public void onNewMessage(rosjava_test_msgs.TestHeader m) { - m.setOrigCallerId(m.getCallerId()); - m.setCallerId(connectedNode.getName().toString()); - pub_header.publish(m); - } - }; - Subscriber<rosjava_test_msgs.TestHeader> testHeaderSubscriber = - connectedNode.newSubscriber("test_header_in", "rosjava_test_msgs/TestHeader"); - testHeaderSubscriber.addMessageListener(header_cb); - - // TestComposite pass through - final Publisher<rosjava_test_msgs.Composite> pub_composite = - connectedNode.newPublisher("composite_out", "rosjava_test_msgs/Composite"); - MessageListener<rosjava_test_msgs.Composite> composite_cb = new MessageListener<rosjava_test_msgs.Composite>() { - @Override - public void onNewMessage(rosjava_test_msgs.Composite m) { - pub_composite.publish(m); - } - }; - Subscriber<rosjava_test_msgs.Composite> compositeSubscriber = - connectedNode.newSubscriber("composite_in", "rosjava_test_msgs/Composite"); - compositeSubscriber.addMessageListener(composite_cb); - } -} diff --git a/rosjava_test/src/main/java/org/ros/SlaveApiTestNode.java b/rosjava_test/src/main/java/org/ros/SlaveApiTestNode.java deleted file mode 100644 index 7636b04dea172b432ac958b0a1f82ff7d77de5bd..0000000000000000000000000000000000000000 --- a/rosjava_test/src/main/java/org/ros/SlaveApiTestNode.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros; - -import org.ros.concurrent.CancellableLoop; -import org.ros.message.MessageFactory; -import org.ros.message.MessageListener; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.topic.Publisher; -import org.ros.node.topic.Subscriber; - -/** - * This node is used to test the slave API externally using rostest. - * - * @author kwc@willowgarage.com (Ken Conley) - */ -public class SlaveApiTestNode extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava/slave_api_test_node"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - // Basic chatter in/out test. - final Publisher<std_msgs.String> pub_string = - connectedNode.newPublisher("chatter_out", std_msgs.String._TYPE); - MessageListener<std_msgs.String> chatter_cb = new MessageListener<std_msgs.String>() { - @Override - public void onNewMessage(std_msgs.String m) { - System.out.println("String: " + m.getData()); - } - }; - - Subscriber<std_msgs.String> stringSubscriber = - connectedNode.newSubscriber("chatter_in", std_msgs.String._TYPE); - stringSubscriber.addMessageListener(chatter_cb); - - // Have at least one case of dual pub/sub on the same topic. - final Publisher<std_msgs.Int64> pub_int64_pubsub = - connectedNode.newPublisher("int64", std_msgs.Int64._TYPE); - MessageListener<std_msgs.Int64> int64_cb = new MessageListener<std_msgs.Int64>() { - @Override - public void onNewMessage(std_msgs.Int64 m) { - } - }; - - Subscriber<std_msgs.Int64> int64Subscriber = - connectedNode.newSubscriber("int64", "std_msgs/std_msgs.Int64"); - int64Subscriber.addMessageListener(int64_cb); - - // Don't do any performance optimizations here. We want to make sure that - // GC, etc. is working. - connectedNode.executeCancellableLoop(new CancellableLoop() { - @Override - protected void loop() throws InterruptedException { - MessageFactory topicMessageFactory = connectedNode.getTopicMessageFactory(); - std_msgs.String chatter = topicMessageFactory.newFromType(std_msgs.String._TYPE); - chatter.setData("hello " + System.currentTimeMillis()); - pub_string.publish(chatter); - - std_msgs.Int64 num = topicMessageFactory.newFromType(std_msgs.Int64._TYPE); - num.setData(1); - pub_int64_pubsub.publish(num); - Thread.sleep(100); - } - }); - } -} diff --git a/rosjava_tutorial_pubsub/BUILD.bazel b/rosjava_tutorial_pubsub/BUILD.bazel deleted file mode 100644 index 40acec59084dd6178102c00c9f3fa0876160eb0a..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_pubsub/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -java_binary( - name = "rosjava_tutorial_pubsub", - srcs = glob([ - "src/main/**/*.java", - ]), - main_class = "org.ros.RosRun", - deps = [ - "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_logging", - "//3rdparty/jvm/org/ros/rosjava_messages:std_msgs", - "//rosjava", - "@com_github_rosjava_rosjava_bootstrap//message_generation", - ], -) diff --git a/rosjava_tutorial_pubsub/build.gradle b/rosjava_tutorial_pubsub/build.gradle deleted file mode 100644 index 11c866cf5a8ca19e90162d84054ab34ea51300d3..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_pubsub/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -apply plugin: 'application' - -mainClassName = 'org.ros.RosRun' - -dependencies { - compile project(':rosjava') -} - -defaultTasks 'publish', 'installDist' - diff --git a/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java b/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java deleted file mode 100644 index 2725c40cb72b1b0baecd7ef6a787f32cbf0be1f0..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Listener.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_tutorial_pubsub; - -import org.apache.commons.logging.Log; -import org.ros.message.MessageListener; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.NodeMain; -import org.ros.node.topic.Subscriber; - -/** - * A simple {@link Subscriber} {@link NodeMain}. - * - * @author damonkohler@google.com (Damon Kohler) - */ -public class Listener extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava_tutorial_pubsub/listener"); - } - - @Override - public void onStart(ConnectedNode connectedNode) { - final Log log = connectedNode.getLog(); - Subscriber<std_msgs.String> subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE); - subscriber.addMessageListener(new MessageListener<std_msgs.String>() { - @Override - public void onNewMessage(std_msgs.String message) { - log.info("I heard: \"" + message.getData() + "\""); - } - }); - } -} diff --git a/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Talker.java b/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Talker.java deleted file mode 100644 index 645d6ebc4c72417a2c86fae0619ff26a8c450f16..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_pubsub/src/main/java/org/ros/rosjava_tutorial_pubsub/Talker.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_tutorial_pubsub; - -import org.ros.concurrent.CancellableLoop; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.NodeMain; -import org.ros.node.topic.Publisher; - -/** - * A simple {@link Publisher} {@link NodeMain}. - * - * @author damonkohler@google.com (Damon Kohler) - */ -public class Talker extends AbstractNodeMain { - private String topic_name; - - public Talker() { - topic_name = "chatter"; - } - - public Talker(String topic) - { - topic_name = topic; - } - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava_tutorial_pubsub/talker"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - final Publisher<std_msgs.String> publisher = - connectedNode.newPublisher(topic_name, std_msgs.String._TYPE); - // This CancellableLoop will be canceled automatically when the node shuts - // down. - connectedNode.executeCancellableLoop(new CancellableLoop() { - private int sequenceNumber; - - @Override - protected void setup() { - sequenceNumber = 0; - } - - @Override - protected void loop() throws InterruptedException { - std_msgs.String str = publisher.newMessage(); - str.setData("Hello world! " + sequenceNumber); - publisher.publish(str); - sequenceNumber++; - Thread.sleep(1000); - } - }); - } -} diff --git a/rosjava_tutorial_right_hand_rule/build.gradle b/rosjava_tutorial_right_hand_rule/build.gradle deleted file mode 100644 index c48db93699b911fb7cf9fd3e85ac5ed4301797fa..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_right_hand_rule/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -apply plugin: 'application' - -mainClassName = 'org.ros.RosRun' - -dependencies { - compile project(':rosjava') - compile 'org.ros.rosjava_messages:sensor_msgs:[1.12,1.13)' -} - diff --git a/rosjava_tutorial_right_hand_rule/src/main/java/org/ros/rosjava_tutorial_right_hand_rule/RightHandRule.java b/rosjava_tutorial_right_hand_rule/src/main/java/org/ros/rosjava_tutorial_right_hand_rule/RightHandRule.java deleted file mode 100644 index 1bafae60749170de1350055271099f5a5bcda4a7..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_right_hand_rule/src/main/java/org/ros/rosjava_tutorial_right_hand_rule/RightHandRule.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_tutorial_right_hand_rule; - -import org.ros.message.MessageListener; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.topic.Publisher; -import org.ros.node.topic.Subscriber; - -/** - * @author damonkohler@google.com (Damon Kohler) - */ -public class RightHandRule extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("right_hand_rule"); - } - - @Override - public void onStart(ConnectedNode connectedNode) { - final Publisher<geometry_msgs.Twist> publisher = - connectedNode.newPublisher("cmd_vel", geometry_msgs.Twist._TYPE); - final geometry_msgs.Twist twist = publisher.newMessage(); - final Subscriber<sensor_msgs.LaserScan> subscriber = - connectedNode.newSubscriber("base_scan", sensor_msgs.LaserScan._TYPE); - subscriber.addMessageListener(new MessageListener<sensor_msgs.LaserScan>() { - @Override - public void onNewMessage(sensor_msgs.LaserScan message) { - float[] ranges = message.getRanges(); - float northRange = ranges[ranges.length / 2]; - float northEastRange = ranges[ranges.length / 3]; - double linearVelocity = 0.5; - double angularVelocity = -0.5; - if (northRange < 1. || northEastRange < 1.) { - linearVelocity = 0; - angularVelocity = 0.5; - } - twist.getAngular().setZ(angularVelocity); - twist.getLinear().setX(linearVelocity); - publisher.publish(twist); - } - }); - } -} diff --git a/rosjava_tutorial_right_hand_rule/world/maze-erratic.world b/rosjava_tutorial_right_hand_rule/world/maze-erratic.world deleted file mode 100644 index f5b647785d02a1d7a4ba9627dbb3e1d494262c3f..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_right_hand_rule/world/maze-erratic.world +++ /dev/null @@ -1,63 +0,0 @@ -define topurg ranger -( - sensor( - range [ 0.0 30.0 ] - fov 270.25 - samples 1081 - ) - - # generic model properties - color "black" - size [ 0.05 0.05 0.1 ] -) - -define erratic position -( - size [0.35 0.35 0.25] - origin [-0.05 0 0 0] - gui_nose 1 - drive "diff" - topurg(pose [ 0.050 0.000 0 0.000 ]) -) - -define floorplan model -( - # sombre, sensible, artistic - color "gray30" - - # most maps will need a bounding box - boundary 0 - - gui_nose 0 - gui_grid 0 - - gui_outline 0 - gripper_return 0 - fiducial_return 0 - laser_return 1 -) - -# set the resolution of the underlying raytrace model in meters -resolution 0.02 - -interval_sim 100 # simulation timestep in milliseconds - -window -( - size [ 500.0 500.0 ] - rotate [ 0.0 0.0 ] - scale 10.0 -) - -# load an environment bitmap -floorplan -( - name "maze" - bitmap "maze.png" - size [50.0 50.0 0.5] - pose [ 0.0 0.0 0 0.0 ] - gui_move 0 -) - -# throw in a robot -erratic( pose [ 1.25 -25.0 0.0 90.0 ] name "era" color "blue") diff --git a/rosjava_tutorial_right_hand_rule/world/maze.png b/rosjava_tutorial_right_hand_rule/world/maze.png deleted file mode 100644 index ed9ab46dce6f7df6ac425089a154b150c5d2dd90..0000000000000000000000000000000000000000 Binary files a/rosjava_tutorial_right_hand_rule/world/maze.png and /dev/null differ diff --git a/rosjava_tutorial_services/build.gradle b/rosjava_tutorial_services/build.gradle deleted file mode 100644 index b3c0d175ab54de7815d2ed935a406773c0d90eef..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_services/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -apply plugin: 'application' - -mainClassName = 'org.ros.RosRun' - -dependencies { - compile project(':rosjava') -} diff --git a/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Client.java b/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Client.java deleted file mode 100644 index 1f1e69a6deee2ce9828635e573e61229ab9bbf77..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Client.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_tutorial_services; - -import org.ros.exception.RemoteException; -import org.ros.exception.RosRuntimeException; -import org.ros.exception.ServiceNotFoundException; -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.NodeMain; -import org.ros.node.service.ServiceClient; -import org.ros.node.service.ServiceResponseListener; - -/** - * A simple {@link ServiceClient} {@link NodeMain}. - * - * @author damonkohler@google.com (Damon Kohler) - */ -public class Client extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava_tutorial_services/client"); - } - - @Override - public void onStart(final ConnectedNode connectedNode) { - ServiceClient<rosjava_test_msgs.AddTwoIntsRequest, rosjava_test_msgs.AddTwoIntsResponse> serviceClient; - try { - serviceClient = connectedNode.newServiceClient("add_two_ints", rosjava_test_msgs.AddTwoInts._TYPE); - } catch (ServiceNotFoundException e) { - throw new RosRuntimeException(e); - } - final rosjava_test_msgs.AddTwoIntsRequest request = serviceClient.newMessage(); - request.setA(2); - request.setB(2); - serviceClient.call(request, new ServiceResponseListener<rosjava_test_msgs.AddTwoIntsResponse>() { - @Override - public void onSuccess(rosjava_test_msgs.AddTwoIntsResponse response) { - connectedNode.getLog().info( - String.format("%d + %d = %d", request.getA(), request.getB(), response.getSum())); - } - - @Override - public void onFailure(RemoteException e) { - throw new RosRuntimeException(e); - } - }); - } -} diff --git a/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Server.java b/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Server.java deleted file mode 100644 index 5a313bfbba92cb3899dfc6ab18fcf42b11018f43..0000000000000000000000000000000000000000 --- a/rosjava_tutorial_services/src/main/java/org/ros/rosjava_tutorial_services/Server.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package org.ros.rosjava_tutorial_services; - -import org.ros.namespace.GraphName; -import org.ros.node.AbstractNodeMain; -import org.ros.node.ConnectedNode; -import org.ros.node.NodeMain; -import org.ros.node.service.ServiceResponseBuilder; -import org.ros.node.service.ServiceServer; - -/** - * This is a simple {@link ServiceServer} {@link NodeMain}. - * - * @author damonkohler@google.com (Damon Kohler) - */ -public class Server extends AbstractNodeMain { - - @Override - public GraphName getDefaultNodeName() { - return GraphName.of("rosjava_tutorial_services/server"); - } - - @Override - public void onStart(ConnectedNode connectedNode) { - connectedNode.newServiceServer("add_two_ints", rosjava_test_msgs.AddTwoInts._TYPE, - new ServiceResponseBuilder<rosjava_test_msgs.AddTwoIntsRequest, rosjava_test_msgs.AddTwoIntsResponse>() { - @Override - public void - build(rosjava_test_msgs.AddTwoIntsRequest request, rosjava_test_msgs.AddTwoIntsResponse response) { - response.setSum(request.getA() + request.getB()); - } - }); - } -} diff --git a/settings.gradle b/settings.gradle index f86bd0d5d6c744bea411f814f82bcbfaf9cb8365..0a8a7f1acbb160b4f29fa33520f5cdb0308bf49c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -19,13 +19,7 @@ include( 'apache_xmlrpc_common', 'apache_xmlrpc_server', 'rosjava', - 'rosjava_geometry', - 'rosjava_benchmarks', - 'rosjava_test', 'rosjava_helpers', - 'rosjava_tutorial_pubsub', - 'rosjava_tutorial_right_hand_rule', - 'rosjava_tutorial_services', 'docs', )