This commit is contained in:
liujing
2021-01-20 21:20:14 +08:00
parent 784861d3ff
commit b00e553fd4
10 changed files with 1168 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
package com.mogo.realtime.entity;
public
/**
* @author congtaowang
* @since 2020/10/25
*
* adas 识别物体参数
*/
class ADASRecognizedResult {
/**
* 识别物体类型
*/
public int type;
/**
* 识别物体唯一标识
*/
public String uuid;
/**
* 红绿灯颜色
*/
public String color;
/**
*
*/
public String carId;
/**
* 识别物体的纬度
*/
public double lat;
/**
* 识别物体的经度
*/
public double lon;
/**
* 朝向
*/
public double heading;
/**
* 系统时间
*/
public long systemTime;
/**
* 定位卫星时间
*/
public long satelliteTime;
/**
* 海拔
*/
public double alt;
/**
* 速度
*/
public double speed;
/**
* 莫顿码
*/
public long mortonCode;
}

View File

@@ -0,0 +1,174 @@
package com.mogo.realtime.entity;
import android.os.Parcel;
import android.os.Parcelable;
import com.mogo.utils.CoordinateUtils;
import java.util.Objects;
/**
* 云端定位信息和自车定位信息
*
* @author tongchenfei
*/
public class CloudLocationInfo implements Parcelable {
private double lat;
private double lon;
private double heading;
private long systemTime;
private long satelliteTime;
private double alt;
private double speed;
public CloudLocationInfo() {
}
public CloudLocationInfo(CloudLocationInfo info ) {
this.lat = info.getLat();
this.lon = info.getLon();
this.heading = info.getHeading();
this.systemTime = System.currentTimeMillis();
this.satelliteTime = System.currentTimeMillis();
this.alt = info.alt;
this.speed = info.speed;
}
public void convertCoor2GCJ02(){
double[] amapCoord = CoordinateUtils.transformFromWGSToGCJ( lat, lon );
if ( amapCoord != null ) {
this.lat = amapCoord[0];
this.lon = amapCoord[1];
}
}
protected CloudLocationInfo(Parcel in ) {
lat = in.readDouble();
lon = in.readDouble();
heading = in.readDouble();
systemTime = in.readLong();
satelliteTime = in.readLong();
alt = in.readDouble();
speed = in.readDouble();
}
@Override
public void writeToParcel( Parcel dest, int flags ) {
dest.writeDouble( lat );
dest.writeDouble( lon );
dest.writeDouble( heading );
dest.writeLong( systemTime );
dest.writeLong( satelliteTime );
dest.writeDouble( alt );
dest.writeDouble( speed );
}
@Override
public int describeContents() {
return 0;
}
public static final Creator< CloudLocationInfo > CREATOR = new Creator< CloudLocationInfo >() {
@Override
public CloudLocationInfo createFromParcel( Parcel in ) {
return new CloudLocationInfo( in );
}
@Override
public CloudLocationInfo[] newArray( int size ) {
return new CloudLocationInfo[size];
}
};
public double getLat() {
return lat;
}
public void setLat( double lat ) {
this.lat = lat;
}
public double getLon() {
return lon;
}
public void setLon( double lon ) {
this.lon = lon;
}
public double getHeading() {
return heading;
}
public void setHeading( double heading ) {
this.heading = heading;
}
public long getSystemTime() {
return systemTime;
}
public void setSystemTime( long systemTime ) {
this.systemTime = systemTime;
}
public long getSatelliteTime() {
return satelliteTime;
}
public void setSatelliteTime( long satelliteTime ) {
this.satelliteTime = satelliteTime;
}
public double getAlt() {
return alt;
}
public void setAlt( double alt ) {
this.alt = alt;
}
public double getSpeed() {
return speed;
}
public void setSpeed( double speed ) {
this.speed = speed;
}
@Override
public String toString() {
return "CloudLocationInfo{" +
"lat=" + lat +
", lon=" + lon +
", heading=" + heading +
", systemTime=" + systemTime +
", satelliteTime=" + satelliteTime +
", alt=" + alt +
", speed=" + speed +
'}';
}
public String print() {
return "CloudLocation{ lon: " + lon + " lat: " + lat + " heading: " + heading + " speed: "
+ speed + "}";
}
@Override
public boolean equals( Object o ) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
CloudLocationInfo that = ( CloudLocationInfo ) o;
return Double.compare( that.lat, lat ) == 0 &&
Double.compare( that.lon, lon ) == 0;
}
@Override
public int hashCode() {
return Objects.hash( lat, lon );
}
}