ev3dev-lang-java / ev3dev-lang-java

A project to learn Java and create software for Mindstorms Robots using hardware supported by EV3Dev & the LeJOS way.
http://ev3dev-lang-java.github.io/
MIT License
96 stars 42 forks source link

[ROS] Develop a node to publish the topic "scan" using a sensor_msgs/LaserScan #344

Closed jabrena closed 7 years ago

jabrena commented 7 years ago

Develop a ROSJava node to publish the topic "scan" based on sensor_msgs/LaserScan.

The node has to be compatible with multiple products like RPLidar A1, RPLidar A2 & Scanse Sweep.

Examples: https://github.com/heuristicus/int-robot/blob/master/trunk/src/main/java/ex1/Avoider3Random.java https://github.com/heuristicus/int-robot/blob/master/trunk/src/main/java/util/LaserUtil.java https://github.com/ev3dev-lang-java/rplidar_ros/blob/master/src/node.cpp https://github.com/srmanikandasriram/ev3-ros/blob/master/src/ultrasonic_laserscanner.cpp

Usage:

    public static void main(final String [] args) throws UnknownHostException {

        //Connect with Roscore
        connectWithRoscore(args);

        final NodeMainExecutor nodeExecutor = DefaultNodeMainExecutor.newDefault();

        System.out.println("Starting ROS nodes");
        final String nodeName = "BrickNode";
        final NodeConfiguration nodeConfig = getNodeConfig(nodeName);

        final NodeMain laserPublisherNode = new LaserScanNode("/dev/ttyUSB0");
        nodeExecutor.execute(laserPublisherNode, nodeConfig);

        Button.waitForAnyEvent();
    }
jabrena commented 7 years ago

http://wiki.ros.org/rplidar

jabrena commented 7 years ago

https://github.com/robopeak/rplidar_ros/wiki

jabrena commented 7 years ago

ROSJava consume so much resources in compare with ROSBridge and I couldn´t run it on EV3.