├── 3rdparty ├── BUILD └── jvm │ ├── junit │ └── BUILD │ ├── io │ └── netty │ │ └── BUILD │ ├── xml_apis │ └── BUILD │ ├── org │ ├── mockito │ │ └── BUILD │ ├── apache │ │ └── ws │ │ │ └── commons │ │ │ └── BUILD │ └── ros │ │ └── rosjava_bootstrap │ │ └── BUILD │ ├── commons_pool │ └── BUILD │ ├── com │ └── google │ │ ├── code │ │ └── findbugs │ │ │ └── BUILD │ │ └── guava │ │ └── BUILD │ └── dnsjava │ └── BUILD ├── bazel ├── BUILD.bazel └── repositories.bzl ├── misc ├── rospack_nosubdirs └── rosjava_import_order.importorder ├── rosjava_helpers ├── src │ └── test │ │ └── resources │ │ ├── empty.yaml │ │ └── parameters.yaml └── build.gradle ├── apache_xmlrpc_client ├── README ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── xmlrpc │ │ │ └── client │ │ │ ├── XmlRpcClient.properties │ │ │ ├── XmlRpcStreamTransportFactory.java │ │ │ ├── XmlRpcLocalClientConfig.java │ │ │ ├── XmlRpcTransportFactory.java │ │ │ ├── XmlRpcLiteHttpTransportFactory.java │ │ │ ├── XmlRpcClientConfig.java │ │ │ ├── XmlRpcTransportImpl.java │ │ │ └── XmlRpcTransportFactoryImpl.java │ │ └── resources │ │ └── org │ │ └── apache │ │ └── xmlrpc │ │ └── client │ │ └── XmlRpcClient.properties ├── NOTICE ├── BUILD.bazel └── build.gradle ├── apache_xmlrpc_common ├── README ├── NOTICE ├── BUILD.bazel ├── build.gradle └── src │ └── main │ └── java │ └── org │ └── apache │ └── xmlrpc │ ├── parser │ ├── StringParser.java │ ├── I1Parser.java │ ├── I8Parser.java │ ├── FloatParser.java │ ├── I2Parser.java │ ├── LongParser.java │ ├── DoubleParser.java │ ├── I4Parser.java │ ├── NullParser.java │ ├── BooleanParser.java │ └── TypeParser.java │ ├── XmlRpcRequestConfig.java │ ├── common │ ├── TypeConverterFactory.java │ ├── XmlRpcRequestProcessorFactory.java │ ├── XmlRpcLoadException.java │ ├── XmlRpcNotAuthorizedException.java │ ├── XmlRpcStreamConfig.java │ ├── XmlRpcExtensionException.java │ ├── XmlRpcStreamRequestProcessor.java │ └── XmlRpcRequestProcessor.java │ ├── serializer │ ├── DoubleSerializer.java │ ├── StringSerializer.java │ ├── CharSetXmlWriterFactory.java │ ├── I4Serializer.java │ ├── I1Serializer.java │ ├── I2Serializer.java │ ├── I8Serializer.java │ └── FloatSerializer.java │ └── XmlRpcHandler.java ├── apache_xmlrpc_server ├── README ├── NOTICE ├── BUILD.bazel ├── build.gradle └── src │ └── main │ └── java │ └── org │ └── apache │ └── xmlrpc │ └── server │ ├── XmlRpcServerConfig.java │ ├── ServerHttpConnection.java │ ├── XmlRpcNoSuchHandlerException.java │ ├── XmlRpcServerWorkerFactory.java │ ├── XmlRpcHttpServerConfig.java │ └── XmlRpcLocalStreamServer.java ├── rosjava ├── .gradle │ └── 1.0-milestone-8a │ │ └── taskArtifacts │ │ ├── cache.properties.lock │ │ ├── cache.properties │ │ ├── taskArtifacts.bin │ │ └── outputFileStates.bin ├── test │ ├── SlaveApiTestNode │ ├── PassthroughTestNode │ ├── ParameterServerTestNode │ ├── rosjava_profile.yaml │ ├── slave_api.rostest │ ├── int64_passthrough.rostest │ ├── composite_passthrough.rostest │ ├── testheader_passthrough.rostest │ ├── parameter_client.rostest │ ├── slave_api_simtime.rostest │ ├── parameter_client_params.yaml │ ├── string_publisher.py │ ├── int64_publisher.py │ ├── testheader_publisher.py │ ├── composite_publisher.py │ └── string_passthrough.rostest ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── ros │ │ │ ├── internal │ │ │ ├── node │ │ │ │ ├── service │ │ │ │ │ ├── ServiceResponseDecoderState.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── ServiceManagerListener.java │ │ │ │ │ ├── Service.java │ │ │ │ │ └── ServiceServerResponse.java │ │ │ │ ├── client │ │ │ │ │ └── package-info.java │ │ │ │ ├── server │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── master │ │ │ │ │ │ ├── package-info.java │ │ │ │ │ │ └── MasterRegistrationListener.java │ │ │ │ │ └── ServerException.java │ │ │ │ ├── topic │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── TopicParticipant.java │ │ │ │ ├── response │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── VoidResultFactory.java │ │ │ │ │ ├── ObjectResultFactory.java │ │ │ │ │ ├── BooleanResultFactory.java │ │ │ │ │ ├── StringResultFactory.java │ │ │ │ │ ├── IntegerResultFactory.java │ │ │ │ │ ├── ResultFactory.java │ │ │ │ │ ├── UriResultFactory.java │ │ │ │ │ ├── StringListResultFactory.java │ │ │ │ │ ├── TopicTypeListResultFactory.java │ │ │ │ │ └── StatusCode.java │ │ │ │ ├── xmlrpc │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── XmlRpcEndpoint.java │ │ │ │ │ └── XmlRpcTimeoutException.java │ │ │ │ ├── parameter │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── loader │ │ │ │ └── package-info.java │ │ │ ├── system │ │ │ │ └── package-info.java │ │ │ └── transport │ │ │ │ ├── package-info.java │ │ │ │ ├── tcp │ │ │ │ ├── package-info.java │ │ │ │ ├── AbstractNamedChannelHandler.java │ │ │ │ ├── TcpRosProtocolDescription.java │ │ │ │ └── NamedChannelHandler.java │ │ │ │ ├── ProtocolNames.java │ │ │ │ ├── ClientHandshakeListener.java │ │ │ │ ├── ClientHandshake.java │ │ │ │ └── ConnectionHeaderFields.java │ │ │ ├── master │ │ │ ├── uri │ │ │ │ ├── package-info.java │ │ │ │ └── StaticMasterUriProvider.java │ │ │ ├── client │ │ │ │ ├── package-info.java │ │ │ │ ├── SystemState.java │ │ │ │ └── TopicType.java │ │ │ └── package-info.java │ │ │ ├── math │ │ │ ├── package-info.java │ │ │ └── CollectionMath.java │ │ │ ├── namespace │ │ │ └── package-info.java │ │ │ ├── time │ │ │ ├── package-info.java │ │ │ ├── TimeProvider.java │ │ │ └── WallTimeProvider.java │ │ │ ├── address │ │ │ ├── package-info.java │ │ │ ├── AdvertiseAddressFactory.java │ │ │ ├── Address.java │ │ │ ├── PrivateAdvertiseAddressFactory.java │ │ │ └── PublicAdvertiseAddressFactory.java │ │ │ ├── concurrent │ │ │ ├── package-info.java │ │ │ ├── DroppedEntryException.java │ │ │ ├── Rate.java │ │ │ ├── SignalRunnable.java │ │ │ └── WallTimeRate.java │ │ │ ├── node │ │ │ ├── topic │ │ │ │ ├── package-info.java │ │ │ │ └── TransportHints.java │ │ │ ├── service │ │ │ │ ├── package-info.java │ │ │ │ ├── ServiceServerListener.java │ │ │ │ ├── DefaultServiceServerListener.java │ │ │ │ ├── ServiceResponseListener.java │ │ │ │ └── ServiceResponseBuilder.java │ │ │ ├── package-info.java │ │ │ ├── parameter │ │ │ │ ├── package-info.java │ │ │ │ └── ParameterListener.java │ │ │ ├── AbstractNodeMain.java │ │ │ └── DefaultNodeListener.java │ │ │ ├── Parameters.java │ │ │ ├── exception │ │ │ ├── DuplicateServiceException.java │ │ │ ├── RosException.java │ │ │ ├── ServiceException.java │ │ │ ├── RosRuntimeException.java │ │ │ ├── ServiceNotFoundException.java │ │ │ ├── RemoteException.java │ │ │ ├── ParameterNotFoundException.java │ │ │ └── ParameterClassCastException.java │ │ │ ├── Topics.java │ │ │ ├── EnvironmentVariables.java │ │ │ └── CommandLineVariables.java │ └── test │ │ └── java │ │ └── org │ │ └── ros │ │ ├── Assert.java │ │ └── internal │ │ └── transport │ │ └── ConnectionHeaderTest.java └── .settings │ └── org.moreunit.prefs ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .rosinstall ├── rosjava_tutorial_right_hand_rule ├── world │ ├── maze.png │ └── maze-erratic.world └── build.gradle ├── gradle.properties ├── .gitignore ├── WORKSPACE ├── .hgignore ├── rosjava_tutorial_pubsub ├── BUILD.bazel └── build.gradle ├── rosjava_geometry ├── build.gradle └── src │ └── main │ └── java │ └── org │ └── ros │ └── rosjava_geometry │ └── package-info.java ├── rosjava_tutorial_services └── build.gradle ├── docs └── src │ └── main │ └── sphinx │ ├── best_practices.rst │ ├── index.rst │ ├── overview.rst │ ├── building.rst │ ├── installing.rst │ ├── javadoc.py │ └── advanced.rst ├── rosjava_test ├── build.gradle └── scripts │ └── serialized_message.py ├── rosjava_benchmarks └── build.gradle ├── settings.gradle ├── package.xml ├── .classpath └── CMakeLists.txt /3rdparty/BUILD: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bazel/BUILD.bazel: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /misc/rospack_nosubdirs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rosjava_helpers/src/test/resources/empty.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/README: -------------------------------------------------------------------------------- 1 | Based on Apache 3.1.3 2 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/README: -------------------------------------------------------------------------------- 1 | Based on Apache 3.1.3 2 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/README: -------------------------------------------------------------------------------- 1 | Based on Apache 3.1.3 2 | -------------------------------------------------------------------------------- /rosjava/.gradle/1.0-milestone-8a/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /rosjava/.gradle/1.0-milestone-8a/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Tue Feb 28 11:34:15 CET 2012 2 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcClient.properties: -------------------------------------------------------------------------------- 1 | user.agent=Apache XML RPC 3.1.3 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rosjava/rosjava_core/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.rosinstall: -------------------------------------------------------------------------------- 1 | - git: 2 | local-name: rosjava_core 3 | uri: https://github.com/rosjava/rosjava_core/ 4 | version: hydro-devel 5 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/resources/org/apache/xmlrpc/client/XmlRpcClient.properties: -------------------------------------------------------------------------------- 1 | user.agent=Apache XML RPC ${project.version} 2 | -------------------------------------------------------------------------------- /rosjava/test/SlaveApiTestNode: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec java -jar `rospack find rosjava`/dist/rosjava.jar org.ros.SlaveApiTestNode $@ 4 | -------------------------------------------------------------------------------- /rosjava/test/PassthroughTestNode: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec java -jar `rospack find rosjava`/dist/rosjava.jar org.ros.PassthroughTestNode $@ 4 | -------------------------------------------------------------------------------- /misc/rosjava_import_order.importorder: -------------------------------------------------------------------------------- 1 | #Organize Import Order 2 | #Wed Feb 23 23:44:47 PST 2011 3 | 3=javax 4 | 2=java 5 | 1= 6 | 0=com.google 7 | -------------------------------------------------------------------------------- /rosjava/test/ParameterServerTestNode: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec java -jar `rospack find rosjava`/dist/rosjava.jar org.ros.ParameterServerTestNode $@ 4 | -------------------------------------------------------------------------------- /rosjava_tutorial_right_hand_rule/world/maze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rosjava/rosjava_core/HEAD/rosjava_tutorial_right_hand_rule/world/maze.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | # Fixes "handshake alert: unrecognized_name" error in Java 7. 3 | org.gradle.jvmargs=-Djsse.enableSNIExtension=false 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .pydevproject 2 | *.pyc 3 | .gradle 4 | build 5 | bin 6 | .classpath 7 | .project 8 | .settings 9 | *.iml 10 | .idea 11 | bazel-* 12 | local.properties 13 | -------------------------------------------------------------------------------- /rosjava/.gradle/1.0-milestone-8a/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rosjava/rosjava_core/HEAD/rosjava/.gradle/1.0-milestone-8a/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /rosjava/test/rosjava_profile.yaml: -------------------------------------------------------------------------------- 1 | pubs: 2 | '/chatter_out': std_msgs/String 3 | '/int64': std_msgs/Int64 4 | subs: 5 | '/chatter_in': std_msgs/String 6 | '/int64': std_msgs/Int64 -------------------------------------------------------------------------------- /rosjava/.gradle/1.0-milestone-8a/taskArtifacts/outputFileStates.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rosjava/rosjava_core/HEAD/rosjava/.gradle/1.0-milestone-8a/taskArtifacts/outputFileStates.bin -------------------------------------------------------------------------------- /apache_xmlrpc_client/NOTICE: -------------------------------------------------------------------------------- 1 | Apache XML-RPC 2 | Copyright 1999-2009 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/NOTICE: -------------------------------------------------------------------------------- 1 | Apache XML-RPC 2 | Copyright 1999-2009 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/NOTICE: -------------------------------------------------------------------------------- 1 | Apache XML-RPC 2 | Copyright 1999-2009 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/service/ServiceResponseDecoderState.java: -------------------------------------------------------------------------------- 1 | package org.ros.internal.node.service; 2 | 3 | enum ServiceResponseDecoderState { 4 | ERROR_CODE, MESSAGE_LENGTH, MESSAGE 5 | } -------------------------------------------------------------------------------- /rosjava_helpers/src/test/resources/parameters.yaml: -------------------------------------------------------------------------------- 1 | string_param: "bar" 2 | int_param: 1823 3 | double_param: 1.74 4 | boolean_param: false 5 | list_param: 6 | - "Hello" 7 | - 1 8 | - 2.3 9 | - true -------------------------------------------------------------------------------- /rosjava_helpers/build.gradle: -------------------------------------------------------------------------------- 1 | dependencies { 2 | compile project(':rosjava') 3 | compile 'org.yaml:snakeyaml:[1.17, 1.18)' 4 | testCompile 'junit:junit:4.8.2' 5 | testCompile project(':rosjava').sourceSets.test.output 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_github_rosjava_rosjava_core") 2 | 3 | load("//3rdparty:workspace.bzl", "maven_dependencies") 4 | 5 | maven_dependencies() 6 | 7 | load("//bazel:repositories.bzl", "rosjava_repositories") 8 | 9 | rosjava_repositories() 10 | -------------------------------------------------------------------------------- /rosjava/test/slave_api.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /rosjava/test/int64_passthrough.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /3rdparty/jvm/junit/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "junit", 4 | exports = [ 5 | "//external:jar/junit/junit" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /3rdparty/jvm/io/netty/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "netty", 4 | exports = [ 5 | "//external:jar/io/netty/netty" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /rosjava/test/composite_passthrough.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /rosjava/test/testheader_passthrough.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /3rdparty/jvm/xml_apis/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "xml_apis", 4 | exports = [ 5 | "//external:jar/xml_apis/xml_apis" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | *.class 3 | *.dex 4 | *.orig 5 | *.swp 6 | *.pyc 7 | *.DS_Store 8 | *~ 9 | *.log 10 | *.ap_ 11 | *.apk 12 | .cproject 13 | .settings 14 | .classpath 15 | .project 16 | .gradle 17 | target 18 | build 19 | dist 20 | msg_gen 21 | srv_gen 22 | gen 23 | libs 24 | bin 25 | docs/src/main/sphinx/conf.py 26 | -------------------------------------------------------------------------------- /3rdparty/jvm/org/mockito/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "mockito_all", 4 | exports = [ 5 | "//external:jar/org/mockito/mockito_all" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /3rdparty/jvm/commons_pool/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "commons_pool", 4 | exports = [ 5 | "//external:jar/commons_pool/commons_pool" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /3rdparty/jvm/com/google/code/findbugs/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "jsr305", 4 | exports = [ 5 | "//external:jar/com/google/code/findbugs/jsr305" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/BUILD.bazel: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "apache_xmlrpc_server", 3 | srcs = glob([ 4 | "src/main/**/*.java", 5 | ]), 6 | visibility = ["//visibility:public"], 7 | deps = [ 8 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_logging", 9 | "//apache_xmlrpc_common", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /rosjava/test/parameter_client.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /rosjava/test/slave_api_simtime.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /3rdparty/jvm/dnsjava/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "dnsjava", 4 | exports = [ 5 | "//external:jar/dnsjava/dnsjava" 6 | ], 7 | runtime_deps = [ 8 | "//3rdparty/jvm/junit:junit" 9 | ], 10 | visibility = [ 11 | "//visibility:public" 12 | ] 13 | ) 14 | 15 | 16 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/BUILD.bazel: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "apache_xmlrpc_common", 3 | srcs = glob([ 4 | "src/main/**/*.java", 5 | ]), 6 | visibility = ["//visibility:public"], 7 | deps = [ 8 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_httpclient", 9 | "//3rdparty/jvm/org/apache/ws/commons:ws_commons_util", 10 | ], 11 | ) 12 | -------------------------------------------------------------------------------- /3rdparty/jvm/com/google/guava/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "guava", 4 | exports = [ 5 | "//external:jar/com/google/guava/guava" 6 | ], 7 | runtime_deps = [ 8 | "//3rdparty/jvm/com/google/code/findbugs:jsr305" 9 | ], 10 | visibility = [ 11 | "//visibility:public" 12 | ] 13 | ) 14 | 15 | 16 | -------------------------------------------------------------------------------- /rosjava/test/parameter_client_params.yaml: -------------------------------------------------------------------------------- 1 | param_client: 2 | tilde: tildetestsucceed 3 | parameter_namespace: foo 4 | target_namespace: bar/baz 5 | foo: 6 | string: hello there 7 | int: 23841234 8 | float: 3.14159 9 | bool: true 10 | list: [1,1,2,3,5,8,13] 11 | composite: 12 | a: 13 | x: 1.0 14 | y: 2.0 15 | z: 3.0 16 | w: 4.0 17 | b: 18 | x: 10.0 19 | y: 20.0 20 | z: 30.0 21 | -------------------------------------------------------------------------------- /3rdparty/jvm/org/apache/ws/commons/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "ws_commons_util", 4 | exports = [ 5 | "//external:jar/org/apache/ws/commons/ws_commons_util" 6 | ], 7 | runtime_deps = [ 8 | "//3rdparty/jvm/junit:junit", 9 | "//3rdparty/jvm/xml_apis:xml_apis" 10 | ], 11 | visibility = [ 12 | "//visibility:public" 13 | ] 14 | ) 15 | 16 | 17 | -------------------------------------------------------------------------------- /rosjava/test/string_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from ros import rospy 3 | from ros import std_msgs 4 | import std_msgs.msg 5 | 6 | def publisher(): 7 | rospy.init_node('string_publisher') 8 | pub = rospy.Publisher('string_in', std_msgs.msg.String) 9 | m = std_msgs.msg.String(rospy.get_name()) 10 | r = rospy.Rate(10) 11 | while not rospy.is_shutdown(): 12 | pub.publish(m) 13 | r.sleep() 14 | 15 | if __name__ == '__main__': 16 | publisher() 17 | -------------------------------------------------------------------------------- /rosjava_tutorial_pubsub/BUILD.bazel: -------------------------------------------------------------------------------- 1 | java_binary( 2 | name = "rosjava_tutorial_pubsub", 3 | srcs = glob([ 4 | "src/main/**/*.java", 5 | ]), 6 | main_class = "org.ros.RosRun", 7 | deps = [ 8 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_logging", 9 | "//3rdparty/jvm/org/ros/rosjava_messages:std_msgs", 10 | "//rosjava", 11 | "@com_github_rosjava_rosjava_bootstrap//message_generation", 12 | ], 13 | ) 14 | -------------------------------------------------------------------------------- /rosjava/test/int64_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from ros import rospy 3 | from ros import std_msgs 4 | import std_msgs.msg 5 | 6 | def publisher(): 7 | rospy.init_node('int64_publisher') 8 | pub = rospy.Publisher('int64_in', std_msgs.msg.Int64) 9 | i = 0 10 | r = rospy.Rate(10) 11 | m = std_msgs.msg.Int64(i) 12 | while not rospy.is_shutdown(): 13 | pub.publish(m) 14 | i += 1 15 | m.data = i 16 | r.sleep() 17 | 18 | if __name__ == '__main__': 19 | publisher() 20 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/BUILD.bazel: -------------------------------------------------------------------------------- 1 | java_library( 2 | name = "apache_xmlrpc_client", 3 | srcs = glob([ 4 | "src/main/**/*.java", 5 | ]), 6 | resources = glob([ 7 | "src/main/resources/**", 8 | ]), 9 | visibility = ["//visibility:public"], 10 | deps = [ 11 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_httpclient", 12 | "//3rdparty/jvm/org/apache/ws/commons:ws_commons_util", 13 | "//apache_xmlrpc_common", 14 | ], 15 | ) 16 | -------------------------------------------------------------------------------- /rosjava/test/testheader_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from ros import rospy 3 | from ros import rosjava_test_msgs 4 | import rosjava_test_msgs.msg 5 | 6 | def publisher(): 7 | rospy.init_node('testheader_publisher') 8 | pub = rospy.Publisher('test_header_in', rosjava_test_msgs.msg.TestHeader) 9 | r = rospy.Rate(10) 10 | m = rosjava_test_msgs.msg.TestHeader() 11 | m.caller_id = rospy.get_name() 12 | m.header.stamp = rospy.get_rostime() 13 | while not rospy.is_shutdown(): 14 | pub.publish(m) 15 | r.sleep() 16 | 17 | if __name__ == '__main__': 18 | publisher() 19 | -------------------------------------------------------------------------------- /rosjava/.settings/org.moreunit.prefs: -------------------------------------------------------------------------------- 1 | #Thu Feb 03 15:51:43 CET 2011 2 | eclipse.preferences.version=1 3 | org.moreunit.extendedTestMethodSearch=true 4 | org.moreunit.flexiblenaming=true 5 | org.moreunit.test_type=junit4 6 | org.moreunit.unitsourcefolder=java\:src\:java\:tests\#java\:apache-xmlrpc-3.1.3-src/client/src/main/java\:java\:tests\#java\:apache-xmlrpc-3.1.3-src/common/src/main/java\:java\:tests\#java\:apache-xmlrpc-3.1.3-src/server/src/main/java\:java\:tests\#java\:commons-logging-1.1.1-src/src/java\:java\:tests\#java\:ws-commons-util-1.0.2-src/src/main/java\:java\:tests\#java\:commons-httpclient-3.1-src/src/java\:java\:tests 7 | -------------------------------------------------------------------------------- /rosjava/test/composite_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from ros import rospy 3 | from ros import rosjava_test_msgs 4 | import rosjava_test_msgs.msg 5 | import random 6 | 7 | def publisher(): 8 | rospy.init_node('composite_publisher') 9 | pub = rospy.Publisher('composite_in', rosjava_test_msgs.msg.Composite) 10 | r = rospy.Rate(10) 11 | m = rosjava_test_msgs.msg.Composite() 12 | m.a.x = random.random() * 10000. 13 | m.a.y = random.random() * 10000. 14 | m.a.z = random.random() * 10000. 15 | m.a.w = m.a.x + m.a.y + m.a.z 16 | 17 | m.b.x = m.a.x 18 | m.b.y = m.a.y 19 | m.b.z = m.a.z 20 | 21 | while not rospy.is_shutdown(): 22 | pub.publish(m) 23 | r.sleep() 24 | 25 | if __name__ == '__main__': 26 | publisher() 27 | -------------------------------------------------------------------------------- /rosjava_geometry/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | dependencies { 18 | compile project(':rosjava') 19 | testCompile 'junit:junit:4.8.2' 20 | } 21 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/master/uri/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for representing master URIs. 19 | */ 20 | package org.ros.master.uri; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/math/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides utility classes for common mathematical operations. 19 | */ 20 | package org.ros.math; -------------------------------------------------------------------------------- /apache_xmlrpc_client/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | dependencies { 18 | compile project(':apache_xmlrpc_common') 19 | compile 'org.apache.ws.commons:ws-commons-util:1.0.1' 20 | } 21 | 22 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/master/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for communicating with the master. 19 | */ 20 | package org.ros.master.client; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/namespace/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for representing names in the ROS graph. 19 | */ 20 | package org.ros.namespace; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/time/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for dealing with time and clock synchronization. 19 | */ 20 | package org.ros.time; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/address/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for acquiring and representing network addresses. 19 | */ 20 | package org.ros.address; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/concurrent/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides utility classes for common concurrent programming operations. 19 | */ 20 | package org.ros.concurrent; -------------------------------------------------------------------------------- /rosjava_tutorial_services/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | apply plugin: 'application' 18 | 19 | mainClassName = 'org.ros.RosRun' 20 | 21 | dependencies { 22 | compile project(':rosjava') 23 | } 24 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | dependencies { 18 | compile project(':apache_xmlrpc_common') 19 | compile 'org.apache.commons:com.springsource.org.apache.commons.logging:1.1.1' 20 | } 21 | 22 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/best_practices.rst: -------------------------------------------------------------------------------- 1 | Best practices 2 | ============== 3 | 4 | rosjava is different than other ROS client libraries in many respects. As a 5 | result, there are new best practices that should be followed while developing a 6 | rosjava application. 7 | 8 | Java package names 9 | ------------------ 10 | 11 | As usual, Java package names should start with a reversed domain name. In the 12 | ROS ecosystem, the domain name should be followed by the ROS package name. For 13 | example: 14 | 15 | - org.ros.rosjava 16 | - org.ros.rosjava_geometry 17 | 18 | Only core packages (e.g. those in rosjava_core and android_core) should begin 19 | with org.ros. A suitably unique choice for github based repos would be 20 | the github url followed organization and repository/package name, e.g. 21 | 22 | - com.github.rosjava.rosjava_extras 23 | 24 | -------------------------------------------------------------------------------- /rosjava_test/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | apply plugin: 'application' 18 | 19 | mainClassName = 'org.ros.RosRun' 20 | 21 | dependencies { 22 | compile project(':rosjava') 23 | compile 'junit:junit:4.8.2' 24 | } 25 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | dependencies { 18 | compile 'org.apache.commons:com.springsource.org.apache.commons.httpclient:3.1.0' 19 | compile 'org.apache.ws.commons:ws-commons-util:1.0.1' 20 | } 21 | 22 | -------------------------------------------------------------------------------- /rosjava_benchmarks/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | apply plugin: 'application' 18 | 19 | mainClassName = 'org.ros.RosRun' 20 | 21 | dependencies { 22 | compile project(':rosjava') 23 | compile project(':rosjava_geometry') 24 | } 25 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/index.rst: -------------------------------------------------------------------------------- 1 | rosjava_core 2 | ============ 3 | 4 | rosjava_core is a pure Java implementation of ROS. It provides a client library 5 | that enables Java programmers to quickly interface with ROS Topics, Services, 6 | and Parameters. It also provides a Java implementation of `roscore`_. 7 | 8 | Support is best found on http://answers.ros.org/. 9 | 10 | Please file bugs and feature requests on the rosjava `issues`_ page. 11 | 12 | In addition to the following documentation, rosjava_core makes liberal use of 13 | `Javadoc`_. 14 | 15 | .. _roscore: http://ros.org/wiki/roscore 16 | .. _issues: https://github.com/rosjava/rosjava_core 17 | .. _Javadoc: javadoc/index.html 18 | 19 | Contents: 20 | 21 | .. toctree:: 22 | :maxdepth: 2 23 | 24 | overview 25 | installing 26 | building 27 | best_practices 28 | getting_started 29 | advanced 30 | 31 | -------------------------------------------------------------------------------- /rosjava_geometry/src/main/java/org/ros/rosjava_geometry/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for common geometry operations and representations (e.g. transformations). 19 | */ 20 | package org.ros.rosjava_geometry; -------------------------------------------------------------------------------- /rosjava_tutorial_pubsub/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | apply plugin: 'application' 18 | 19 | mainClassName = 'org.ros.RosRun' 20 | 21 | dependencies { 22 | compile project(':rosjava') 23 | } 24 | 25 | defaultTasks 'publish', 'installDist' 26 | 27 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/concurrent/DroppedEntryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.concurrent; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class DroppedEntryException extends Exception { 23 | } 24 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/topic/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for communicating via topics. 19 | * 20 | * @see topics documentation 21 | */ 22 | package org.ros.node.topic; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/service/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for communicating via services. 19 | * 20 | * @see services documentation 21 | */ 22 | package org.ros.node.service; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/master/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for communicating with and implementing the master. 19 | * 20 | * @see master documentation 21 | */ 22 | package org.ros.master; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for creating and communicating with nodes in the ROS graph. 19 | * 20 | * @see nodes documentation 21 | */ 22 | package org.ros.node; -------------------------------------------------------------------------------- /rosjava_tutorial_right_hand_rule/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | apply plugin: 'application' 18 | 19 | mainClassName = 'org.ros.RosRun' 20 | 21 | dependencies { 22 | compile project(':rosjava') 23 | compile 'org.ros.rosjava_messages:sensor_msgs:[1.12,1.13)' 24 | } 25 | 26 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/client/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for clients. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.client; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/server/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for servers. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.server; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for working with the network layer. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/address/AdvertiseAddressFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.address; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public interface AdvertiseAddressFactory { 23 | 24 | AdvertiseAddress newDefault(); 25 | } 26 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/loader/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for loading node configurations. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.loader; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/topic/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for working with topics. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.topic; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/system/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal utility classes for system operations. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.system; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/service/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for working with services. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.service; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/topic/TransportHints.java: -------------------------------------------------------------------------------- 1 | package org.ros.node.topic; 2 | 3 | import org.ros.node.ConnectedNode; 4 | 5 | 6 | /** 7 | * Provides a way of specifying network transport hints to 8 | * {@link ConnectedNode#newSubscriber(org.ros.namespace.GraphName, String, TransportHints)} and 9 | * {@link ConnectedNode#newSubscriber(String, String, TransportHints)}. 10 | * 11 | * @author stefan.glaser@hs-offenburg.de (Stefan Glaser) 12 | */ 13 | public class TransportHints { 14 | 15 | private boolean tcpNoDelay; 16 | 17 | public TransportHints() { 18 | this(false); 19 | } 20 | 21 | public TransportHints(boolean tcpNoDelay) { 22 | this.tcpNoDelay = tcpNoDelay; 23 | } 24 | 25 | public TransportHints tcpNoDelay(boolean tcpNoDelay) { 26 | this.tcpNoDelay = tcpNoDelay; 27 | return this; 28 | } 29 | 30 | public boolean getTcpNoDelay() { 31 | return tcpNoDelay; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for representing RPC results. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.response; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/parameter/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides the classes for accessing and modifying parameters. 19 | * 20 | * @see parameter server documentation 21 | */ 22 | package org.ros.node.parameter; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/xmlrpc/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for working with the ROS XML-RPC layer. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.xmlrpc; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/parameter/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for working with the parameter server. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.parameter; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes that are core to the implementation of rosjava. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.transport; -------------------------------------------------------------------------------- /rosjava/test/string_passthrough.rostest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/concurrent/Rate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.concurrent; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public interface Rate { 23 | 24 | /** 25 | * Sleeps until the configured rate is achieved. 26 | */ 27 | void sleep(); 28 | } 29 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for creating and communicating with nodes in the ROS graph. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/server/master/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for the server side of the master. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | */ 22 | package org.ros.internal.node.server.master; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/xmlrpc/XmlRpcEndpoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.xmlrpc; 18 | 19 | /** 20 | * Represents the XML-RPC interface for a client or server. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public interface XmlRpcEndpoint { 25 | } 26 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/address/Address.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.address; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public interface Address { 23 | 24 | public static final String LOOPBACK = "127.0.0.1"; 25 | public static final String LOCALHOST = "localhost"; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/Parameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros; 18 | 19 | import org.ros.namespace.GraphName; 20 | 21 | /** 22 | * ROS parameters. 23 | * 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public interface Parameters { 27 | 28 | public static final GraphName USE_SIM_TIME = GraphName.of("/use_sim_time"); 29 | } 30 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/DuplicateServiceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class DuplicateServiceException extends RosRuntimeException { 23 | 24 | public DuplicateServiceException(final String message) { 25 | super(message); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/VoidResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class VoidResultFactory implements ResultFactory { 23 | 24 | @Override 25 | public Void newFromValue(Object value) { 26 | return null; 27 | } 28 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/ObjectResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | /** 20 | * @author kwc@willowgarage.com (Ken Conley) 21 | */ 22 | public class ObjectResultFactory implements ResultFactory { 23 | 24 | @Override 25 | public Object newFromValue(Object value) { 26 | return value; 27 | } 28 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/tcp/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | /** 18 | * Provides internal classes for implementing TCPROS. 19 | *

