Compare commits
13 Commits
6a708f9eb5
...
c0b243ba73
Author | SHA1 | Date |
---|---|---|
Fanyiwen | c0b243ba73 | 2 years ago |
Fanyiwen | f6cb0a130f | 2 years ago |
fanyiwen | 76e33a15d4 | 3 years ago |
pyxu2pz5g | 1348a3b6b6 | 3 years ago |
Xie Changrong | 69e9e55aac | 3 years ago |
Xie Changrong | d1f1936b09 | 3 years ago |
Xie Changrong | 7889a9e970 | 3 years ago |
meickrq7f | 0346955015 | 3 years ago |
Xie Changrong | fe9633f168 | 3 years ago |
Xie Changrong | 515900cd21 | 3 years ago |
meickrq7f | 907367270c | 3 years ago |
Li Tianhong | a8f0156c52 | 3 years ago |
meickrq7f | 78e75ccd7b | 3 years ago |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 23 KiB |
@ -0,0 +1,35 @@
|
||||
package com.example.logistics.tools;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import org.java_websocket.client.WebSocketClient;
|
||||
import org.java_websocket.drafts.Draft_6455;
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
public class JWebSocketClient extends WebSocketClient {
|
||||
public JWebSocketClient(URI serverUri) {
|
||||
super(serverUri, new Draft_6455());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen(ServerHandshake handshakedata) {
|
||||
Log.e("JWebSocketClient", "onOpen()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
Log.e("JWebSocketClient", "onMessage()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(int code, String reason, boolean remote) {
|
||||
Log.e("JWebSocketClient", "onClose()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
Log.e("JWebSocketClient", "onError()");
|
||||
}
|
||||
}
|
@ -0,0 +1,200 @@
|
||||
package com.example.logistics.ui;
|
||||
|
||||
import com.example.logistics.R;
|
||||
import com.example.logistics.manager.goodManager;
|
||||
import com.example.logistics.manager.operationManager;
|
||||
import com.example.logistics.manager.userManager;
|
||||
import com.example.logistics.entity.User;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
|
||||
public class LoginActivity extends Activity {
|
||||
|
||||
private int islogin = 0;
|
||||
private Button loginButton;
|
||||
private Button signUpButton;
|
||||
private Button forgetButton;
|
||||
private Button phonenumButton;
|
||||
private AlertDialog alert;
|
||||
private Button changeButton;
|
||||
private EditText fphonenum;
|
||||
private EditText fpassword;
|
||||
int flag = 0; //flag = 0 是用户名登录;=1是手机号
|
||||
|
||||
// 调用Actvity
|
||||
private String TAG = "LoginActivity";
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
loginButton = (Button) this.findViewById(R.id.LoginButton);
|
||||
signUpButton = (Button) this.findViewById(R.id.SignUpButton);
|
||||
forgetButton = (Button) this.findViewById(R.id.forget);
|
||||
phonenumButton = (Button) this.findViewById(R.id.phonenum);
|
||||
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(LoginActivity.this);
|
||||
|
||||
View view2 = View.inflate(LoginActivity.this, R.layout.forget, null);
|
||||
|
||||
builder.setTitle("取件").setView(view2);
|
||||
|
||||
alert = builder.create();
|
||||
|
||||
changeButton = (Button) view2.findViewById(R.id.change);
|
||||
fphonenum = (EditText) view2.findViewById(R.id.fphonenum);
|
||||
fpassword = (EditText) view2.findViewById(R.id.fpassword);
|
||||
|
||||
loginButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
login(v);
|
||||
Log.d(TAG, "login");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
signUpButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(LoginActivity.this, SignUpActivity.class);
|
||||
Log.d(TAG, "signup");
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
forgetButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
alert.show();
|
||||
changeButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Log.d(TAG, "change password");
|
||||
change(view);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
EditText userName = (EditText) this.findViewById(R.id.UserNameEdit);
|
||||
phonenumButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
userName.setHint("请输入手机号");
|
||||
flag = 1;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public void change(View view){
|
||||
String phoneunm = fphonenum.getText().toString().trim();
|
||||
String password = fpassword.getText().toString().trim();
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
userManager userManager = new userManager();
|
||||
|
||||
int msg = userManager.change(phoneunm, password);
|
||||
|
||||
Log.d(TAG, "change");
|
||||
if(msg != 1){
|
||||
Log.d(TAG, "pickup,failed");
|
||||
hand2.sendEmptyMessage(msg);
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "change,success");
|
||||
|
||||
hand2.sendEmptyMessage(msg);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
public void login(View view){
|
||||
EditText userName = (EditText) this.findViewById(R.id.UserNameEdit);
|
||||
EditText passWord = (EditText) this.findViewById(R.id.PassWordEdit);
|
||||
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run(){
|
||||
userManager userManager = new userManager();
|
||||
int msg = 0;
|
||||
if(flag == 0){
|
||||
msg = userManager.login(userName.getText().toString().trim(), passWord.getText().toString().trim());
|
||||
}else if(flag == 1){
|
||||
msg = userManager.loginByPhone(userName.getText().toString().trim(), passWord.getText().toString().trim());
|
||||
|
||||
}
|
||||
Log.e("MAin", "msg");
|
||||
hand1.sendEmptyMessage(msg);
|
||||
if(msg == 1){
|
||||
User owner = userManager.findUser(userName.getText().toString().trim());
|
||||
Intent intent = new Intent(LoginActivity.this, MenuActivity.class);
|
||||
if(flag == 1){
|
||||
intent.putExtra("user", userName.getText().toString().trim());
|
||||
}else{
|
||||
intent.putExtra("user", owner.getPhoneNum());
|
||||
}
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand1 = new Handler(){
|
||||
@Override
|
||||
public void handleMessage(Message msg){
|
||||
if(msg.what == 0){
|
||||
Toast.makeText(getApplicationContext(), "登录失败", Toast.LENGTH_SHORT).show();
|
||||
}else if(msg.what == 1){
|
||||
Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
|
||||
islogin = 1;
|
||||
}else if(msg.what == 2){
|
||||
Toast.makeText(getApplicationContext(), "密码错误", Toast.LENGTH_SHORT).show();
|
||||
}else if(msg.what == 3){
|
||||
Toast.makeText(getApplicationContext(), "账号不存在", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand2 = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
if(msg.what == 0){
|
||||
Toast.makeText(LoginActivity.this, "修改失败", Toast.LENGTH_SHORT).show();
|
||||
}else if(msg.what == 1) {
|
||||
Toast.makeText(LoginActivity.this, "修改成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
package com.example.logistics.ui;
|
||||
|
||||
import com.example.logistics.R;
|
||||
import com.example.logistics.dao.userDao;
|
||||
import com.example.logistics.entity.User;
|
||||
import com.example.logistics.tools.MD5Utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
|
||||
private int islogin = 0;
|
||||
// 调用Actvity
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
Button loginButton = (Button) this.findViewById(R.id.LoginButton);
|
||||
Button signUpButton = (Button) this.findViewById(R.id.SignUpButton);
|
||||
|
||||
loginButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
login(v);
|
||||
}
|
||||
}
|
||||
);
|
||||
signUpButton.setOnClickListener(
|
||||
new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(MainActivity.this, SignUpActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public void login(View view){
|
||||
EditText userName = (EditText) this.findViewById(R.id.UserNameEdit);
|
||||
EditText passWord = (EditText) this.findViewById(R.id.PassWordEdit);
|
||||
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run(){
|
||||
userDao userDao = new userDao();
|
||||
int msg = userDao.login(userName.getText().toString().trim(), passWord.getText().toString().trim());
|
||||
Log.e("MAin", "msg");
|
||||
hand1.sendEmptyMessage(msg);
|
||||
if(msg == 1){
|
||||
User owner = userDao.findUser(userName.getText().toString().trim());
|
||||
Intent intent = new Intent(MainActivity.this, MenuActivity.class);
|
||||
intent.putExtra("user", owner.getPhoneNum());
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand1 = new Handler(){
|
||||
@Override
|
||||
public void handleMessage(Message msg){
|
||||
if(msg.what == 0){
|
||||
Toast.makeText(getApplicationContext(), "登录失败", Toast.LENGTH_SHORT).show();
|
||||
}else if(msg.what == 1){
|
||||
Toast.makeText(getApplicationContext(), "登录成功", Toast.LENGTH_SHORT).show();
|
||||
islogin = 1;
|
||||
}else if(msg.what == 2){
|
||||
Toast.makeText(getApplicationContext(), "密码错误", Toast.LENGTH_SHORT).show();
|
||||
}else if(msg.what == 3){
|
||||
Toast.makeText(getApplicationContext(), "账号不存在", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
@ -1,220 +0,0 @@
|
||||
package com.example.logistics.ui;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.example.logistics.R;
|
||||
import com.example.logistics.dao.goodDao;
|
||||
import com.example.logistics.dao.operationDao;
|
||||
import com.example.logistics.dao.userDao;
|
||||
import com.example.logistics.entity.User;
|
||||
import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
import com.journeyapps.barcodescanner.CaptureActivity;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class MyFragment2 extends Fragment implements View.OnClickListener{
|
||||
|
||||
private Button mButton;
|
||||
private Context mContext;
|
||||
|
||||
private WebView mWebView;
|
||||
|
||||
public MyFragment2(){
|
||||
|
||||
}
|
||||
@Nullable
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.my_fragment2,container,false);
|
||||
mWebView = (WebView) view.findViewById(R.id.webview);
|
||||
|
||||
WebSettings webSettings = mWebView.getSettings();
|
||||
mButton = (Button)view.findViewById(R.id.Pick_Button);
|
||||
mButton.setOnClickListener(this);
|
||||
mContext = getActivity();
|
||||
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
mWebView.loadUrl("file:///android_asset/js.html");
|
||||
|
||||
Log.i("set", "listner");
|
||||
|
||||
mWebView.setWebViewClient(new WebViewClient(){
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url){
|
||||
super.onPageFinished(view, url);
|
||||
String jsStr1 = "";
|
||||
try{
|
||||
InputStream in1 = mContext.getAssets().open("em.js");
|
||||
byte buff[] = new byte[1024];
|
||||
ByteArrayOutputStream fromFile = new ByteArrayOutputStream();
|
||||
do {
|
||||
int numRead = in1.read(buff);
|
||||
if (numRead <= 0) {
|
||||
break;
|
||||
}
|
||||
fromFile.write(buff, 0, numRead);
|
||||
} while (true);
|
||||
jsStr1 = fromFile.toString();
|
||||
in1.close();
|
||||
fromFile.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mWebView.loadUrl("javascript:" + jsStr1);
|
||||
|
||||
String jsStr2 = "";
|
||||
try{
|
||||
InputStream in2 = mContext.getAssets().open("roslib.min.js");
|
||||
byte buff[] = new byte[1024];
|
||||
ByteArrayOutputStream fromFile = new ByteArrayOutputStream();
|
||||
do {
|
||||
int numRead = in2.read(buff);
|
||||
if (numRead <= 0) {
|
||||
break;
|
||||
}
|
||||
fromFile.write(buff, 0, numRead);
|
||||
} while (true);
|
||||
jsStr2 = fromFile.toString();
|
||||
in2.close();
|
||||
fromFile.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mWebView.loadUrl("javascript:" + jsStr2);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch(view.getId()){
|
||||
case R.id.Pick_Button:
|
||||
/*new IntentIntegrator(getActivity())
|
||||
.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE)// 扫码的类型,一维码,二维码,一/二维码,默认为一/二维码
|
||||
.setPrompt("请对准摄像头")
|
||||
.setCameraId(0)
|
||||
.setBeepEnabled(false)
|
||||
.setCaptureActivity(CaptureActivity.class)
|
||||
.initiateScan();*/
|
||||
pickup("abnc");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void test(){
|
||||
mWebView.loadUrl("javascript:callJS()");
|
||||
Log.i("abc", "bcd");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressLint("MissingSuperCall")
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
|
||||
if(result != null) {
|
||||
if(result.getContents() != null) {
|
||||
//Toast.makeText(mContext, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
|
||||
pickup(result.getContents());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void pickup(String result){
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
|
||||
|
||||
View view2 = View.inflate(mContext, R.layout.pickup, null);
|
||||
|
||||
EditText PickUpCode = (EditText) view2.findViewById(R.id.pk_PickUp);
|
||||
EditText PhoneNum = (EditText) view2.findViewById(R.id.pk_PhoneNum);
|
||||
Button button = (Button) view2.findViewById(R.id.pk_button);
|
||||
|
||||
builder.setTitle("取件").setView(view2);
|
||||
|
||||
builder.create().show();
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String pickupcode = PickUpCode.getText().toString().trim();
|
||||
String phonenum = PhoneNum.getText().toString().trim();
|
||||
Log.d("onclick", "123");
|
||||
//String QR_pickup = result.split(" ")[0];
|
||||
//String QR_phone = result.split(" ")[1];
|
||||
|
||||
if(true){
|
||||
//if (pickupcode.equals(QR_pickup) && phonenum.equals(QR_phone)) {
|
||||
/*new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
int msg = 0;
|
||||
|
||||
operationDao operationDao = new operationDao();
|
||||
goodDao goodDao = new goodDao();
|
||||
Bundle bundle = getArguments();
|
||||
|
||||
String user = bundle.getString("user");
|
||||
|
||||
boolean flag1 = operationDao.add(pickupcode, user);
|
||||
boolean flag2 = goodDao.delete(pickupcode);
|
||||
|
||||
boolean flag = flag1 & flag2;
|
||||
if (flag) {
|
||||
msg = 1;
|
||||
}
|
||||
int msg = 1;
|
||||
test();
|
||||
hand1.sendEmptyMessage(msg);
|
||||
}
|
||||
}.start();*/
|
||||
Toast.makeText(mContext, "取件成功", Toast.LENGTH_LONG).show();
|
||||
test();
|
||||
|
||||
} else {
|
||||
Toast.makeText(mContext, "取件失败", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand1 = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
if (msg.what == 1) {
|
||||
Toast.makeText(mContext, "取件成功", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(mContext, "取件失败", Toast.LENGTH_SHORT);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
@ -0,0 +1,178 @@
|
||||
package com.jilk.ros.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by super_yu on 2018/1/8.
|
||||
*/
|
||||
|
||||
public class FootPrintResult {
|
||||
/**
|
||||
* header : {"seq":4297,"frame_id":"odom","stamp":{"secs":1515378187,"nsecs":125325857}}
|
||||
* polygon : {"points":[{"z":0,"x":0.31369608640670776,"y":-0.5355392694473267},{"z":0,"x":0.35115259885787964,"y":-0.016890067607164383},{"z":0,"x":-0.30713292956352234,"y":0.03065088950097561},{"z":0,"x":-0.3445894420146942,"y":-0.4879983365535736}]}
|
||||
*/
|
||||
|
||||
private HeaderBean header;
|
||||
private PolygonBean polygon;
|
||||
|
||||
public HeaderBean getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBean header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public PolygonBean getPolygon() {
|
||||
return polygon;
|
||||
}
|
||||
|
||||
public void setPolygon(PolygonBean polygon) {
|
||||
this.polygon = polygon;
|
||||
}
|
||||
|
||||
public static class HeaderBean {
|
||||
/**
|
||||
* seq : 4297
|
||||
* frame_id : odom
|
||||
* stamp : {"secs":1515378187,"nsecs":125325857}
|
||||
*/
|
||||
|
||||
private int seq;
|
||||
private String frame_id;
|
||||
private StampBean stamp;
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
|
||||
public void setFrame_id(String frame_id) {
|
||||
this.frame_id = frame_id;
|
||||
}
|
||||
|
||||
public StampBean getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBean stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public static class StampBean {
|
||||
/**
|
||||
* secs : 1515378187
|
||||
* nsecs : 125325857
|
||||
*/
|
||||
|
||||
private int secs;
|
||||
private int nsecs;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public void setSecs(int secs) {
|
||||
this.secs = secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
|
||||
public void setNsecs(int nsecs) {
|
||||
this.nsecs = nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PolygonBean {
|
||||
private List<PointsBean> points;
|
||||
|
||||
public List<PointsBean> getPoints() {
|
||||
return points;
|
||||
}
|
||||
|
||||
public void setPoints(List<PointsBean> points) {
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
public static class PointsBean {
|
||||
/**
|
||||
* z : 0
|
||||
* x : 0.31369608640670776
|
||||
* y : -0.5355392694473267
|
||||
*/
|
||||
|
||||
private int z;
|
||||
private double x;
|
||||
private double y;
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(int z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// {
|
||||
// "header": {
|
||||
// "seq": 4297,
|
||||
// "frame_id": "odom",
|
||||
// "stamp": {
|
||||
// "secs": 1515378187,
|
||||
// "nsecs": 125325857
|
||||
// }
|
||||
// },
|
||||
// "polygon": {
|
||||
// "points": [
|
||||
// {
|
||||
// "z": 0,
|
||||
// "x": 0.31369608640670776,
|
||||
// "y": -0.5355392694473267
|
||||
// },
|
||||
// {
|
||||
// "z": 0,
|
||||
// "x": 0.35115259885787964,
|
||||
// "y": -0.016890067607164383
|
||||
// },
|
||||
// {
|
||||
// "z": 0,
|
||||
// "x": -0.30713292956352234,
|
||||
// "y": 0.03065088950097561
|
||||
// },
|
||||
// {
|
||||
// "z": 0,
|
||||
// "x": -0.3445894420146942,
|
||||
// "y": -0.4879983365535736
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,274 @@
|
||||
package com.jilk.ros.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by super_yu on 2018/2/5.
|
||||
*/
|
||||
|
||||
public class InitPoseResult {
|
||||
|
||||
/**
|
||||
* op : publish
|
||||
* topic : /initialpose
|
||||
* msg : {"header":{"frame_id":"map"},"pose":{"pose":{"position":{"x":0,"y":0,"z":0},"orientation":{"x":0,"y":0,"z":0,"w":1}},"covariance":[0.25,0,0,0,0,0,0,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.06853891945200942]}}
|
||||
*/
|
||||
|
||||
private String op = "publish";
|
||||
private String topic = "/initialpose";
|
||||
private MsgBean msg;
|
||||
|
||||
|
||||
public MsgBean getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(MsgBean msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static class MsgBean {
|
||||
/**
|
||||
* header : {"frame_id":"map"}
|
||||
* pose : {"pose":{"position":{"x":0,"y":0,"z":0},"orientation":{"x":0,"y":0,"z":0,"w":1}},"covariance":[0.25,0,0,0,0,0,0,0.25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.06853891945200942]}
|
||||
*/
|
||||
|
||||
private HeaderBean header;
|
||||
private PoseBeanX pose;
|
||||
|
||||
public HeaderBean getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBean header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public PoseBeanX getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBeanX pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public static class HeaderBean {
|
||||
/**
|
||||
* frame_id : map
|
||||
*/
|
||||
|
||||
private String frame_id = "map";
|
||||
}
|
||||
|
||||
public static class PoseBeanX {
|
||||
/**
|
||||
* pose : {"position":{"x":0,"y":0,"z":0},"orientation":{"x":0,"y":0,"z":0,"w":1}}
|
||||
* covariance :
|
||||
* 0.25,0,0,0,0,0,0,0.25,
|
||||
* 0,0,0,0,0,0,0,0,0,0,0,
|
||||
* 0,0,0,0,0,0,0,0,0,0,0,
|
||||
* 0,0,0,0,0,0.06853891945200942
|
||||
*/
|
||||
|
||||
private PoseBean pose;
|
||||
private List<Double> covariance;
|
||||
|
||||
public PoseBean getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBean pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public void setCovariance() {
|
||||
covariance = new ArrayList<Double>();
|
||||
for (int i = 0; i < 36; i++) {
|
||||
if (i == 0) {
|
||||
covariance.add(0.25);
|
||||
} else if (i == 7) {
|
||||
covariance.add(0.25);
|
||||
} else if (i == 35) {
|
||||
covariance.add(0.06853891945200942);
|
||||
|
||||
} else {
|
||||
covariance.add((double) 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PoseBean {
|
||||
/**
|
||||
* position : {"x":0,"y":0,"z":0}
|
||||
* orientation : {"x":0,"y":0,"z":0,"w":1}
|
||||
*/
|
||||
|
||||
private PositionBean position;
|
||||
private OrientationBean orientation;
|
||||
|
||||
public PositionBean getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(PositionBean position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public OrientationBean getOrientation() {
|
||||
return orientation;
|
||||
}
|
||||
|
||||
public void setOrientation(OrientationBean orientation) {
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
public static class PositionBean {
|
||||
/**
|
||||
* x : 0
|
||||
* y : 0
|
||||
* z : 0
|
||||
*/
|
||||
|
||||
private double x;
|
||||
private double y;
|
||||
private double z;
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
|
||||
public static class OrientationBean {
|
||||
/**
|
||||
* x : 0
|
||||
* y : 0
|
||||
* z : 0
|
||||
* w : 1
|
||||
*/
|
||||
|
||||
private double x;
|
||||
private double y;
|
||||
private double z;
|
||||
private double w;
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public double getW() {
|
||||
return w;
|
||||
}
|
||||
|
||||
public void setW(double w) {
|
||||
this.w = w;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// {
|
||||
// "op": "publish",
|
||||
// "topic": "/initialpose",
|
||||
// "msg": {
|
||||
// "header": {
|
||||
// "frame_id": "map"
|
||||
// },
|
||||
// "pose": {
|
||||
// "pose": {
|
||||
// "position": {
|
||||
// "x": 0,
|
||||
// "y": 0,
|
||||
// "z": 0
|
||||
// },
|
||||
// "orientation": {
|
||||
// "x": 0,
|
||||
// "y": 0,
|
||||
// "z": 0,
|
||||
// "w": 1
|
||||
// }
|
||||
// },
|
||||
// "covariance": [
|
||||
// 0.25,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0.25,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0.06853891945200942
|
||||
// ]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,501 @@
|
||||
package com.jilk.ros.model;
|
||||
|
||||
/**
|
||||
* Created by super_yu on 2018/1/5.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*对位置移动有数据变化的是
|
||||
* orientation z、w
|
||||
* position x、y
|
||||
* twist x
|
||||
* angular z
|
||||
* Created by super_yu on 2017/9/29.
|
||||
*/
|
||||
|
||||
public class PoiResult {
|
||||
|
||||
/**
|
||||
* twist : {"twist":{"angular":{"z":0,"y":0,"x":0},"linear":{"z":0,"y":0,"x":0}},"covariance":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}
|
||||
* child_frame_id : base_footprint
|
||||
* pose : {"covariance":[0.1,0,0,0,0,0,0,0.1,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,0.2],"pose":{"position":{"z":0,"y":-0.16137039724419636,"x":0.001470031525333453},"orientation":{"w":-0.08271030624895466,"z":-0.9965736326234024,"y":"-0","x":0}}}
|
||||
* header : {"seq":69712,"stamp":{"secs":1506650141,"nsecs":455670567},"frame_id":"odom"}
|
||||
*/
|
||||
|
||||
private TwistBeanX twist;
|
||||
private String child_frame_id;
|
||||
private PoseBeanX pose;
|
||||
private HeaderBean header;
|
||||
|
||||
public TwistBeanX getTwist() {
|
||||
return twist;
|
||||
}
|
||||
|
||||
public void setTwist(TwistBeanX twist) {
|
||||
this.twist = twist;
|
||||
}
|
||||
|
||||
public String getChild_frame_id() {
|
||||
return child_frame_id;
|
||||
}
|
||||
|
||||
public void setChild_frame_id(String child_frame_id) {
|
||||
this.child_frame_id = child_frame_id;
|
||||
}
|
||||
|
||||
public PoseBeanX getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBeanX pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public HeaderBean getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBean header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public static class TwistBeanX {
|
||||
/**
|
||||
* twist : {"angular":{"z":0,"y":0,"x":0},"linear":{"z":0,"y":0,"x":0}}
|
||||
* covariance : [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
*/
|
||||
|
||||
private TwistBean twist;
|
||||
private List<Integer> covariance;
|
||||
|
||||
public TwistBean getTwist() {
|
||||
return twist;
|
||||
}
|
||||
|
||||
public void setTwist(TwistBean twist) {
|
||||
this.twist = twist;
|
||||
}
|
||||
|
||||
public List<Integer> getCovariance() {
|
||||
return covariance;
|
||||
}
|
||||
|
||||
public void setCovariance(List<Integer> covariance) {
|
||||
this.covariance = covariance;
|
||||
}
|
||||
|
||||
public static class TwistBean {
|
||||
/**
|
||||
* angular : {"z":0,"y":0,"x":0}
|
||||
* linear : {"z":0,"y":0,"x":0}
|
||||
*/
|
||||
|
||||
private AngularBean angular;
|
||||
private LinearBean linear;
|
||||
|
||||
public AngularBean getAngular() {
|
||||
return angular;
|
||||
}
|
||||
|
||||
public void setAngular(AngularBean angular) {
|
||||
this.angular = angular;
|
||||
}
|
||||
|
||||
public LinearBean getLinear() {
|
||||
return linear;
|
||||
}
|
||||
|
||||
public void setLinear(LinearBean linear) {
|
||||
this.linear = linear;
|
||||
}
|
||||
|
||||
public static class AngularBean {
|
||||
/**
|
||||
* z : 0
|
||||
* y : 0
|
||||
* x : 0
|
||||
*/
|
||||
|
||||
private int z;
|
||||
private int y;
|
||||
private int x;
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(int z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LinearBean {
|
||||
/**
|
||||
* z : 0
|
||||
* y : 0
|
||||
* x : 0
|
||||
*/
|
||||
|
||||
private int z;
|
||||
private int y;
|
||||
private int x;
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(int z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PoseBeanX {
|
||||
/**
|
||||
* covariance : [0.1,0,0,0,0,0,0,0.1,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,1.7976931348623157E308,0,0,0,0,0,0,0.2]
|
||||
* pose : {"position":{"z":0,"y":-0.16137039724419636,"x":0.001470031525333453},"orientation":{"w":-0.08271030624895466,"z":-0.9965736326234024,"y":"-0","x":0}}
|
||||
*/
|
||||
|
||||
private PoseBean pose;
|
||||
private List<Double> covariance;
|
||||
|
||||
public PoseBean getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBean pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public List<Double> getCovariance() {
|
||||
return covariance;
|
||||
}
|
||||
|
||||
public void setCovariance(List<Double> covariance) {
|
||||
this.covariance = covariance;
|
||||
}
|
||||
|
||||
public static class PoseBean {
|
||||
/**
|
||||
* position : {"z":0,"y":-0.16137039724419636,"x":0.001470031525333453}
|
||||
* orientation : {"w":-0.08271030624895466,"z":-0.9965736326234024,"y":"-0","x":0}
|
||||
*/
|
||||
|
||||
private PositionBean position;
|
||||
private OrientationBean orientation;
|
||||
|
||||
public PositionBean getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(PositionBean position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public OrientationBean getOrientation() {
|
||||
return orientation;
|
||||
}
|
||||
|
||||
public void setOrientation(OrientationBean orientation) {
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
public static class PositionBean {
|
||||
/**
|
||||
* z : 0
|
||||
* y : -0.16137039724419636
|
||||
* x : 0.001470031525333453
|
||||
*/
|
||||
|
||||
private int z;
|
||||
private double y;
|
||||
private double x;
|
||||
|
||||
public int getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(int z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
|
||||
public static class OrientationBean {
|
||||
/**
|
||||
* w : -0.08271030624895466
|
||||
* z : -0.9965736326234024
|
||||
* y : -0
|
||||
* x : 0
|
||||
*/
|
||||
|
||||
private double w;
|
||||
private double z;
|
||||
private String y;
|
||||
private int x;
|
||||
|
||||
public double getW() {
|
||||
return w;
|
||||
}
|
||||
|
||||
public void setW(double w) {
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public String getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(String y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class HeaderBean {
|
||||
/**
|
||||
* seq : 69712
|
||||
* stamp : {"secs":1506650141,"nsecs":455670567}
|
||||
* frame_id : odom
|
||||
*/
|
||||
|
||||
private int seq;
|
||||
private StampBean stamp;
|
||||
private String frame_id;
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public StampBean getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBean stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
|
||||
public void setFrame_id(String frame_id) {
|
||||
this.frame_id = frame_id;
|
||||
}
|
||||
|
||||
public static class StampBean {
|
||||
/**
|
||||
* secs : 1506650141
|
||||
* nsecs : 455670567
|
||||
*/
|
||||
|
||||
private int secs;
|
||||
private int nsecs;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public void setSecs(int secs) {
|
||||
this.secs = secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
|
||||
public void setNsecs(int nsecs) {
|
||||
this.nsecs = nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// {
|
||||
// "twist": {
|
||||
// "twist": {
|
||||
// "angular": {
|
||||
// "z": 0,
|
||||
// "y": 0,
|
||||
// "x": 0
|
||||
// },
|
||||
// "linear": {
|
||||
// "z": 0,
|
||||
// "y": 0,
|
||||
// "x": 0
|
||||
// }
|
||||
// },
|
||||
// "covariance": [
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0
|
||||
// ]
|
||||
// },
|
||||
// "child_frame_id": "base_footprint",
|
||||
// "pose": {
|
||||
// "covariance": [
|
||||
// 0.1,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0.1,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 1.7976931348623157E308,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 1.7976931348623157E308,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 1.7976931348623157E308,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0.2
|
||||
// ],
|
||||
// "pose": {
|
||||
// "position": {
|
||||
// "z": 0,
|
||||
// "y": -0.16137039724419636,
|
||||
// "x": 0.001470031525333453
|
||||
// },
|
||||
// "orientation": {
|
||||
// "w": -0.08271030624895466,
|
||||
// "z": -0.9965736326234024,
|
||||
// "y": -0,
|
||||
// "x": 0
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// "header": {
|
||||
// "seq": 69712,
|
||||
// "stamp": {
|
||||
// "secs": 1506650141,
|
||||
// "nsecs": 455670567
|
||||
// },
|
||||
// "frame_id": "odom"
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,246 @@
|
||||
package com.jilk.ros.nav;
|
||||
|
||||
/**
|
||||
* Created by super_yu on 27/10/2017.
|
||||
*/
|
||||
|
||||
public class Move_Base_Goal {
|
||||
/**
|
||||
* msg : {"target_pose":{"header":{"frame_id":"/map"},"pose":{"w":0.72508,"x":0.00455891,"y":0.0110448,"z":-0.688561}},"base_position":{"header":{"frame_id":"/map"},"pose":{"x":-5.56034,"y":0.543951,"z":2.96803E-4}}}
|
||||
* op : publish
|
||||
* topic : /move_base/goal
|
||||
*/
|
||||
|
||||
private MsgBean msg;
|
||||
private String op = "publish";
|
||||
private String topic = "/move_base/goal";
|
||||
|
||||
public MsgBean getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(MsgBean msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getOp() {
|
||||
return op;
|
||||
}
|
||||
|
||||
public String getTopic() {
|
||||
return topic;
|
||||
}
|
||||
|
||||
public static class MsgBean {
|
||||
/**
|
||||
* target_pose : {"header":{"frame_id":"/map"},"pose":{"w":0.72508,"x":0.00455891,"y":0.0110448,"z":-0.688561}}
|
||||
* base_position : {"header":{"frame_id":"/map"},"pose":{"x":-5.56034,"y":0.543951,"z":2.96803E-4}}
|
||||
*/
|
||||
|
||||
private TargetPoseBean target_pose;
|
||||
private BasePositionBean base_position;
|
||||
|
||||
public TargetPoseBean getTarget_pose() {
|
||||
return target_pose;
|
||||
}
|
||||
|
||||
public void setTarget_pose(TargetPoseBean target_pose) {
|
||||
this.target_pose = target_pose;
|
||||
}
|
||||
|
||||
public BasePositionBean getBase_position() {
|
||||
return base_position;
|
||||
}
|
||||
|
||||
public void setBase_position(BasePositionBean base_position) {
|
||||
this.base_position = base_position;
|
||||
}
|
||||
|
||||
public static class TargetPoseBean {
|
||||
/**
|
||||
* header : {"frame_id":"/map"}
|
||||
* pose : {"w":0.72508,"x":0.00455891,"y":0.0110448,"z":-0.688561}
|
||||
*/
|
||||
|
||||
private HeaderBean header;
|
||||
private PoseBean pose;
|
||||
|
||||
public HeaderBean getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBean header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public PoseBean getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBean pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public static class HeaderBean {
|
||||
/**
|
||||
* frame_id : /map
|
||||
*/
|
||||
|
||||
private String frame_id = "/map";
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PoseBean {
|
||||
/**
|
||||
* w : 0.72508
|
||||
* x : 0.00455891
|
||||
* y : 0.0110448
|
||||
* z : -0.688561
|
||||
*/
|
||||
|
||||
private double w;
|
||||
private double x;
|
||||
private double y;
|
||||
private double z;
|
||||
|
||||
public double getW() {
|
||||
return w;
|
||||
}
|
||||
|
||||
public void setW(double w) {
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class BasePositionBean {
|
||||
/**
|
||||
* header : {"frame_id":"/map"}
|
||||
* pose : {"x":-5.56034,"y":0.543951,"z":2.96803E-4}
|
||||
*/
|
||||
|
||||
private HeaderBeanX header;
|
||||
private PoseBeanX pose;
|
||||
|
||||
public HeaderBeanX getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBeanX header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public PoseBeanX getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBeanX pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public static class HeaderBeanX {
|
||||
/**
|
||||
* frame_id : /map
|
||||
*/
|
||||
|
||||
private String frame_id = "/map";
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PoseBeanX {
|
||||
/**
|
||||
* x : -5.56034
|
||||
* y : 0.543951
|
||||
* z : 2.96803E-4
|
||||
*/
|
||||
|
||||
private double x;
|
||||
private double y;
|
||||
private double z;
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// {
|
||||
// "op": "publish",
|
||||
// "topic": "/move_base/goal",
|
||||
// "msg": {
|
||||
// "target_pose": {
|
||||
// "header": {
|
||||
// "frame_id": "/map"
|
||||
// },
|
||||
// "pose": {
|
||||
// "z": -0.695688,
|
||||
// "x": 0.000728705,
|
||||
// "w": 0.71834,
|
||||
// "y": 0.00213251
|
||||
// }
|
||||
// },
|
||||
// "base_position": {
|
||||
// "header": {
|
||||
// "frame_id": "/map"
|
||||
// },
|
||||
// "pose": {
|
||||
// "z": 0.00984454,
|
||||
// "x": -0.0483838,
|
||||
// "y": -0.00480753
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,219 @@
|
||||
package com.jilk.ros.nav;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by super_yu on 30/10/2017.
|
||||
*/
|
||||
|
||||
public class Move_Base_Status {
|
||||
/**
|
||||
* status_list : [{"goal_id":{"id":"map_6_A_603","stamp":{"secs":1509348841,"nsecs":490135242}},"text":"Goal reached.","status":3},{"goal_id":{"id":"map_6_A_601","stamp":{"secs":1509348875,"nsecs":650002258}},"text":"This goal has been accepted by the simple action server","status":1}]
|
||||
* header : {"seq":13516,"frame_id":"","stamp":{"secs":1509348876,"nsecs":156902566}}
|
||||
*/
|
||||
|
||||
private HeaderBean header;
|
||||
private List<StatusListBean> status_list;
|
||||
|
||||
public HeaderBean getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBean header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public List<StatusListBean> getStatus_list() {
|
||||
return status_list;
|
||||
}
|
||||
|
||||
public void setStatus_list(List<StatusListBean> status_list) {
|
||||
this.status_list = status_list;
|
||||
}
|
||||
|
||||
public static class HeaderBean {
|
||||
/**
|
||||
* seq : 13516
|
||||
* frame_id :
|
||||
* stamp : {"secs":1509348876,"nsecs":156902566}
|
||||
*/
|
||||
|
||||
private int seq;
|
||||
private String frame_id;
|
||||
private StampBean stamp;
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
|
||||
public void setFrame_id(String frame_id) {
|
||||
this.frame_id = frame_id;
|
||||
}
|
||||
|
||||
public StampBean getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBean stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public static class StampBean {
|
||||
/**
|
||||
* secs : 1509348876
|
||||
* nsecs : 156902566
|
||||
*/
|
||||
|
||||
private int secs;
|
||||
private int nsecs;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public void setSecs(int secs) {
|
||||
this.secs = secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
|
||||
public void setNsecs(int nsecs) {
|
||||
this.nsecs = nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class StatusListBean {
|
||||
/**
|
||||
* goal_id : {"id":"map_6_A_603","stamp":{"secs":1509348841,"nsecs":490135242}}
|
||||
* text : Goal reached.
|
||||
* status : 3
|
||||
*/
|
||||
|
||||
private GoalIdBean goal_id;
|
||||
private String text;
|
||||
private int status;
|
||||
|
||||
public GoalIdBean getGoal_id() {
|
||||
return goal_id;
|
||||
}
|
||||
|
||||
public void setGoal_id(GoalIdBean goal_id) {
|
||||
this.goal_id = goal_id;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class GoalIdBean {
|
||||
/**
|
||||
* id : map_6_A_603
|
||||
* stamp : {"secs":1509348841,"nsecs":490135242}
|
||||
*/
|
||||
|
||||
private String id;
|
||||
private StampBeanX stamp;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public StampBeanX getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBeanX stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public static class StampBeanX {
|
||||
/**
|
||||
* secs : 1509348841
|
||||
* nsecs : 490135242
|
||||
*/
|
||||
|
||||
private int secs;
|
||||
private int nsecs;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public void setSecs(int secs) {
|
||||
this.secs = secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
|
||||
public void setNsecs(int nsecs) {
|
||||
this.nsecs = nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// {
|
||||
// "status_list": [
|
||||
// {
|
||||
// "goal_id": {
|
||||
// "id": "map_6_A_603",
|
||||
// "stamp": {
|
||||
// "secs": 1509348841,
|
||||
// "nsecs": 490135242
|
||||
// }
|
||||
// },
|
||||
// "text": "Goal reached.",
|
||||
// "status": 3
|
||||
// },
|
||||
// {
|
||||
// "goal_id": {
|
||||
// "id": "map_6_A_601",
|
||||
// "stamp": {
|
||||
// "secs": 1509348875,
|
||||
// "nsecs": 650002258
|
||||
// }
|
||||
// },
|
||||
// "text": "This goal has been accepted by the simple action server",
|
||||
// "status": 1
|
||||
// }
|
||||
// ],
|
||||
// "header": {
|
||||
// "seq": 13516,
|
||||
// "frame_id": "",
|
||||
// "stamp": {
|
||||
// "secs": 1509348876,
|
||||
// "nsecs": 156902566
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.jilk.ros.nav;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 存储导航对象
|
||||
* Created by super_yu on 27/10/2017.
|
||||
*/
|
||||
|
||||
public class NavPublich {
|
||||
|
||||
private List<String> wayPointsNames;
|
||||
|
||||
private HashMap<String, TMove_Base_Goal> navPublishHashMap;
|
||||
|
||||
public List<String> getWayPointsNames() {
|
||||
return wayPointsNames;
|
||||
}
|
||||
|
||||
public void setWayPointsNames(List<String> wayPointsNames) {
|
||||
this.wayPointsNames = wayPointsNames;
|
||||
}
|
||||
|
||||
public HashMap<String, TMove_Base_Goal> getNavPublishHashMap() {
|
||||
return navPublishHashMap;
|
||||
}
|
||||
|
||||
public void setNavPublishHashMap(HashMap<String, TMove_Base_Goal> navPublishHashMap) {
|
||||
this.navPublishHashMap = navPublishHashMap;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
if (wayPointsNames != null) wayPointsNames.clear();
|
||||
if (navPublishHashMap != null) navPublishHashMap.clear();
|
||||
}
|
||||
}
|
@ -0,0 +1,402 @@
|
||||
package com.jilk.ros.nav;
|
||||
|
||||
/**
|
||||
* Created by super_yu on 30/10/2017.
|
||||
*/
|
||||
|
||||
public class TMove_Base_Goal {
|
||||
/**
|
||||
* op : publish
|
||||
* topic : /move_base/goal
|
||||
* msg : {"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"goal_id":{"stamp":{"secs":0,"nsecs":0},"id":"map_6_A_601"},"goal":{"target_pose":{"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"pose":{"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}}}}
|
||||
*/
|
||||
private String op = "publish";
|
||||
private String topic = "/move_base/goal";
|
||||
private MsgBean msg;
|
||||
|
||||
public String getOp() {
|
||||
return op;
|
||||
}
|
||||
|
||||
public String getTopic() {
|
||||
return topic;
|
||||
}
|
||||
|
||||
public MsgBean getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(MsgBean msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static class MsgBean {
|
||||
/**
|
||||
* header : {"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"}
|
||||
* goal_id : {"stamp":{"secs":0,"nsecs":0},"id":"map_6_A_601"}
|
||||
* goal : {"target_pose":{"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"pose":{"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}}}
|
||||
*/
|
||||
|
||||
private HeaderBean header;
|
||||
private GoalIdBean goal_id;
|
||||
private GoalBean goal;
|
||||
|
||||
public HeaderBean getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBean header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public GoalIdBean getGoal_id() {
|
||||
return goal_id;
|
||||
}
|
||||
|
||||
public void setGoal_id(GoalIdBean goal_id) {
|
||||
this.goal_id = goal_id;
|
||||
}
|
||||
|
||||
public GoalBean getGoal() {
|
||||
return goal;
|
||||
}
|
||||
|
||||
public void setGoal(GoalBean goal) {
|
||||
this.goal = goal;
|
||||
}
|
||||
|
||||
public static class HeaderBean {
|
||||
/**
|
||||
* seq : 0
|
||||
* stamp : {"secs":0,"nsecs":0}
|
||||
* frame_id : map
|
||||
*/
|
||||
|
||||
private int seq = 0;
|
||||
private StampBean stamp;
|
||||
private String frame_id = "map";
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public StampBean getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBean stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
|
||||
public static class StampBean {
|
||||
/**
|
||||
* secs : 0
|
||||
* nsecs : 0
|
||||
*/
|
||||
|
||||
private int secs = 0;
|
||||
private int nsecs = 0;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class GoalIdBean {
|
||||
/**
|
||||
* stamp : {"secs":0,"nsecs":0}
|
||||
* id : map_6_A_601
|
||||
*/
|
||||
|
||||
private StampBeanX stamp;
|
||||
|
||||
private String id;
|
||||
|
||||
public StampBeanX getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBeanX stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static class StampBeanX {
|
||||
/**
|
||||
* secs : 0
|
||||
* nsecs : 0
|
||||
*/
|
||||
|
||||
private int secs = 0;
|
||||
private int nsecs = 0;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class GoalBean {
|
||||
/**
|
||||
* target_pose : {"header":{"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"},"pose":{"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}}
|
||||
*/
|
||||
|
||||
private TargetPoseBean target_pose;
|
||||
|
||||
public TargetPoseBean getTarget_pose() {
|
||||
return target_pose;
|
||||
}
|
||||
|
||||
public void setTarget_pose(TargetPoseBean target_pose) {
|
||||
this.target_pose = target_pose;
|
||||
}
|
||||
|
||||
public static class TargetPoseBean {
|
||||
/**
|
||||
* header : {"seq":0,"stamp":{"secs":0,"nsecs":0},"frame_id":"map"}
|
||||
* pose : {"position":{"z":2.96803E-4,"x":-5.56034,"y":0.543951},"orientation":{"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}}
|
||||
*/
|
||||
|
||||
private HeaderBeanX header;
|
||||
private PoseBean pose;
|
||||
|
||||
public HeaderBeanX getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(HeaderBeanX header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public PoseBean getPose() {
|
||||
return pose;
|
||||
}
|
||||
|
||||
public void setPose(PoseBean pose) {
|
||||
this.pose = pose;
|
||||
}
|
||||
|
||||
public static class HeaderBeanX {
|
||||
/**
|
||||
* seq : 0
|
||||
* stamp : {"secs":0,"nsecs":0}
|
||||
* frame_id : map
|
||||
*/
|
||||
|
||||
private int seq = 0;
|
||||
private StampBeanXX stamp;
|
||||
private String frame_id = "map";
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public StampBeanXX getStamp() {
|
||||
return stamp;
|
||||
}
|
||||
|
||||
public void setStamp(StampBeanXX stamp) {
|
||||
this.stamp = stamp;
|
||||
}
|
||||
|
||||
public String getFrame_id() {
|
||||
return frame_id;
|
||||
}
|
||||
|
||||
public static class StampBeanXX {
|
||||
/**
|
||||
* secs : 0
|
||||
* nsecs : 0
|
||||
*/
|
||||
|
||||
private int secs = 0;
|
||||
private int nsecs = 0;
|
||||
|
||||
public int getSecs() {
|
||||
return secs;
|
||||
}
|
||||
|
||||
public int getNsecs() {
|
||||
return nsecs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class PoseBean {
|
||||
/**
|
||||
* position : {"z":2.96803E-4,"x":-5.56034,"y":0.543951}
|
||||
* orientation : {"z":-0.688561,"x":0.00455891,"w":0.72508,"y":0.0110448}
|
||||
*/
|
||||
|
||||
private PositionBean position;
|
||||
private OrientationBean orientation;
|
||||
|
||||
public PositionBean getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setPosition(PositionBean position) {
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public OrientationBean getOrientation() {
|
||||
return orientation;
|
||||
}
|
||||
|
||||
public void setOrientation(OrientationBean orientation) {
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
public static class PositionBean {
|
||||
/**
|
||||
* z : 2.96803E-4
|
||||
* x : -5.56034
|
||||
* y : 0.543951
|
||||
*/
|
||||
|
||||
private double z;
|
||||
private double x;
|
||||
private double y;
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
|
||||
public static class OrientationBean {
|
||||
/**
|
||||
* z : -0.688561
|
||||
* x : 0.00455891
|
||||
* w : 0.72508
|
||||
* y : 0.0110448
|
||||
*/
|
||||
|
||||
private double z;
|
||||
private double x;
|
||||
private double w;
|
||||
private double y;
|
||||
|
||||
public double getZ() {
|
||||
return z;
|
||||
}
|
||||
|
||||
public void setZ(double z) {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getW() {
|
||||
return w;
|
||||
}
|
||||
|
||||
public void setW(double w) {
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// {
|
||||
// "op": "publish",
|
||||
// "topic": "/move_base/goal",
|
||||
// "msg": {
|
||||
// "header": {
|
||||
// "seq": 0,
|
||||
// "stamp": {
|
||||
// "secs": 0,
|
||||
// "nsecs": 0
|
||||
// },
|
||||
// "frame_id": "map"
|
||||
// },
|
||||
// "goal_id": {
|
||||
// "stamp": {
|
||||
// "secs": 0,
|
||||
// "nsecs": 0
|
||||
// },
|
||||
// "id": "map_6_A_601"
|
||||
// },
|
||||
// "goal": {
|
||||
// "target_pose": {
|
||||
// "header": {
|
||||
// "seq": 0,
|
||||
// "stamp": {
|
||||
// "secs": 0,
|
||||
// "nsecs": 0
|
||||
// },
|
||||
// "frame_id": "map"
|
||||
// },
|
||||
// "pose": {
|
||||
// "position": {
|
||||
// "z": 0.000296803,
|
||||
// "x": -5.56034,
|
||||
// "y": 0.543951
|
||||
// },
|
||||
// "orientation": {
|
||||
// "z": -0.688561,
|
||||
// "x": 0.00455891,
|
||||
// "w": 0.72508,
|
||||
// "y": 0.0110448
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.jilk.ros.net;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.ConnectivityManager;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/5/22 0022.
|
||||
*/
|
||||
|
||||
public class NetBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// TODO Auto-generated method stub
|
||||
// 如果相等的话就说明网络状态发生了变化
|
||||
if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
|
||||
int netWorkState = NetUtil.getNetWorkState(context);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.jilk.ros.net;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/5/22 0022.
|
||||
*/
|
||||
|
||||
public class NetUtil {
|
||||
|
||||
/**
|
||||
* 没有连接网络
|
||||
*/
|
||||
private static final int NETWORK_NONE = -1;
|
||||
/**
|
||||
* 移动网络
|
||||
*/
|
||||
private static final int NETWORK_MOBILE = 0;
|
||||
/**
|
||||
* 无线网络
|
||||
*/
|
||||
private static final int NETWORK_WIFI = 1;
|
||||
|
||||
public static int getNetWorkState(Context context) {
|
||||
// 得到连接管理器对象
|
||||
ConnectivityManager connectivityManager = (ConnectivityManager) context
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
|
||||
NetworkInfo activeNetworkInfo = connectivityManager
|
||||
.getActiveNetworkInfo();
|
||||
if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) {
|
||||
|
||||
if (activeNetworkInfo.getType() == (ConnectivityManager.TYPE_WIFI)) {
|
||||
return NETWORK_WIFI;
|
||||
} else if (activeNetworkInfo.getType() == (ConnectivityManager.TYPE_MOBILE)) {
|
||||
return NETWORK_MOBILE;
|
||||
}
|
||||
} else {
|
||||
return NETWORK_NONE;
|
||||
}
|
||||
return NETWORK_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<corners android:radius="0dp" /> <!-- 设置圆角弧度 -->
|
||||
<solid android:color="#FF7001" /> <!-- 设置背景颜色 -->
|
||||
<size
|
||||
android:width="40dp"
|
||||
android:height="40dp" />
|
||||
<stroke
|
||||
android:width="0dp"
|
||||
android:color="#fff" />
|
||||
</shape>
|
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#90376997"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fphonenum"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入注册时手机号" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fpassword"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="请输入新密码" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/change"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="修改" />
|
||||
|
||||
</LinearLayout>
|
@ -1,37 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
android:gravity="center|top"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logoImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="272dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginTop="50dp"
|
||||
android:src="@drawable/logo" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<EditText
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/pk_PickUp"
|
||||
android:hint="请输入取件码"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:layout_width="200dp"
|
||||
android:id="@+id/pk_PickUp"
|
||||
android:layout_width="256dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/translucent_edit"
|
||||
android:layout_marginTop="40dp"
|
||||
android:gravity="center"
|
||||
android:hint="请输入取件码" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pk_PhoneNum"
|
||||
android:hint="请输入手机尾号后四位"
|
||||
/>
|
||||
</LinearLayout>
|
||||
android:layout_width="256dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/translucent_edit"
|
||||
android:gravity="center"
|
||||
android:hint="请输入手机尾号后四位" />
|
||||
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/pk_button"
|
||||
android:layout_width="137dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="70dp"
|
||||
android:background="@drawable/translucent_button"
|
||||
android:text="取 件"
|
||||
android:id="@+id/pk_button"/>
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
@ -0,0 +1,2 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
|
@ -0,0 +1,316 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /usr/local/etc/mavenrc ] ; then
|
||||
. /usr/local/etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`\\unset -f command; \\command -v java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
$MAVEN_DEBUG_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" \
|
||||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
@ -0,0 +1,188 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
|
||||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
|
||||
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% ^
|
||||
%JVM_CONFIG_MAVEN_PROPS% ^
|
||||
%MAVEN_OPTS% ^
|
||||
%MAVEN_DEBUG_OPTS% ^
|
||||
-classpath %WRAPPER_JAR% ^
|
||||
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
|
||||
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
|
||||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%"=="on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
|
||||
|
||||
cmd /C exit /B %ERROR_CODE%
|
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>testdemo</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>testdemo</name>
|
||||
<description>testdemo</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.glassfish</groupId>
|
||||
<artifactId>javax.json</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.73</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.seleniumhq.selenium</groupId>
|
||||
<artifactId>selenium-java</artifactId>
|
||||
<version>3.141.59</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>sonar</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<sonar.host.url>http://127.0.0.1:9000/</sonar.host.url>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.6.0.1398</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>7</source>
|
||||
<target>7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -0,0 +1,18 @@
|
||||
package com.example.testdemo;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
|
||||
@SpringBootApplication(exclude= DataSourceAutoConfiguration.class)
|
||||
public class ServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
SpringApplication.run(ServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,53 @@
|
||||
package com.example.testdemo.entity;
|
||||
|
||||
public class Good {
|
||||
private int id;
|
||||
private String phoneNum;
|
||||
private int shelfNum;
|
||||
private int floorNum;
|
||||
private String time;
|
||||
|
||||
public Good(){
|
||||
|
||||
}
|
||||
|
||||
public int getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id){
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPhoneNum(){
|
||||
return phoneNum;
|
||||
}
|
||||
|
||||
public void setPhoneNum(String phoneNum){
|
||||
this.phoneNum = phoneNum;
|
||||
}
|
||||
|
||||
public int getShelfNum(){
|
||||
return shelfNum;
|
||||
}
|
||||
|
||||
public void setShelfNum(int shelfNum){
|
||||
this.shelfNum = shelfNum;
|
||||
}
|
||||
|
||||
public int getFloorNum(){
|
||||
return floorNum;
|
||||
}
|
||||
|
||||
public void setFloorNum(int floorNum){
|
||||
this.floorNum = floorNum;
|
||||
}
|
||||
|
||||
public String getTime(){
|
||||
return time;
|
||||
}
|
||||
public void setTime(String time){
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.example.testdemo.entity;
|
||||
|
||||
|
||||
public class Operation {
|
||||
private int id;
|
||||
private String pickUpCode;
|
||||
private String phoneNum;
|
||||
private String time;
|
||||
|
||||
public Operation(){
|
||||
|
||||
}
|
||||
|
||||
public int getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id){
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPickUpCode(){
|
||||
return pickUpCode;
|
||||
}
|
||||
|
||||
public void setPickUpCode(String PickUpCode){
|
||||
this.pickUpCode = PickUpCode;
|
||||
}
|
||||
|
||||
public String getPhoneNum(){
|
||||
return phoneNum;
|
||||
}
|
||||
|
||||
public void setPhoneNum(String PhoneNum){
|
||||
this.phoneNum = PhoneNum;
|
||||
}
|
||||
|
||||
public String getTime(){
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time){
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.example.testdemo.manager;
|
||||
|
||||
import com.example.testdemo.entity.Good;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@org.apache.ibatis.annotations.Mapper
|
||||
@Repository
|
||||
public interface GoodManager {
|
||||
List<Good> queryGoodsById(int id);
|
||||
|
||||
List<Good> queryGoodsByPhonenum(String phonenum);
|
||||
|
||||
void delete(int id);
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.example.testdemo.manager;
|
||||
|
||||
|
||||
import com.example.testdemo.entity.Operation;
|
||||
import jdk.nashorn.internal.runtime.OptimisticReturnFilters;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@org.apache.ibatis.annotations.Mapper
|
||||
@Repository
|
||||
public interface OperationManager {
|
||||
|
||||
void addOperation(String pickupcode, String phonenum, String time);
|
||||
|
||||
List<Operation> queryOperationsByPhone(String phonenum);
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.example.testdemo.manager;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter(){
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (c) 2014 example.testdemo Systems, Inc.
|
||||
*
|
||||
* This file is part of the Java ROSBridge Client.
|
||||
*
|
||||
* The Java ROSBridge Client is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Java ROSBridge Client is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
*/
|
||||
package com.example.testdemo.ros;
|
||||
|
||||
import com.example.testdemo.ros.message.Message;
|
||||
|
||||
public interface MessageHandler<T extends Message> {
|
||||
public void onMessage(T message);
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.example.testdemo.ros;
|
||||
|
||||
|
||||
public class Publisher {
|
||||
|
||||
protected String topic;
|
||||
protected String msgType;
|
||||
protected int rosBridge;
|
||||
|
||||
|
||||
public Publisher(String topic, String msgType, int rosBridge){
|
||||
this.topic = topic;
|
||||
this.msgType = msgType;
|
||||
this.rosBridge = rosBridge;
|
||||
|
||||
//this.rosBridge.advertise(this.topic, this.msgType);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Publisher(String topic, String msgType, int rosBridge, boolean advertiseNow){
|
||||
this.topic = topic;
|
||||
this.msgType = msgType;
|
||||
this.rosBridge = rosBridge;
|
||||
|
||||
if(advertiseNow) {
|
||||
//this.rosBridge.advertise(this.topic, this.msgType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getTopic() {
|
||||
return topic;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the ROS message type of the topic to which this object publishes.
|
||||
* @return the ROS message type of the topic to which this object publishes.
|
||||
*/
|
||||
public String getMsgType() {
|
||||
return msgType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the {@link ros.RosBridge} object that manages the connection to the ROS Bridge server.
|
||||
* @return the {@link ros.RosBridge} object that manages the connection to the ROS Bridge server.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Unadvertises that you are publishing to the topic.
|
||||
*/
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
package com.example.testdemo.ros;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonFactory;
|
||||
import com.fasterxml.jackson.core.JsonParseException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This is a delegate interface for handling ros topic subscriptions. The {@link #receive(JsonNode, String)}
|
||||
* is called every time the topic with which this delegate is associated has a new message published.
|
||||
* The JSON data, given as a {@link JsonNode}, has four top-level fields:<p>
|
||||
* op: what kind of operation it was; should always be "publish"<p>
|
||||
* topic: to which topic the message was published<p>
|
||||
* type: the ROS message type of the topic<p>
|
||||
* msg: the provided ros message in JSON format. This the primary field you will work with.<p>
|
||||
* There are generally two ways you can parse the message into a more usable Java object. The first involves manually
|
||||
* iterating through the JSON fields of the msg. For example,
|
||||
* for a geometry_msgs/Twist message, you can get out the linear x value as follows:<p>
|
||||
* <code>double x = data.get("msg").get("linear").get("x").asDouble();</code><p>
|
||||
* (If an element is na array, JSON methods exist for handling it such as {@link JsonNode#get(int)}
|
||||
* and {@link JsonNode#size()}). The the other way is to let the Jackson library unpack
|
||||
* it into a JavaBean. The {@link ros.tools.MessageUnpacker} class further streamlines this process. See its documentation
|
||||
* for more information.
|
||||
* @author James MacGlashan.
|
||||
*/
|
||||
public interface RosListenDelegate {
|
||||
|
||||
/**
|
||||
* Receives a new published message to a subscribed topic. The JSON data, given as a {@link JsonNode}, has four top-level fields:<p>
|
||||
* op: what kind of operation it was; should always be "publish"<p>
|
||||
* topic: to which topic the message was published<p>
|
||||
* type: the ROS message type of the topic<p>
|
||||
* msg: the provided ros message in JSON format. This the primary field you will work with.<p>
|
||||
* This method also receives the full string representation of the received JSON message from ROSBridge.
|
||||
* @param data the {@link JsonNode} containing the JSON data received.
|
||||
* @param stringRep the string representation of the JSON object.
|
||||
*/
|
||||
void receive(JsonNode data, String stringRep);
|
||||
|
||||
|
||||
/**
|
||||
* A class for easy conversion to the legacy java_rosbridge {@link #receive(JsonNode, String)}
|
||||
* message format that presented the JSON data
|
||||
* in a {@link Map} from {@link String} to {@link Object} instances
|
||||
* in which the values were ether primitives, {@link Map} objects themselves, or {@link java.util.List}
|
||||
* objects.
|
||||
*/
|
||||
public static class LegacyFormat{
|
||||
|
||||
/**
|
||||
* A method for easy conversion to the legacy java_rosbridge {@link #receive(JsonNode, String)}
|
||||
* message format that presented the JSON data
|
||||
* in a {@link Map} from {@link String} to {@link Object} instances
|
||||
* in which the values were ether primitives, {@link Map} objects themselves, or {@link java.util.List}
|
||||
* objects.
|
||||
* @param jsonString the source JSON string message that was received
|
||||
* @return a {@link Map} data structure of the JSON data.
|
||||
*/
|
||||
public static Map<String, Object> legacyFormat(String jsonString){
|
||||
|
||||
JsonFactory jsonFactory = new JsonFactory();
|
||||
Map<String, Object> messageData = new HashMap<String, Object>();
|
||||
try {
|
||||
ObjectMapper objectMapper = new ObjectMapper(jsonFactory);
|
||||
TypeReference<Map<String, Object>> listTypeRef =
|
||||
new TypeReference<Map<String, Object>>() {};
|
||||
messageData = objectMapper.readValue(jsonString, listTypeRef);
|
||||
} catch (JsonParseException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return messageData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package com.example.testdemo.ros;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A Subscription request builder. Supports all Rosbridge protocol fields for
|
||||
* a subscription request except png compression. Requires a topic to be set,
|
||||
* with the rest of the optional values set with setter methods that return
|
||||
* the this object so that you can chain settters on a single line. Use
|
||||
* the static {@link #generate(String)} to start the sequence. If a value is set
|
||||
* to null, it will be removed from the message.
|
||||
* <p>
|
||||
* When everything is set, the JSON message can be retrieved with the {@link #generateJsonString()}
|
||||
* @author James MacGlashan.
|
||||
*/
|
||||
public class SubscriptionRequestMsg {
|
||||
|
||||
protected Map<String, Object> keyValues = new HashMap<String, Object>(7);
|
||||
|
||||
public static SubscriptionRequestMsg generate(String topic){
|
||||
return new SubscriptionRequestMsg(topic);
|
||||
}
|
||||
|
||||
public SubscriptionRequestMsg(String topic){
|
||||
if(topic == null){
|
||||
throw new RuntimeException("ROS topic cannot be null in subscription request.");
|
||||
}
|
||||
keyValues.put("op", "subscribe");
|
||||
keyValues.put("topic", topic);
|
||||
}
|
||||
|
||||
public SubscriptionRequestMsg setTopic(String topic){
|
||||
this.setKeyValue("topic", topic);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubscriptionRequestMsg setType(String type){
|
||||
this.setKeyValue("type", type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubscriptionRequestMsg setThrottleRate(Integer throttleRate){
|
||||
this.setKeyValue("throttle_rate", throttleRate);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubscriptionRequestMsg setQueueLength(Integer queueLength){
|
||||
this.setKeyValue("queue_length", queueLength);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SubscriptionRequestMsg setFragmentSize(Integer fragmentSize){
|
||||
this.setKeyValue("fragment_size", fragmentSize);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public SubscriptionRequestMsg setId(String id){
|
||||
this.setKeyValue("id", id);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTopic(){
|
||||
return (String)this.keyValues.get("topic");
|
||||
}
|
||||
|
||||
public String getType(){
|
||||
return (String)this.keyValues.get("type");
|
||||
}
|
||||
|
||||
public Integer getThrottleRate(){
|
||||
return (Integer)this.keyValues.get("throttle_rate");
|
||||
}
|
||||
|
||||
public Integer getQueueLength(){
|
||||
return (Integer)this.keyValues.get("queue_length");
|
||||
}
|
||||
|
||||
public Integer getFragmentSize(){
|
||||
return (Integer)this.keyValues.get("fragment_size");
|
||||
}
|
||||
|
||||
|
||||
public String getId(){
|
||||
return (String)this.keyValues.get("id");
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the JSON string for this subscription request.
|
||||
* @return the JSON string for this subscription request.
|
||||
*/
|
||||
public String generateJsonString(){
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String jsonString = null;
|
||||
try {
|
||||
jsonString = mapper.writeValueAsString(this.keyValues);
|
||||
} catch(JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return jsonString;
|
||||
}
|
||||
|
||||
|
||||
protected void setKeyValue(String key, Object value){
|
||||
if(value == null){
|
||||
this.keyValues.remove(key);
|
||||
}
|
||||
else{
|
||||
this.keyValues.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.example.testdemo.ros.message;
|
||||
|
||||
/**
|
||||
* Created by xxhong on 16-11-17.
|
||||
*/
|
||||
@MessageType(string = "std_msgs/Int16MultiArray")
|
||||
public class AudioMsg extends Message {
|
||||
public short[] data;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright (c) 2014 example.testdemo Systems, Inc.
|
||||
*
|
||||
* This file is part of the Java ROSBridge Client.
|
||||
*
|
||||
* The Java ROSBridge Client is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Java ROSBridge Client is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
*/
|
||||
package com.example.testdemo.ros.message;
|
||||
|
||||
@MessageType(string = "rosgraph_msgs/Clock")
|
||||
public class Clock extends Message {
|
||||
public TimePrimitive clock;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) 2014 example.testdemo Systems, Inc.
|
||||
*
|
||||
* This file is part of the Java ROSBridge Client.
|
||||
*
|
||||
* The Java ROSBridge Client is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Java ROSBridge Client is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/.
|
||||
*
|
||||
*/
|
||||
package com.example.testdemo.ros.message;
|
||||
|
||||
@MessageType(string = "std_msgs/Duration")
|
||||
public class Duration extends DurationPrimitive {
|
||||
}
|