Giter Club home page Giter Club logo

javagalileo's Introduction

javagalileo Build Status

Galileo navigation system Java SDK

编译

如果你只是想使用Java SDK可以不用自己编译代码。在本项目的Release页面中包含了已经编译好的jar文件。请根据您的系统进行选择,按照下面的使用说明进行使用。

Windows

安装 JDK 并保证设置好JAVA_HOME环境变量

安装 maven 并保证maven已经添加到PATH环境变量中

下载源代码

git clone https://github.com/BluewhaleRobot/javagalileo
cd javagalileo
git submodule update --init --recursive
powershell -ExecutionPolicy Unrestricted ./scripts/package.ps1

Linux

安装JDK 并保证设置好JAVA_HOME环境变量

安装maven

安装GalileoSDK, 安装方法参考这里

下载源码

git clone https://github.com/BluewhaleRobot/javagalileo
cd javagalileo
git submodule update --init --recursive
./scripts/package.sh

程序编译完成后会在 javagalileo/target 文件夹内生成 javagalileo.jar 文件。

使用

使用方法和一般的java jar文件一样。通过IDE添加到自己的项目依赖中即可。注意Linux版本需要保证本地已经安装了GalileoSDK

例子

下面是一个获取当前局域网内机器人的简单程序例子。程序会打印出当前局域网内所有机器人的ID

import javagalileo.GalileoSDK;
import javagalileo.models.ServerInfo;

public class Main {

    public static void main(String[] args) {
        GalileoSDK sdk = new GalileoSDK();
        int timecount = 0;
        while (timecount < 10 * 1000){
            ServerInfo[] servers = sdk.GetServersOnline();
            if(servers.length == 0){
                System.out.println("No server found");
            }
            for(ServerInfo server:servers){
               System.out.println("ID: " + server.getID());
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            timecount += 1000;
        }
    }
}

javagalileo's People

Contributors

weijiz avatar randoms avatar dependabot[bot] 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.