Giter Site home page Giter Site logo

jrosbridge's Introduction

jrosbridge Build Status

A Native Java EE rosbridge Client

Example Usage

To include this library, use the following in your Maven configuration:

<dependency>
    <groupId>edu.wpi.rail</groupId>
    <artifactId>jrosbridge</artifactId>
    <version>0.2.0</version>
</dependency>
public static void main(String[] args) throws InterruptedException {
	Ros ros = new Ros("localhost");
	ros.connect();

	Topic echo = new Topic(ros, "/echo", "std_msgs/String");
	Message toSend = new Message("{\"data\": \"hello, world!\"}");
	echo.publish(toSend);

	Topic echoBack = new Topic(ros, "/echo_back", "std_msgs/String");
	echoBack.subscribe(new TopicCallback() {
		@Override
		public void handleMessage(Message message) {
			System.out.println("From ROS: " + message.toString());
		}
	});

	Service addTwoInts = new Service(ros, "/add_two_ints", "rospy_tutorials/AddTwoInts");

	ServiceRequest request = new ServiceRequest("{\"a\": 10, \"b\": 20}");
	ServiceResponse response = addTwoInts.callServiceAndWait(request);
	System.out.println(response.toString());
	
	ros.disconnect();
}

License

jrosbridge is released with a BSD license. For full terms and conditions, see the LICENSE file.

Authors

See the AUTHORS file for a full list of contributors.

jrosbridge's People

Contributors

rctoris avatar dekent avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.