20 | * These classes should _not_ be used directly outside of the org.ros package. 21 | * 22 | * @see TCPROS documentation 23 | */ 24 | package org.ros.internal.transport.tcp; -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/time/TimeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.time; 18 | 19 | import org.ros.message.Time; 20 | 21 | /** 22 | * Provide time. 23 | * 24 | * @author kwc@willowgarage.com (Ken Conley) 25 | */ 26 | public interface TimeProvider { 27 | 28 | /** 29 | * @return the current time of the system using rostime 30 | */ 31 | Time getCurrentTime(); 32 | 33 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/BooleanResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | /** 20 | * @author kwc@willowgarage.com (Ken Conley) 21 | */ 22 | public class BooleanResultFactory implements ResultFactory { 23 | 24 | @Override 25 | public Boolean newFromValue(Object value) { 26 | return (Boolean) value; 27 | } 28 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/StringResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class StringResultFactory implements ResultFactory { 23 | 24 | @Override 25 | public String newFromValue(Object value) { 26 | return (String) value; 27 | } 28 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/IntegerResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class IntegerResultFactory implements ResultFactory { 23 | 24 | @Override 25 | public Integer newFromValue(Object value) { 26 | return (Integer) value; 27 | } 28 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/Topics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros; 18 | 19 | import org.ros.namespace.GraphName; 20 | 21 | /** 22 | * ROS topics. 23 | * 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public interface Topics { 27 | 28 | public static final GraphName ROSOUT = GraphName.of("/rosout"); 29 | public static final GraphName CLOCK = GraphName.of("/clock"); 30 | } 31 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/address/PrivateAdvertiseAddressFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.address; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class PrivateAdvertiseAddressFactory implements AdvertiseAddressFactory { 23 | 24 | @Override 25 | public AdvertiseAddress newDefault() { 26 | return new AdvertiseAddress(Address.LOOPBACK); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | include( 18 | 'apache_xmlrpc_client', 19 | 'apache_xmlrpc_common', 20 | 'apache_xmlrpc_server', 21 | 'rosjava', 22 | 'rosjava_geometry', 23 | 'rosjava_benchmarks', 24 | 'rosjava_test', 25 | 'rosjava_helpers', 26 | 'rosjava_tutorial_pubsub', 27 | 'rosjava_tutorial_right_hand_rule', 28 | 'rosjava_tutorial_services', 29 | 'docs', 30 | ) 31 | 32 | -------------------------------------------------------------------------------- /rosjava/src/test/java/org/ros/Assert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import org.ros.namespace.GraphName; 22 | 23 | /** 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public class Assert { 27 | 28 | public static void assertGraphNameEquals(String name, GraphName graphName) { 29 | assertEquals(name, graphName.toString()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/parameter/ParameterListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node.parameter; 18 | 19 | /** 20 | * Called when a subscribed parameter value changes. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public interface ParameterListener { 25 | 26 | /** 27 | * @param value 28 | * the new parameter value 29 | */ 30 | void onNewValue(Object value); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | rosjava_core 4 | 0.3.7 5 | 6 | An implementation of ROS in pure-Java with Android support. 7 | 8 | http://ros.org/wiki/rosjava_core 9 | Damon Kohler 10 | Apache 2.0 11 | 12 | catkin 13 | rosjava_build_tools 14 | rosjava_bootstrap 15 | geometry_msgs 16 | nav_msgs 17 | rosjava_test_msgs 18 | rosgraph_msgs 19 | sensor_msgs 20 | tf2_msgs 21 | 22 | 26 | rosjava_messages 27 | 28 | 29 | -------------------------------------------------------------------------------- /3rdparty/jvm/org/ros/rosjava_bootstrap/BUILD: -------------------------------------------------------------------------------- 1 | # Do not edit. bazel-deps autogenerates this file from dependencies.yaml. 2 | java_library( 3 | name = "gradle_plugins", 4 | exports = [ 5 | "//external:jar/org/ros/rosjava_bootstrap/gradle_plugins" 6 | ], 7 | visibility = [ 8 | "//visibility:public" 9 | ] 10 | ) 11 | 12 | 13 | 14 | java_library( 15 | name = "message_generation", 16 | exports = [ 17 | "//external:jar/org/ros/rosjava_bootstrap/message_generation" 18 | ], 19 | runtime_deps = [ 20 | "//3rdparty/jvm/com/google/guava:guava", 21 | "//3rdparty/jvm/commons_pool:commons_pool", 22 | "//3rdparty/jvm/io/netty:netty", 23 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_codec", 24 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_io", 25 | "//3rdparty/jvm/org/apache/commons:com_springsource_org_apache_commons_lang", 26 | ":gradle_plugins" 27 | ], 28 | visibility = [ 29 | "//visibility:public" 30 | ] 31 | ) 32 | 33 | 34 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/time/WallTimeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.time; 18 | 19 | import org.ros.message.Time; 20 | 21 | /** 22 | * Provides wallclock (actual) time. 23 | * 24 | * @author kwc@willowgarage.com (Ken Conley) 25 | */ 26 | public class WallTimeProvider implements TimeProvider { 27 | 28 | @Override 29 | public Time getCurrentTime() { 30 | return Time.fromMillis(System.currentTimeMillis()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/xmlrpc/XmlRpcTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.xmlrpc; 18 | 19 | /** 20 | * @author kwc@willowgarage.com (Ken Conley) 21 | * @author damonkohler@google.com (Damon Kohler) 22 | */ 23 | public class XmlRpcTimeoutException extends RuntimeException { 24 | 25 | public XmlRpcTimeoutException() { 26 | } 27 | 28 | public XmlRpcTimeoutException(Exception e) { 29 | super(e); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/ResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | * 22 | * @param 23 | * the result type 24 | */ 25 | public interface ResultFactory { 26 | 27 | /** 28 | * @param value 29 | * @return a value to be returned as the result part of a {@link Response} 30 | */ 31 | public T newFromValue(Object value); 32 | } 33 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/ProtocolNames.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport; 18 | 19 | import java.util.Collection; 20 | 21 | import com.google.common.collect.Sets; 22 | 23 | /** 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public interface ProtocolNames { 27 | 28 | public static final String TCPROS = "TCPROS"; 29 | public static final String UDPROS = "UDPROS"; 30 | public static final Collection SUPPORTED = Sets.newHashSet(TCPROS); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/RosException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * @author ethan.rublee@gmail.com (Ethan Rublee) 21 | */ 22 | public class RosException extends Exception { 23 | 24 | public RosException(final Throwable throwable) { 25 | super(throwable); 26 | } 27 | 28 | public RosException(final String message, final Throwable throwable) { 29 | super(message, throwable); 30 | } 31 | 32 | public RosException(final String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class ServiceException extends Exception { 23 | 24 | public ServiceException(final Throwable throwable) { 25 | super(throwable); 26 | } 27 | 28 | public ServiceException(final String message, final Throwable throwable) { 29 | super(message, throwable); 30 | } 31 | 32 | public ServiceException(final String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/server/ServerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.server; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class ServerException extends Exception { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | public ServerException(String message) { 27 | super(message); 28 | } 29 | 30 | /** 31 | * @param e the wrapped {@link Exception} 32 | */ 33 | public ServerException(Exception e) { 34 | super(e); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/tcp/AbstractNamedChannelHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport.tcp; 18 | 19 | import org.jboss.netty.channel.SimpleChannelHandler; 20 | 21 | /** 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public abstract class AbstractNamedChannelHandler extends SimpleChannelHandler implements 25 | NamedChannelHandler { 26 | 27 | @Override 28 | public String toString() { 29 | return String.format("NamedChannelHandler<%s, %s>", getName(), super.toString()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.server; 20 | 21 | import org.apache.xmlrpc.XmlRpcConfig; 22 | 23 | 24 | /** Server specific extension of {@link org.apache.xmlrpc.XmlRpcConfig}. 25 | */ 26 | public interface XmlRpcServerConfig extends XmlRpcConfig { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/RosRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class RosRuntimeException extends RuntimeException { 23 | 24 | public RosRuntimeException(final Throwable throwable) { 25 | super(throwable); 26 | } 27 | 28 | public RosRuntimeException(final String message, final Throwable throwable) { 29 | super(message, throwable); 30 | } 31 | 32 | public RosRuntimeException(final String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/tcp/TcpRosProtocolDescription.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport.tcp; 18 | 19 | import org.ros.address.AdvertiseAddress; 20 | import org.ros.internal.transport.ProtocolDescription; 21 | import org.ros.internal.transport.ProtocolNames; 22 | 23 | /** 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public class TcpRosProtocolDescription extends ProtocolDescription { 27 | 28 | public TcpRosProtocolDescription(AdvertiseAddress address) { 29 | super(ProtocolNames.TCPROS, address); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/overview.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | While rosjava is mostly feature complete, it is currently under active 5 | development. Consider all APIs and documentation to be volatile. 6 | 7 | `Javadoc `_ is used extensively and cross referenced from 8 | this documentation. 9 | 10 | Android friendly 11 | ---------------- 12 | 13 | One of the primary goals of rosjava is to bring ROS to Android. See the 14 | android_core :ref:`android-core:getting-started` documentation for more 15 | information. 16 | 17 | Asynchronous 18 | ------------ 19 | 20 | Because ROS is heavily dependent on network communication, rosjava is 21 | asynchronous. No attempt is made to hide asynchronous behavior behind a 22 | synchronous API. As a result, the rosjava APIs may feel unfamiliar. 23 | 24 | More threads, fewer processes 25 | ----------------------------- 26 | 27 | You will not find a ``spin()`` method in rosjav in rosjava. Unlike other client 28 | libraries, many rosjava nodes can run in a thread pool within a single JVM 29 | process. In this way, rosjava nodes are similar to C++ nodlets. In the future, 30 | rosjava nodes will support in memory communication in the same way that C++ 31 | nodelets do today. 32 | 33 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # CMake 3 | ############################################################################## 4 | 5 | cmake_minimum_required(VERSION 2.8.3) 6 | project(rosjava_core) 7 | 8 | ############################################################################## 9 | # Catkin 10 | ############################################################################## 11 | 12 | find_package(catkin REQUIRED 13 | rosjava_build_tools 14 | geometry_msgs 15 | nav_msgs 16 | rosjava_test_msgs 17 | rosgraph_msgs 18 | sensor_msgs 19 | tf2_msgs 20 | ) 21 | 22 | catkin_rosjava_setup(publish installDist) 23 | 24 | # make sure messages get built first if genjava is enabled 25 | add_dependencies(gradle-${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) 26 | 27 | catkin_package() 28 | 29 | ############################################################################## 30 | # Installation 31 | ############################################################################## 32 | 33 | install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/rosjava_core/ 34 | DESTINATION ${CATKIN_GLOBAL_MAVEN_DESTINATION}/org/ros/rosjava_core) 35 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/EnvironmentVariables.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros; 18 | 19 | /** 20 | * ROS environment variables. 21 | * 22 | * @author kwc@willowgarage.com (Ken Conley) 23 | */ 24 | public interface EnvironmentVariables { 25 | 26 | public static String ROS_MASTER_URI = "ROS_MASTER_URI"; 27 | public static String ROS_IP = "ROS_IP"; 28 | public static String ROS_HOSTNAME = "ROS_HOSTNAME"; 29 | public static String ROS_NAMESPACE = "ROS_NAMESPACE"; 30 | public static String ROS_ROOT = "ROS_ROOT"; 31 | public static String ROS_PACKAGE_PATH = "ROS_PACKAGE_PATH"; 32 | } 33 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/tcp/NamedChannelHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport.tcp; 18 | 19 | import org.jboss.netty.channel.ChannelDownstreamHandler; 20 | import org.jboss.netty.channel.ChannelHandler; 21 | import org.jboss.netty.channel.ChannelUpstreamHandler; 22 | 23 | /** 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public interface NamedChannelHandler extends ChannelUpstreamHandler, ChannelDownstreamHandler { 27 | 28 | /** 29 | * @return the name of this {@link ChannelHandler} 30 | */ 31 | String getName(); 32 | } 33 | -------------------------------------------------------------------------------- /bazel/repositories.bzl: -------------------------------------------------------------------------------- 1 | """External dependencies for rosjava_core, excluding Maven dependencies. 2 | 3 | Maven dependencies must be added to the workspace with bazel-deps. 4 | """ 5 | 6 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 7 | 8 | def rosjava_repositories(): 9 | _maybe(http_archive, 10 | name = "com_googlesource_gerrit_bazlets", 11 | sha256 = "cdd1a90733cdb71ac4fb86aa6027d3fcad275fe74781175f8437a9c86a0db149", 12 | strip_prefix = "bazlets-4459b9706a6eedb8453a98d4434fb3bc4db84211", 13 | urls = [ 14 | "https://github.com/GerritCodeReview/bazlets/archive/4459b9706a6eedb8453a98d4434fb3bc4db84211.tar.gz", 15 | ], 16 | ) 17 | 18 | _maybe(http_archive, 19 | name = "com_github_rosjava_rosjava_bootstrap", 20 | sha256 = "3c59776a8c6e22232d07f29a686c0e5f401812ec27f59405711657d54a792c08", 21 | strip_prefix = "rosjava_bootstrap-62f865dbe8a7830b21e054dc2a5ac7d2edc6eafe", 22 | urls = [ 23 | "https://github.com/rosjava/rosjava_bootstrap/archive/62f865dbe8a7830b21e054dc2a5ac7d2edc6eafe.tar.gz", 24 | ], 25 | ) 26 | 27 | 28 | def _maybe(repo_rule, name, **kwargs): 29 | if name not in native.existing_rules(): 30 | repo_rule(name=name, **kwargs) 31 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/ServiceNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class ServiceNotFoundException extends RosException { 23 | 24 | public ServiceNotFoundException(final Throwable throwable) { 25 | super(throwable); 26 | } 27 | 28 | public ServiceNotFoundException(final String message, final Throwable throwable) { 29 | super(message, throwable); 30 | } 31 | 32 | public ServiceNotFoundException(final String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/UriResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | import java.net.URI; 20 | import java.net.URISyntaxException; 21 | 22 | import org.ros.exception.RosRuntimeException; 23 | 24 | /** 25 | * @author damonkohler@google.com (Damon Kohler) 26 | */ 27 | public class UriResultFactory implements ResultFactory { 28 | 29 | @Override 30 | public URI newFromValue(Object value) { 31 | try { 32 | return new URI((String) value); 33 | } catch (URISyntaxException e) { 34 | throw new RosRuntimeException(e); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/StringParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | 23 | 24 | /** Parser implementation for parsing a string. 25 | */ 26 | public class StringParser extends AtomicParser { 27 | protected void setResult(String pResult) throws SAXException { 28 | super.setResult((Object) pResult); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/RemoteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | import org.ros.internal.node.response.StatusCode; 20 | 21 | /** 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public class RemoteException extends RosRuntimeException { 25 | 26 | private final StatusCode statusCode; 27 | 28 | public RemoteException(StatusCode statusCode, String message) { 29 | super(message); 30 | this.statusCode = statusCode; 31 | } 32 | 33 | /** 34 | * @return the status code 35 | */ 36 | public StatusCode getStatusCode() { 37 | return statusCode; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/topic/TopicParticipant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.topic; 18 | 19 | import org.ros.namespace.GraphName; 20 | 21 | /** 22 | * Represents a ROS topic. 23 | * 24 | * @see Topics documentation 25 | * 26 | * @author damonkohler@google.com (Damon Kohler) 27 | */ 28 | public interface TopicParticipant { 29 | 30 | /** 31 | * @return the name of the subscribed topic 32 | */ 33 | GraphName getTopicName(); 34 | 35 | /** 36 | * @return the message type (e.g. "std_msgs/String") 37 | */ 38 | String getTopicMessageType(); 39 | } -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcStreamTransportFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | 22 | /** Abstract base implementation of a factory for stream transports. 23 | */ 24 | public abstract class XmlRpcStreamTransportFactory extends XmlRpcTransportFactoryImpl { 25 | protected XmlRpcStreamTransportFactory(XmlRpcClient pClient) { 26 | super(pClient); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/XmlRpcRequestConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc; 20 | 21 | 22 | /** Interface of a request configuration. Depending on 23 | * the transport, implementations will also implement 24 | * additional interfaces like 25 | * {@link org.apache.xmlrpc.common.XmlRpcStreamRequestConfig}. 26 | */ 27 | public interface XmlRpcRequestConfig extends XmlRpcConfig { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/AbstractNodeMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node; 18 | 19 | /** 20 | * A {@link NodeMain} which provides empty defaults for all signals. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public abstract class AbstractNodeMain implements NodeMain { 25 | 26 | @Override 27 | public void onStart(ConnectedNode connectedNode) { 28 | } 29 | 30 | @Override 31 | public void onShutdown(Node node) { 32 | } 33 | 34 | @Override 35 | public void onShutdownComplete(Node node) { 36 | } 37 | 38 | @Override 39 | public void onError(Node node, Throwable throwable) { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/DefaultNodeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node; 18 | 19 | /** 20 | * A {@link NodeListener} which provides empty defaults for all signals. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public class DefaultNodeListener implements NodeListener { 25 | 26 | @Override 27 | public void onStart(ConnectedNode connectedNode) { 28 | } 29 | 30 | @Override 31 | public void onShutdown(Node node) { 32 | } 33 | 34 | @Override 35 | public void onShutdownComplete(Node node) { 36 | } 37 | 38 | @Override 39 | public void onError(Node node, Throwable throwable) { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/concurrent/SignalRunnable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.concurrent; 18 | 19 | /** 20 | * Decouples specific listener interfaces from the signaling implementation. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | * 24 | * @param 25 | * the type of listener 26 | */ 27 | public interface SignalRunnable { 28 | /** 29 | * This method will be called when the listener should be signaled. Users 30 | * should override this method to call the appropriate listener method(s). 31 | * 32 | * @param listener 33 | * the listener to signal 34 | */ 35 | void run(T listener); 36 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/ParameterNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * Thrown when a requested parameter is not found. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public class ParameterNotFoundException extends RosRuntimeException { 25 | 26 | public ParameterNotFoundException(String message) { 27 | super(message); 28 | } 29 | 30 | public ParameterNotFoundException(String message, Throwable throwable) { 31 | super(message, throwable); 32 | } 33 | 34 | public ParameterNotFoundException(Throwable throwable) { 35 | super(throwable); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rosjava_tutorial_right_hand_rule/world/maze-erratic.world: -------------------------------------------------------------------------------- 1 | define topurg ranger 2 | ( 3 | sensor( 4 | range [ 0.0 30.0 ] 5 | fov 270.25 6 | samples 1081 7 | ) 8 | 9 | # generic model properties 10 | color "black" 11 | size [ 0.05 0.05 0.1 ] 12 | ) 13 | 14 | define erratic position 15 | ( 16 | size [0.35 0.35 0.25] 17 | origin [-0.05 0 0 0] 18 | gui_nose 1 19 | drive "diff" 20 | topurg(pose [ 0.050 0.000 0 0.000 ]) 21 | ) 22 | 23 | define floorplan model 24 | ( 25 | # sombre, sensible, artistic 26 | color "gray30" 27 | 28 | # most maps will need a bounding box 29 | boundary 0 30 | 31 | gui_nose 0 32 | gui_grid 0 33 | 34 | gui_outline 0 35 | gripper_return 0 36 | fiducial_return 0 37 | laser_return 1 38 | ) 39 | 40 | # set the resolution of the underlying raytrace model in meters 41 | resolution 0.02 42 | 43 | interval_sim 100 # simulation timestep in milliseconds 44 | 45 | window 46 | ( 47 | size [ 500.0 500.0 ] 48 | rotate [ 0.0 0.0 ] 49 | scale 10.0 50 | ) 51 | 52 | # load an environment bitmap 53 | floorplan 54 | ( 55 | name "maze" 56 | bitmap "maze.png" 57 | size [50.0 50.0 0.5] 58 | pose [ 0.0 0.0 0 0.0 ] 59 | gui_move 0 60 | ) 61 | 62 | # throw in a robot 63 | erratic( pose [ 1.25 -25.0 0.0 90.0 ] name "era" color "blue") 64 | -------------------------------------------------------------------------------- /rosjava_test/scripts/serialized_message.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | # Copyright (C) 2012 Google Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | # use this file except in compliance with the License. You may obtain a copy of 7 | # the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | # License for the specific language governing permissions and limitations under 15 | # the License. 16 | 17 | """Prints the serialized bytese of a nav_msgs.Odometry message in hex. 18 | 19 | This can be modified slightly to print the serialized bytes in hex for 20 | arbitrary ROS messages and is useful for generating test cases for rosjava 21 | message serialization. 22 | """ 23 | 24 | __author__ = 'damonkohler@google.com (Damon Kohler)' 25 | 26 | import StringIO 27 | 28 | import roslib; roslib.load_manifest('rosjava_test') 29 | import rospy 30 | 31 | import nav_msgs.msg as nav_msgs 32 | 33 | message = nav_msgs.Odometry() 34 | buf = StringIO.StringIO() 35 | message.serialize(buf) 36 | print ''.join('0x%02x,' % ord(c) for c in buf.getvalue())[:-1] 37 | 38 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/exception/ParameterClassCastException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.exception; 18 | 19 | /** 20 | * Thrown when a requested parameter does not match the requested parameter 21 | * type. 22 | * 23 | * @author damonkohler@google.com (Damon Kohler) 24 | */ 25 | public class ParameterClassCastException extends RosRuntimeException { 26 | 27 | public ParameterClassCastException(String message) { 28 | super(message); 29 | } 30 | 31 | public ParameterClassCastException(String message, Throwable throwable) { 32 | super(message, throwable); 33 | } 34 | 35 | public ParameterClassCastException(Throwable throwable) { 36 | super(throwable); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/server/master/MasterRegistrationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.server.master; 18 | 19 | /** 20 | * Listen for master registration events from the 21 | * {@link MasterRegistrationManagerImpl}. 22 | * 23 | * @author khughes@google.com (Keith M. Hughes) 24 | */ 25 | public interface MasterRegistrationListener { 26 | 27 | /** 28 | * A node is being replaced. 29 | * 30 | *

31 | * The information object is about to be trashed, so it should not be hung 32 | * onto. 33 | * 34 | * @param nodeInfo 35 | * the node being replaced 36 | */ 37 | void onNodeReplacement(NodeRegistrationInfo nodeInfo); 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/TypeConverterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | 22 | /** A {@link TypeConverterFactory} is called for creating instances 23 | * of {@link TypeConverter}. 24 | */ 25 | public interface TypeConverterFactory { 26 | /** Creates an instance of {@link TypeFactory}, which may be 27 | * used to create instances of the given class. 28 | */ 29 | TypeConverter getTypeConverter(Class pClass); 30 | } 31 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/StringListResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | import java.util.Arrays; 20 | import java.util.List; 21 | 22 | import com.google.common.collect.Lists; 23 | 24 | /** 25 | * @author kwc@willowgarage.com (Ken Conley) 26 | */ 27 | public class StringListResultFactory implements ResultFactory> { 28 | 29 | @Override 30 | public List newFromValue(Object value) { 31 | List strings = Lists.newArrayList(); 32 | List objects = Arrays.asList((Object[]) value); 33 | for (Object topic : objects) { 34 | strings.add((String) topic); 35 | } 36 | return strings; 37 | } 38 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/master/client/SystemState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.master.client; 18 | 19 | import java.util.Collection; 20 | 21 | /** 22 | * The state of the ROS graph as understood by the master. 23 | * 24 | * @author Keith M. Hughes 25 | */ 26 | public class SystemState { 27 | 28 | /** 29 | * All topics known. 30 | */ 31 | private final Collection topics; 32 | 33 | public SystemState(Collection topics) { 34 | this.topics = topics; 35 | } 36 | 37 | /** 38 | * Get all topics in the system state. 39 | * 40 | * @return a collection of topics. 41 | */ 42 | public Collection getTopics() { 43 | return topics; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcLocalClientConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | import org.apache.xmlrpc.common.XmlRpcRequestProcessorFactory; 22 | 23 | 24 | /** Interface of a client configuration for local rpc calls. Local 25 | * rpc calls are mainly useful for testing, because you don't need 26 | * a running server. 27 | */ 28 | public interface XmlRpcLocalClientConfig extends XmlRpcClientConfig, 29 | XmlRpcRequestProcessorFactory { 30 | } 31 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/CommandLineVariables.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros; 18 | 19 | /** 20 | * Remapping keys used to override ROS environment and other configuration 21 | * settings from a command-line-based executation of a node. As of ROS 1.4, only 22 | * {@code CommandLine.NODE_NAME} and {@code CommandLine.ROS_NAMESPACE} are 23 | * required. 24 | * 25 | * @author kwc@willowgarage.com (Ken Conley) 26 | */ 27 | public interface CommandLineVariables { 28 | 29 | public static String ROS_NAMESPACE = "__ns"; 30 | public static String ROS_IP = "__ip"; 31 | public static String ROS_MASTER_URI = "__master"; 32 | public static String TCPROS_PORT = "__tcpros_server_port"; 33 | public static String NODE_NAME = "__name"; 34 | } 35 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/building.rst: -------------------------------------------------------------------------------- 1 | .. _building: 2 | 3 | Building 4 | ======== 5 | 6 | Gradle 7 | ------ 8 | 9 | rosjava_core uses the `Gradle`_ build system in tandem with an external maven 10 | repository which supplies dependencies. 11 | 12 | To build rosjava_core and install it to your local `Maven`_ repository, execute 13 | the `gradle wrapper`_: 14 | 15 | .. code-block:: bash 16 | 17 | cd rosjava_core 18 | ./gradlew install 19 | 20 | To build the documentation, you may execute the docs task: 21 | 22 | .. code-block:: bash 23 | 24 | ./gradlew docs 25 | 26 | To run the tests, you may execute the test task: 27 | 28 | .. code-block:: bash 29 | 30 | ./gradlew test 31 | 32 | To generate Eclipse project files, you may execute the eclipse: 33 | 34 | .. code-block:: bash 35 | 36 | ./gradlew eclipse 37 | 38 | Catkin 39 | ------ 40 | 41 | It also has a very minimal catkin wrapper that relays build instructions to the 42 | underlying gradle builder. This lets the repository be easily built and 43 | deployed alongside other rosjava repositories in a ros environment. Refer to 44 | the `RosWiki`_ for more information. 45 | 46 | 47 | .. _Gradle: http://www.gradle.org/ 48 | .. _rosmake: http://ros.org/wiki/rosmake/ 49 | .. _Maven: http://maven.apache.org/ 50 | .. _gradle wrapper: http://gradle.org/docs/current/userguide/gradle_wrapper.html 51 | .. _RosWiki: http://wiki.ros.org/rosjava 52 | -------------------------------------------------------------------------------- /rosjava/src/test/java/org/ros/internal/transport/ConnectionHeaderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import org.jboss.netty.buffer.ChannelBuffer; 22 | import org.junit.Test; 23 | 24 | /** 25 | * @author damonkohler@google.com (Damon Kohler) 26 | */ 27 | public class ConnectionHeaderTest { 28 | 29 | @Test 30 | public void testEncodeAndDecode() { 31 | ConnectionHeader connectionHeader = new ConnectionHeader(); 32 | connectionHeader.addField("foo", "bar"); 33 | connectionHeader.addField("bloop", ""); 34 | ChannelBuffer encoded = connectionHeader.encode(); 35 | assertEquals(connectionHeader, ConnectionHeader.decode(encoded)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/address/PublicAdvertiseAddressFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.address; 18 | 19 | /** 20 | * An {@link AdvertiseAddressFactory} which creates public (non-loopback) addresses. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public class PublicAdvertiseAddressFactory implements AdvertiseAddressFactory { 25 | 26 | private final String host; 27 | 28 | public PublicAdvertiseAddressFactory() { 29 | this(InetAddressFactory.newNonLoopback().getCanonicalHostName()); 30 | } 31 | 32 | public PublicAdvertiseAddressFactory(String host) { 33 | this.host = host; 34 | } 35 | 36 | @Override 37 | public AdvertiseAddress newDefault() { 38 | return new AdvertiseAddress(host); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/math/CollectionMath.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.math; 18 | 19 | import com.google.common.base.Preconditions; 20 | import com.google.common.collect.Lists; 21 | 22 | import java.util.Collection; 23 | import java.util.Collections; 24 | import java.util.List; 25 | 26 | /** 27 | * @author damonkohler@google.com (Damon Kohler) 28 | */ 29 | public class CollectionMath { 30 | 31 | private CollectionMath() { 32 | // Utility class. 33 | } 34 | 35 | public static > T median(Collection collection) { 36 | Preconditions.checkArgument(collection.size() > 0); 37 | List list = Lists.newArrayList(collection); 38 | Collections.sort(list); 39 | return list.get(list.size() / 2); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/installing.rst: -------------------------------------------------------------------------------- 1 | .. _installing: 2 | 3 | Installing 4 | ========== 5 | 6 | Prerequisites 7 | ------------- 8 | 9 | You will need a java implementation - this package has been well tested with openjdk-6, 10 | but is also likely to work equally as well with other implementations (oraclejdk has 11 | also had minimal testing). 12 | 13 | If you would like to build the rosjava_core documentation, you will also need 14 | Pygments 1.5+ and Sphinx 1.1.3+. If you don't have native binaries, then 15 | 16 | .. code-block:: bash 17 | 18 | sudo pip install --upgrade sphinx Pygments 19 | 20 | 21 | Non-ROS Installation 22 | -------------------- 23 | 24 | This java package no longer requires a ros environment to be installed. In this case, 25 | you simply need to clone the github repository 26 | 27 | .. code-block:: bash 28 | 29 | git clone https://github.com/rosjava/rosjava_core 30 | cd rosjava_core 31 | git checkout -b kinetic origin/kinetic 32 | 33 | and proceed immediately to the section on :ref:`building`. 34 | 35 | ROS Installation 36 | ---------------- 37 | 38 | If you would like a full ros environment backending your installation (you might 39 | be generating code for your own custom messages, sequencing builds of multiple rosjava 40 | repositories or using mixed packages, e.g. java + python) then refer to the `RosWiki`_ 41 | for more details. 42 | 43 | .. _RosWiki: http://wiki.ros.org/rosjava 44 | 45 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/master/uri/StaticMasterUriProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.master.uri; 18 | 19 | import java.net.URI; 20 | import java.util.concurrent.TimeUnit; 21 | 22 | /** 23 | * A {@link MasterUriProvider} which will always return the same URI. 24 | * 25 | * @author Keith M. Hughes 26 | */ 27 | public class StaticMasterUriProvider implements MasterUriProvider { 28 | 29 | /** 30 | * The URI which will always be returned. 31 | */ 32 | private final URI uri; 33 | 34 | public StaticMasterUriProvider(URI uri) { 35 | this.uri = uri; 36 | } 37 | 38 | @Override 39 | public URI getMasterUri() { 40 | return uri; 41 | } 42 | 43 | @Override 44 | public URI getMasterUri(long timeout, TimeUnit unit) { 45 | return uri; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/concurrent/WallTimeRate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.concurrent; 18 | 19 | 20 | /** 21 | * @author damonkohler@google.com (Damon Kohler) 22 | */ 23 | public class WallTimeRate implements Rate { 24 | 25 | private final long delay; 26 | 27 | private long time; 28 | 29 | public WallTimeRate(int hz) { 30 | delay = 1000 / hz; 31 | time = 0; 32 | } 33 | 34 | @Override 35 | public void sleep() { 36 | long delta = System.currentTimeMillis() - time; 37 | while (delta < delay) { 38 | try { 39 | Thread.sleep(delay - delta); 40 | } catch (InterruptedException e) { 41 | break; 42 | } 43 | delta = System.currentTimeMillis() - time; 44 | } 45 | time = System.currentTimeMillis(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/service/ServiceServerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node.service; 18 | 19 | import org.ros.internal.node.RegistrantListener; 20 | 21 | /** 22 | * A lifecycle listener for {@link ServiceServer} instances. 23 | * 24 | * @author khughes@google.com (Keith M. Hughes) 25 | * 26 | * @param 27 | * the {@link ServiceServer} responds to requests of this type 28 | * @param 29 | * the {@link ServiceServer} returns responses of this type 30 | */ 31 | public interface ServiceServerListener extends RegistrantListener> { 32 | 33 | /** 34 | * @param serviceServer 35 | * the {@link ServiceServer} which has been shut down 36 | */ 37 | void onShutdown(ServiceServer serviceServer); 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/src/main/java/org/apache/xmlrpc/server/ServerHttpConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.server; 20 | 21 | import org.apache.xmlrpc.common.ServerStreamConnection; 22 | 23 | 24 | /** Interface of a {@link ServerStreamConnection} for HTTP 25 | * response transport. 26 | */ 27 | public interface ServerHttpConnection extends ServerStreamConnection { 28 | /** Sets a response header. 29 | */ 30 | void setResponseHeader(String pKey, String pValue); 31 | /** Sets the content length. 32 | */ 33 | void setContentLength(int pContentLength); 34 | } 35 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/master/client/TopicType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.master.client; 18 | 19 | /** 20 | * A simple collection of information about a topic. 21 | * 22 | * @author Keith M. Hughes 23 | */ 24 | public class TopicType { 25 | 26 | /** 27 | * Name of the topic. 28 | */ 29 | private final String name; 30 | 31 | /** 32 | * Message type of the topic. 33 | */ 34 | private final String messageType; 35 | 36 | public TopicType(String name, String messageType) { 37 | this.name = name; 38 | this.messageType = messageType; 39 | } 40 | 41 | /** 42 | * @return the name 43 | */ 44 | public String getName() { 45 | return name; 46 | } 47 | 48 | /** 49 | * @return the messageType 50 | */ 51 | public String getMessageType() { 52 | return messageType; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/DoubleSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | 25 | /** A {@link TypeSerializer} for doubles. 26 | */ 27 | public class DoubleSerializer extends TypeSerializerImpl { 28 | /** Tag name of a double value. 29 | */ 30 | public static final String DOUBLE_TAG = "double"; 31 | 32 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 33 | write(pHandler, DOUBLE_TAG, pObject.toString()); 34 | } 35 | } -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/StringSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | 25 | /** A {@link TypeSerializer} for strings. 26 | */ 27 | public class StringSerializer extends TypeSerializerImpl { 28 | /** (Optional) Tag name of a string value. 29 | */ 30 | public static final String STRING_TAG = "string"; 31 | 32 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 33 | write(pHandler, null, pObject.toString()); 34 | } 35 | } -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/XmlRpcHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc; 20 | 21 | 22 | 23 | /** The XML-RPC server uses this interface to call a method of an RPC handler. 24 | */ 25 | public interface XmlRpcHandler { 26 | /** Performs the request and returns the result object. 27 | * @param pRequest The request being performed (method name and 28 | * parameters.) 29 | * @return The result object. 30 | * @throws XmlRpcException Performing the request failed. 31 | */ 32 | public Object execute(XmlRpcRequest pRequest) throws XmlRpcException; 33 | } 34 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcRequestProcessorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | 22 | /** Interface of an object, which may be used 23 | * to create instances of {@link XmlRpcRequestProcessor}. 24 | */ 25 | public interface XmlRpcRequestProcessorFactory { 26 | /** Returns the {@link XmlRpcRequestProcessor} being invoked. 27 | * @return Server object being invoked. This will typically 28 | * be a singleton instance, but could as well create a new 29 | * instance with any call. 30 | */ 31 | XmlRpcRequestProcessor getXmlRpcServer(); 32 | } 33 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/I1Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for byte values. 26 | */ 27 | public class I1Parser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Byte(pResult.trim())); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse byte value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/I8Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for long values. 26 | */ 27 | public class I8Parser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Long(pResult.trim())); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse long value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/javadoc.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | # use this file except in compliance with the License. You may obtain a copy of 5 | # the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations under 13 | # the License. 14 | 15 | __author__ = 'damonkohler@google.com (Damon Kohler)' 16 | 17 | import os 18 | 19 | from docutils import nodes, utils 20 | 21 | 22 | def make_javadoc_link(name, rawtext, text, lineno, inliner, options={}, content=[]): 23 | env = inliner.document.settings.env 24 | javadoc_root = env.config.javadoc_root 25 | class_part, method_part = (text.split('#', 1) + [''])[:2] 26 | refuri = os.path.join(javadoc_root, '%s.html#%s' % (class_part.replace('.', '/'), method_part)) 27 | label = class_part.rsplit('.', 1)[-1] 28 | if method_part: 29 | label += '.' + method_part.split('(')[0] 30 | node = nodes.reference(rawtext, label, refuri=refuri, **options) 31 | return [node], [] 32 | 33 | 34 | def setup(app): 35 | app.add_config_value('javadoc_root', None, 'env') 36 | app.add_role('javadoc', make_javadoc_link) 37 | 38 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/FloatParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for float values. 26 | */ 27 | public class FloatParser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Float(pResult)); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse float value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/I2Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for short values. 26 | */ 27 | public class I2Parser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Short(pResult.trim())); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse short value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/LongParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for long values. 26 | */ 27 | public class LongParser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Long(pResult.trim())); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse long value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/service/DefaultServiceServerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node.service; 18 | 19 | /** 20 | * @author damonkohler@google.com (Damon Kohler) 21 | */ 22 | public class DefaultServiceServerListener implements ServiceServerListener { 23 | 24 | @Override 25 | public void onMasterRegistrationSuccess(ServiceServer registrant) { 26 | } 27 | 28 | @Override 29 | public void onMasterRegistrationFailure(ServiceServer registrant) { 30 | } 31 | 32 | @Override 33 | public void onMasterUnregistrationSuccess(ServiceServer registrant) { 34 | } 35 | 36 | @Override 37 | public void onMasterUnregistrationFailure(ServiceServer registrant) { 38 | } 39 | 40 | @Override 41 | public void onShutdown(ServiceServer serviceServer) { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/DoubleParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for double values. 26 | */ 27 | public class DoubleParser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Double(pResult)); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse double value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/I4Parser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for integer values. 26 | */ 27 | public class I4Parser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | try { 30 | super.setResult(new Integer(pResult.trim())); 31 | } catch (NumberFormatException e) { 32 | throw new SAXParseException("Failed to parse integer value: " + pResult, 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/CharSetXmlWriterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.apache.ws.commons.serialize.CharSetXMLWriter; 22 | import org.apache.ws.commons.serialize.XMLWriter; 23 | 24 | 25 | /** An implementation of {@link org.apache.xmlrpc.serializer.XmlWriterFactory}, 26 | * which creates instances of 27 | * {@link org.apache.ws.commons.serialize.CharSetXMLWriter}. 28 | */ 29 | public class CharSetXmlWriterFactory extends BaseXmlWriterFactory { 30 | protected XMLWriter newXmlWriter() { 31 | return new CharSetXMLWriter(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/src/main/java/org/apache/xmlrpc/server/XmlRpcNoSuchHandlerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.server; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | 23 | 24 | /** This exception is thrown, if an unknown handler is called. 25 | */ 26 | public class XmlRpcNoSuchHandlerException extends XmlRpcException { 27 | private static final long serialVersionUID = 3257002138218344501L; 28 | 29 | /** Creates a new instance with the given message. 30 | * @param pMessage The error details. 31 | */ 32 | public XmlRpcNoSuchHandlerException(String pMessage) { 33 | super(0, pMessage); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcLoadException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | 23 | 24 | /** This exception is thrown, if the clients or servers maximum 25 | * number of concurrent threads is exceeded. 26 | */ 27 | public class XmlRpcLoadException extends XmlRpcException { 28 | private static final long serialVersionUID = 4050760511635272755L; 29 | 30 | /** Creates a new instance. 31 | * @param pMessage Error description. 32 | */ 33 | public XmlRpcLoadException(String pMessage) { 34 | super(0, pMessage, null); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/ClientHandshakeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport; 18 | 19 | /** 20 | * A listener for handshake events. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public interface ClientHandshakeListener { 25 | 26 | /** 27 | * Called when the {@link ClientHandshake} completes successfully. 28 | * 29 | * @param outgoingConnectionHeader 30 | * @param incomingConnectionHeader 31 | */ 32 | void onSuccess(ConnectionHeader outgoingConnectionHeader, 33 | ConnectionHeader incomingConnectionHeader); 34 | 35 | /** 36 | * Called when the {@link ClientHandshake} fails. 37 | * 38 | * @param outgoingConnectionHeader 39 | * @param errorMessage 40 | */ 41 | void onFailure(ConnectionHeader outgoingConnectionHeader, String errorMessage); 42 | } 43 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcNotAuthorizedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | 23 | 24 | /** This exception must be thrown, if the user isn't authenticated. 25 | */ 26 | public class XmlRpcNotAuthorizedException extends XmlRpcException { 27 | private static final long serialVersionUID = 3258410629709574201L; 28 | 29 | /** Creates a new instance with the given error message. 30 | * @param pMessage The error message. 31 | */ 32 | public XmlRpcNotAuthorizedException(String pMessage) { 33 | super(0, pMessage); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/NullParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** SAX parser for a nil element (null value). 26 | */ 27 | public class NullParser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | if (pResult == null || "".equals(pResult.trim())) { 30 | super.setResult((Object) null); 31 | } else { 32 | throw new SAXParseException("Unexpected characters in nil element.", 33 | getDocumentLocator()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/service/ServiceManagerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.service; 18 | 19 | import org.ros.node.service.ServiceServer; 20 | 21 | /** 22 | * Listener {@link ServiceManager} events. 23 | * 24 | * @author damonkohler@google.com (Damon Kohler) 25 | */ 26 | public interface ServiceManagerListener { 27 | 28 | /** 29 | * Called when a new {@link ServiceServer} is added. 30 | * 31 | * @param server 32 | * the {@link ServiceServer} that was added 33 | */ 34 | void onServiceServerAdded(DefaultServiceServer server); 35 | 36 | /** 37 | * Called when a new {@link ServiceServer} is added. 38 | * 39 | * @param server 40 | * the {@link ServiceServer} that was added 41 | */ 42 | void onServiceServerRemoved(DefaultServiceServer server); 43 | } 44 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/TopicTypeListResultFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | import java.util.List; 20 | 21 | import org.ros.master.client.TopicType; 22 | 23 | import com.google.common.collect.Lists; 24 | 25 | /** 26 | * A {@link ResultFactory} to take an object and turn it into a list of 27 | * {@link TopicType} instances. 28 | * 29 | * @author Keith M. Hughes 30 | */ 31 | public class TopicTypeListResultFactory implements 32 | ResultFactory> { 33 | 34 | @Override 35 | public List newFromValue(Object value) { 36 | List topics = Lists.newArrayList(); 37 | 38 | for (Object pair : (Object[]) value) { 39 | topics.add(new TopicType((String) ((Object[]) pair)[0], 40 | (String) ((Object[]) pair)[1])); 41 | } 42 | 43 | return topics; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcTransportFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | 22 | /** Interface of an object creating instances of 23 | * {@link org.apache.xmlrpc.client.XmlRpcTransport}. The implementation 24 | * is typically based on singletons. 25 | */ 26 | public interface XmlRpcTransportFactory { 27 | /** Returns an instance of {@link XmlRpcTransport}. This may 28 | * be a singleton, but the caller should not depend on that: 29 | * A new instance may as well be created for any request. 30 | * @return The configured transport. 31 | */ 32 | public XmlRpcTransport getTransport(); 33 | } 34 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | import org.apache.xmlrpc.XmlRpcConfig; 22 | 23 | 24 | /** Interface of a configuration for a stream based transport. 25 | */ 26 | public interface XmlRpcStreamConfig extends XmlRpcConfig { 27 | /** Default encoding (UTF-8). 28 | */ 29 | public static final String UTF8_ENCODING = "UTF-8"; 30 | 31 | /** Returns the encoding being used for data encoding, when writing 32 | * to a stream. 33 | * @return Suggested encoding, or null, if the {@link #UTF8_ENCODING} 34 | * is being used. 35 | */ 36 | String getEncoding(); 37 | } 38 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/I4Serializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | /** A {@link TypeSerializer} for integers. 25 | */ 26 | public class I4Serializer extends TypeSerializerImpl { 27 | /** Tag name of an int value. 28 | */ 29 | public static final String INT_TAG = "int"; 30 | 31 | /** Tag name of an i4 value. 32 | */ 33 | public static final String I4_TAG = "i4"; 34 | 35 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 36 | write(pHandler, I4_TAG, pObject.toString()); 37 | } 38 | } -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/service/ServiceResponseListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node.service; 18 | 19 | import org.ros.exception.RemoteException; 20 | 21 | /** 22 | * A listener for service responses. 23 | * 24 | * @author damonkohler@google.com (Damon Kohler) 25 | * 26 | * @param 27 | * handles messages of this type 28 | */ 29 | public interface ServiceResponseListener { 30 | 31 | /** 32 | * Called when a service method returns successfully. 33 | * 34 | * @param response 35 | * the response message 36 | */ 37 | void onSuccess(MessageType response); 38 | 39 | /** 40 | * Called when a service method fails to return successfully. 41 | * 42 | * @param e 43 | * the {@link RemoteException} received from the service 44 | */ 45 | void onFailure(RemoteException e); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcLiteHttpTransportFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | 22 | /** Factory for the lite HTTP transport, 23 | * {@link org.apache.xmlrpc.client.XmlRpcLiteHttpTransport}. 24 | */ 25 | public class XmlRpcLiteHttpTransportFactory extends XmlRpcTransportFactoryImpl { 26 | /** 27 | * Creates a new instance. 28 | * @param pClient The client, which will invoke the factory. 29 | */ 30 | public XmlRpcLiteHttpTransportFactory(XmlRpcClient pClient) { 31 | super(pClient); 32 | } 33 | 34 | public XmlRpcTransport getTransport() { return new XmlRpcLiteHttpTransport(getClient()); } 35 | } 36 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/node/service/ServiceResponseBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.node.service; 18 | 19 | import org.ros.exception.ServiceException; 20 | 21 | /** 22 | * Builds a service response given a service request. 23 | * 24 | * @author damonkohler@google.com (Damon Kohler) 25 | * 26 | * @param 27 | * the {@link ServiceServer} responds to requests of this type 28 | * @param 29 | * the {@link ServiceServer} returns responses of this type 30 | */ 31 | public interface ServiceResponseBuilder { 32 | 33 | /** 34 | * Builds a service response given a service request. 35 | * 36 | * @param request 37 | * the received request 38 | * @param response 39 | * the response that will be sent 40 | * @throws ServiceException 41 | */ 42 | void build(T request, S response) throws ServiceException; 43 | } 44 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/service/Service.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.service; 18 | 19 | import org.ros.internal.message.RawMessage; 20 | 21 | /** 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public class Service { 25 | 26 | public interface Request extends RawMessage { 27 | } 28 | 29 | public interface Response extends RawMessage { 30 | } 31 | 32 | private final Request request; 33 | private final Response response; 34 | 35 | public Service(Request request, Response response) { 36 | this.request = request; 37 | this.response = response; 38 | } 39 | 40 | @SuppressWarnings("unchecked") 41 | public T getRequest() { 42 | return (T) request; 43 | } 44 | 45 | @SuppressWarnings("unchecked") 46 | public T getResponse() { 47 | return (T) response; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcExtensionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | 23 | 24 | /** This exception is thrown, if an attempt to use extensions 25 | * is made, but extensions aren't explicitly enabled. 26 | */ 27 | public class XmlRpcExtensionException extends XmlRpcException { 28 | private static final long serialVersionUID = 3617014169594311221L; 29 | 30 | /** Creates a new instance with the given error message. 31 | * @param pMessage The error message. 32 | */ 33 | public XmlRpcExtensionException(String pMessage) { 34 | super(0, pMessage); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerWorkerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.server; 20 | 21 | import org.apache.xmlrpc.common.XmlRpcWorker; 22 | import org.apache.xmlrpc.common.XmlRpcWorkerFactory; 23 | 24 | 25 | /** Server specific worker factory. 26 | */ 27 | public class XmlRpcServerWorkerFactory extends XmlRpcWorkerFactory { 28 | /** Creates a new factory with the given controller. 29 | * @param pServer The factory controller. 30 | */ 31 | public XmlRpcServerWorkerFactory(XmlRpcServer pServer) { 32 | super(pServer); 33 | } 34 | 35 | protected XmlRpcWorker newWorker() { 36 | return new XmlRpcServerWorker(this); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/I1Serializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | /** A {@link TypeSerializer} for bytes. 25 | */ 26 | public class I1Serializer extends TypeSerializerImpl { 27 | /** Tag name of an i1 value. 28 | */ 29 | public static final String I1_TAG = "i1"; 30 | 31 | /** Fully qualified name of an i1 value. 32 | */ 33 | public static final String EX_I1_TAG = "ex:i1"; 34 | 35 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 36 | write(pHandler, I1_TAG, EX_I1_TAG, pObject.toString()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/I2Serializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | /** A {@link TypeSerializer} for shorts. 25 | */ 26 | public class I2Serializer extends TypeSerializerImpl { 27 | /** Tag name of an i2 value. 28 | */ 29 | public static final String I2_TAG = "i2"; 30 | 31 | /** Fully qualified name of an i2 value. 32 | */ 33 | public static final String EX_I2_TAG = "ex:i2"; 34 | 35 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 36 | write(pHandler, I2_TAG, EX_I2_TAG, pObject.toString()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/I8Serializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | /** A {@link TypeSerializer} for longs. 25 | */ 26 | public class I8Serializer extends TypeSerializerImpl { 27 | /** Tag name of an i8 value. 28 | */ 29 | public static final String I8_TAG = "i8"; 30 | 31 | /** Fully qualified name of an i8 value. 32 | */ 33 | public static final String EX_I8_TAG = "ex:i8"; 34 | 35 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 36 | write(pHandler, I8_TAG, EX_I8_TAG, pObject.toString()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/BooleanParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.xml.sax.SAXException; 22 | import org.xml.sax.SAXParseException; 23 | 24 | 25 | /** Parser for boolean values. 26 | */ 27 | public class BooleanParser extends AtomicParser { 28 | protected void setResult(String pResult) throws SAXException { 29 | String s = pResult.trim(); 30 | if ("1".equals(s)) { 31 | super.setResult(Boolean.TRUE); 32 | } else if ("0".equals(s)) { 33 | super.setResult(Boolean.FALSE); 34 | } else { 35 | throw new SAXParseException("Failed to parse boolean value: " + pResult, 36 | getDocumentLocator()); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/response/StatusCode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.response; 18 | 19 | public enum StatusCode { 20 | ERROR(-1), FAILURE(0), SUCCESS(1); 21 | 22 | private final int intValue; 23 | 24 | private StatusCode(int value) { 25 | this.intValue = value; 26 | } 27 | 28 | public int toInt() { 29 | return intValue; 30 | } 31 | 32 | public static StatusCode fromInt(int intValue) { 33 | switch (intValue) { 34 | case -1: 35 | return ERROR; 36 | case 1: 37 | return SUCCESS; 38 | case 0: 39 | default: 40 | return FAILURE; 41 | } 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | switch (this) { 47 | case ERROR: 48 | return "Error"; 49 | case SUCCESS: 50 | return "Success"; 51 | case FAILURE: 52 | default: 53 | return "Failure"; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/src/main/java/org/apache/xmlrpc/server/XmlRpcHttpServerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.server; 20 | 21 | import org.apache.xmlrpc.common.XmlRpcHttpConfig; 22 | 23 | /** HTTP servers configuration. 24 | */ 25 | public interface XmlRpcHttpServerConfig extends XmlRpcServerConfig, XmlRpcHttpConfig { 26 | /** Returns, whether HTTP keepalive is being enabled. 27 | * @return True, if keepalive is enabled, false otherwise. 28 | */ 29 | boolean isKeepAliveEnabled(); 30 | 31 | /** Returns, whether the server may create a "faultCause" element in an error 32 | * response. Note, that this may be a security issue! 33 | */ 34 | boolean isEnabledForExceptions(); 35 | } 36 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/ClientHandshake.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport; 18 | 19 | /** 20 | * Encapsulates client-side transport handshake logic. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public interface ClientHandshake { 25 | 26 | /** 27 | * @param incommingConnectionHeader 28 | * the {@link ConnectionHeader} sent by the server 29 | * @return {@code true} if the handshake is successful, {@code false} 30 | * otherwise 31 | */ 32 | boolean handshake(ConnectionHeader incommingConnectionHeader); 33 | 34 | /** 35 | * @return the outgoing {@link ConnectionHeader} 36 | */ 37 | ConnectionHeader getOutgoingConnectionHeader(); 38 | 39 | /** 40 | * @return the error {@link String} returned by the server if an error occurs, 41 | * {@code null} otherwise 42 | */ 43 | String getErrorMessage(); 44 | } 45 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcClientConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | import org.apache.xmlrpc.XmlRpcRequestConfig; 22 | 23 | 24 | /** This interface is being implemented by an Apache XML-RPC clients 25 | * configuration object. Depending on the transport factory, a 26 | * configuration object must implement additional methods. For 27 | * example, an HTTP transport requires an instance of 28 | * {@link org.apache.xmlrpc.client.XmlRpcHttpClientConfig}. A 29 | * local transport requires an instance of 30 | * {@link org.apache.xmlrpc.client.XmlRpcLocalClientConfig}. 31 | */ 32 | public interface XmlRpcClientConfig extends XmlRpcRequestConfig { 33 | } 34 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/parser/TypeParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.parser; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | import org.xml.sax.ContentHandler; 23 | 24 | 25 | /** Interface of a SAX handler parsing a single parameter or 26 | * result object. 27 | */ 28 | public interface TypeParser extends ContentHandler { 29 | /** Returns the parsed object. 30 | * @return The parameter or result object. 31 | * @throws XmlRpcException Creating the result object failed. 32 | * @throws IllegalStateException The method was invoked before 33 | * {@link org.xml.sax.ContentHandler#endDocument}. 34 | */ 35 | public Object getResult() throws XmlRpcException; 36 | } 37 | -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcTransportImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | 22 | /** Abstract base implementation of an {@link org.apache.xmlrpc.client.XmlRpcTransport}. 23 | */ 24 | public abstract class XmlRpcTransportImpl implements XmlRpcTransport { 25 | private final XmlRpcClient client; 26 | 27 | /** Creates a new instance. 28 | * @param pClient The client, which creates the transport. 29 | */ 30 | protected XmlRpcTransportImpl(XmlRpcClient pClient) { 31 | client = pClient; 32 | } 33 | 34 | /** Returns the client, which created this transport. 35 | * @return The client. 36 | */ 37 | public XmlRpcClient getClient() { return client; } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_server/src/main/java/org/apache/xmlrpc/server/XmlRpcLocalStreamServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.server; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | import org.apache.xmlrpc.XmlRpcRequest; 23 | import org.apache.xmlrpc.common.XmlRpcRequestProcessor; 24 | import org.apache.xmlrpc.common.XmlRpcRequestProcessorFactory; 25 | 26 | 27 | /** Server part of a local stream transport. 28 | */ 29 | public class XmlRpcLocalStreamServer extends XmlRpcStreamServer { 30 | public Object execute(XmlRpcRequest pRequest) throws XmlRpcException { 31 | XmlRpcRequestProcessor server = ((XmlRpcRequestProcessorFactory) pRequest.getConfig()).getXmlRpcServer(); 32 | return server.execute(pRequest); 33 | } 34 | } -------------------------------------------------------------------------------- /apache_xmlrpc_client/src/main/java/org/apache/xmlrpc/client/XmlRpcTransportFactoryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.client; 20 | 21 | 22 | /** Abstract base implementation of an {@link XmlRpcTransportFactory}. 23 | */ 24 | public abstract class XmlRpcTransportFactoryImpl implements XmlRpcTransportFactory { 25 | private final XmlRpcClient client; 26 | 27 | /** Creates a new instance. 28 | * @param pClient The client, which will invoke the factory. 29 | */ 30 | protected XmlRpcTransportFactoryImpl(XmlRpcClient pClient) { 31 | client = pClient; 32 | } 33 | 34 | /** Returns the client operating this factory. 35 | * @return The client. 36 | */ 37 | public XmlRpcClient getClient() { return client; } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/serializer/FloatSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.serializer; 20 | 21 | import org.xml.sax.ContentHandler; 22 | import org.xml.sax.SAXException; 23 | 24 | /** A {@link TypeSerializer} for floats. 25 | */ 26 | public class FloatSerializer extends TypeSerializerImpl { 27 | /** Tag name of a float value. 28 | */ 29 | public static final String FLOAT_TAG = "float"; 30 | 31 | /** Fully qualified name of a float value. 32 | */ 33 | public static final String EX_FLOAT_TAG = "ex:float"; 34 | 35 | public void write(ContentHandler pHandler, Object pObject) throws SAXException { 36 | write(pHandler, FLOAT_TAG, EX_FLOAT_TAG, pObject.toString()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamRequestProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | 23 | 24 | /** An instance of {@link XmlRpcRequestProcessor}, 25 | * which is processing an XML stream. 26 | */ 27 | public interface XmlRpcStreamRequestProcessor extends XmlRpcRequestProcessor { 28 | /** Reads an XML-RPC request from the connection 29 | * object and processes the request, writing the 30 | * result to the same connection object. 31 | * @throws XmlRpcException Processing the request failed. 32 | */ 33 | void execute(XmlRpcStreamRequestConfig pConfig, ServerStreamConnection pConnection) throws XmlRpcException; 34 | } 35 | -------------------------------------------------------------------------------- /docs/src/main/sphinx/advanced.rst: -------------------------------------------------------------------------------- 1 | Advanced topics 2 | =============== 3 | 4 | Listeners 5 | --------- 6 | 7 | Because rosjava provides a primarily asynchronous API, many classes which allow 8 | you to provide event listeners. For example, 9 | :javadoc:`org.ros.node.topic.PublisherListener`\s allow you to react to 10 | lifecycle events of a :javadoc:`org.ros.node.topic.Publisher`. The snippet 11 | below adds a :javadoc:`org.ros.node.topic.PublisherListener` that will log a 12 | warning message if the :javadoc:`org.ros.node.topic.Publisher` fails to 13 | register with the master. :: 14 | 15 | Node node; 16 | Publisher publisher; 17 | 18 | ... 19 | 20 | publisher.addListener(new DefaultPublisherListener() { 21 | @Override 22 | public void onMasterRegistrationFailure(Publisher registrant) { 23 | node.getLog().warn("Publisher failed to register: " + registrant); 24 | } 25 | }); 26 | 27 | Messages as BLOBs 28 | ----------------- 29 | 30 | If you need to deserialize a ROS message BLOB, it is important to remember that 31 | Java is a big endian virtual machine. When supplying the ``ByteBuffer`` to the 32 | :javadoc:`org.ros.message.MessageDeserializer`, make sure that order is set to 33 | little endian. :: 34 | 35 | Node node; 36 | byte[] messageData; 37 | 38 | ... 39 | 40 | ByteBuffer buffer = ByteBuffer.wrap(messageData); 41 | buffer.order(ByteOrder.LITTLE_ENDIAN); 42 | PointCloud2 msg = node.getMessageSerializationFactory() 43 | .newMessageDeserializer(sensor_msgs.PointCloud._TYPE) 44 | .deserialize(buffer); 45 | 46 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/node/service/ServiceServerResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.node.service; 18 | 19 | import org.jboss.netty.buffer.ChannelBuffer; 20 | 21 | /** 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | class ServiceServerResponse { 25 | 26 | private ChannelBuffer message; 27 | private int errorCode; 28 | private int messageLength; 29 | 30 | public void setErrorCode(int errorCode) { 31 | this.errorCode = errorCode; 32 | } 33 | 34 | public int getErrorCode() { 35 | return errorCode; 36 | } 37 | 38 | public void setMessage(ChannelBuffer buffer) { 39 | message = buffer; 40 | } 41 | 42 | public ChannelBuffer getMessage() { 43 | return message; 44 | } 45 | 46 | public void setMessageLength(int messageLength) { 47 | this.messageLength = messageLength; 48 | } 49 | 50 | public int getMessageLength() { 51 | return messageLength; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /rosjava/src/main/java/org/ros/internal/transport/ConnectionHeaderFields.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 Google Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 | * use this file except in compliance with the License. You may obtain a copy of 6 | * the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 | * License for the specific language governing permissions and limitations under 14 | * the License. 15 | */ 16 | 17 | package org.ros.internal.transport; 18 | 19 | /** 20 | * Fields found inside the header for node to node communication. 21 | * 22 | * @author damonkohler@google.com (Damon Kohler) 23 | */ 24 | public interface ConnectionHeaderFields { 25 | 26 | public static final String CALLER_ID = "callerid"; 27 | public static final String TOPIC = "topic"; 28 | public static final String MD5_CHECKSUM = "md5sum"; 29 | public static final String TYPE = "type"; 30 | public static final String SERVICE = "service"; 31 | public static final String TCP_NODELAY = "tcp_nodelay"; 32 | public static final String LATCHING = "latching"; 33 | public static final String PERSISTENT = "persistent"; 34 | public static final String MESSAGE_DEFINITION = "message_definition"; 35 | public static final String ERROR = "error"; 36 | public static final String PROBE = "probe"; 37 | } 38 | -------------------------------------------------------------------------------- /apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/common/XmlRpcRequestProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.xmlrpc.common; 20 | 21 | import org.apache.xmlrpc.XmlRpcException; 22 | import org.apache.xmlrpc.XmlRpcRequest; 23 | 24 | 25 | /** Interface of an object, which is able to process 26 | * XML-RPC requests. 27 | */ 28 | public interface XmlRpcRequestProcessor { 29 | /** Processes the given request and returns a 30 | * result object. 31 | * @throws XmlRpcException Processing the request failed. 32 | */ 33 | Object execute(XmlRpcRequest pRequest) throws XmlRpcException; 34 | 35 | /** Returns the request processors {@link TypeConverterFactory}. 36 | */ 37 | TypeConverterFactory getTypeConverterFactory(); 38 | } 39 | --------------------------------------------------------------------------------