Merge remote-tracking branch 'origin/dev2_aiSdk' into dev2_aiSdk
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -8,7 +8,7 @@
|
||||
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
|
||||
<groovy codeStyle="LEGACY" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="12" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="12" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.commons.network.Utils;
|
||||
|
||||
/**
|
||||
* 查询下车乘客请求参数
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class QueryLeaveAwayPassengersRequest {
|
||||
private String sn;
|
||||
private int siteId;
|
||||
|
||||
public QueryLeaveAwayPassengersRequest( int siteId ) {
|
||||
this.sn = Utils.getSn();
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn( String sn ) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId( int siteId ) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.och.bus.bean;
|
||||
|
||||
import com.mogo.commons.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/26
|
||||
*
|
||||
* 到站查询下车乘客
|
||||
*/
|
||||
class QueryLeaveAwayPassengersResponse extends BaseData {
|
||||
|
||||
public Result result;
|
||||
|
||||
public static class Result {
|
||||
|
||||
public List< LeaveAwayPassenger > info;
|
||||
}
|
||||
|
||||
public static class LeaveAwayPassenger {
|
||||
|
||||
/**
|
||||
* _id : 9a3b0aacb5f241eabb5ed9f8615d9af6
|
||||
* orderNo : XB20210324000001
|
||||
* orderType : 10
|
||||
* userName : 星期一
|
||||
* userPhone : 15555555555
|
||||
* startStationId : 1
|
||||
* startStation : 万集东门站
|
||||
* startStationCoordinate : [116.7354579447,40.1974932972]
|
||||
* endStationId : 2
|
||||
* endStation : 顺密路口站
|
||||
* endStationCoordinate : [116.7215386924,40.194019209]
|
||||
* orderDispatchType : 1
|
||||
* carNum : 京NB007
|
||||
* sn : F803BB2037EZD00088
|
||||
* orderStartTime : 2021-03-24 11:51:24
|
||||
* orderEndTime :
|
||||
* arrivedStartStationTime :
|
||||
* arrivedEndStationTime :
|
||||
* cityCode : 010
|
||||
* areaCode : 1001
|
||||
* createTime : 2021-03-24 11:51:24
|
||||
* updateTime : 2021-03-24 12:32:10
|
||||
* personNum :
|
||||
* travelDistance : 1.2
|
||||
* vehicleColour :
|
||||
* lastBrandName :
|
||||
* headImgUrl :
|
||||
*/
|
||||
|
||||
public String _id;
|
||||
public String orderNo;
|
||||
public int orderType;
|
||||
public String userName;
|
||||
public String userPhone;
|
||||
public int startStationId;
|
||||
public String startStation;
|
||||
public int endStationId;
|
||||
public String endStation;
|
||||
public int orderDispatchType;
|
||||
public String carNum;
|
||||
public String sn;
|
||||
public String orderStartTime;
|
||||
public String orderEndTime;
|
||||
public String arrivedStartStationTime;
|
||||
public String arrivedEndStationTime;
|
||||
public String cityCode;
|
||||
public String areaCode;
|
||||
public String createTime;
|
||||
public String updateTime;
|
||||
public String personNum;
|
||||
public double travelDistance;
|
||||
public String vehicleColour;
|
||||
public String lastBrandName;
|
||||
public String headImgUrl;
|
||||
public List< Double > startStationCoordinate;
|
||||
public List< Double > endStationCoordinate;
|
||||
}
|
||||
}
|
||||
@@ -129,41 +129,35 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
boolean isArriveAtStation = false;
|
||||
boolean isArriveAtStartStation = false;
|
||||
|
||||
for ( OchBusStation ochBusStation : stationList ) {
|
||||
int index = stationList.indexOf( ochBusStation );
|
||||
switch ( ochBusStation.getIsCurrentSite() ) {
|
||||
case OchBusConst.STATION_STATUS_STOPPED:
|
||||
isArriveEndStation = index == stationList.size() - 1;
|
||||
isArriveAtStation = true;
|
||||
case OchBusConst.STATION_STATUS_LEAVING:
|
||||
break;
|
||||
case OchBusConst.STATION_STATUS_ARRIVING:
|
||||
break;
|
||||
}
|
||||
}
|
||||
currentStationName = stationList.get( currentStation ).getSiteName();
|
||||
|
||||
if ( currentStation == 0 ) {
|
||||
startStationFlagVisibility = View.VISIBLE;
|
||||
isArriveAtStartStation = true;
|
||||
mStartStationFlag.setText( "始" );
|
||||
} else if ( currentStation > 0 && currentStation < stationList.size() - 1 ) {
|
||||
isArriveAtStation = true;
|
||||
} else if ( currentStation == stationList.size() - 1 ) {
|
||||
isArriveEndStation = true;
|
||||
nextStationName = "--";
|
||||
mStartStationFlag.setText( "终" );
|
||||
startStationFlagVisibility = View.VISIBLE;
|
||||
endStationFlagVisibility = View.INVISIBLE;
|
||||
}
|
||||
|
||||
if ( nextStation > currentStation && nextStation <= stationList.size() - 1 ) {
|
||||
nextStationName = stationList.get( nextStation ).getSiteName();
|
||||
}
|
||||
|
||||
if ( nextStation == stationList.size() - 1 ) {
|
||||
endStationFlagVisibility = View.VISIBLE;
|
||||
}
|
||||
|
||||
currentStationName = stationList.get( currentStation ).getSiteName();
|
||||
|
||||
if ( nextStation < stationList.size() ) {
|
||||
nextStationName = stationList.get( nextStation ).getSiteName();
|
||||
}
|
||||
|
||||
if ( isArriveEndStation ) {
|
||||
showNotice( "行程结束,请携带好随身物品,注意侧后方来车,感谢体验蘑菇智行自动驾驶车!" );
|
||||
showSlidePanle( "单程结束" );
|
||||
} else if ( isArriveAtStartStation ) {
|
||||
showSlidePanle( "准备出发" );
|
||||
} else if ( isArriveAtStation ) {
|
||||
showNotice( "行程结束,请携带好随身物品,注意侧后方来车,感谢体验蘑菇智行自动驾驶车!" );
|
||||
showSlidePanle( "乘客已上车,准备出发" );
|
||||
}
|
||||
|
||||
@@ -185,10 +179,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
|
||||
@Override
|
||||
public void restartAutopilot() {
|
||||
// 如果能自动驾驶,就自动驾驶,不能就提示
|
||||
if ( MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus() == IMogoAdasOCHCallback.STATUS_AUTOPILOT_ENABLE ) {
|
||||
mPresenter.restartAutopilot();
|
||||
}
|
||||
mPresenter.restartAutopilot();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -198,7 +189,7 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
|
||||
@Override
|
||||
public void moveToEnd() {
|
||||
mPresenter.autoDriveToNextStation();
|
||||
mPresenter.autoDriveToNextStation(false);
|
||||
}
|
||||
|
||||
public void onAutopilotEnableChange( boolean isEnable ) {
|
||||
@@ -217,9 +208,9 @@ public class OchBusFragment extends BaseOchFragment< OchBusFragment, OchBusPrese
|
||||
|
||||
public void changeOperationStatus( boolean launch ) {
|
||||
if ( launch ) {
|
||||
tvOperationStatus.setText( "关闭" );
|
||||
tvOperationStatus.setText( "收车" );
|
||||
} else {
|
||||
tvOperationStatus.setText( "开启" );
|
||||
tvOperationStatus.setText( "出车" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.OchBusOperationStatusResponse;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.bean.QueryOchBusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.UpdateSiteStatusRequest;
|
||||
|
||||
@@ -41,7 +43,7 @@ public interface IOchBusApiService {
|
||||
*/
|
||||
@Headers( {"Content-Type:application/json;charset=UTF-8"} )
|
||||
@POST( "/yycp-onlinecar-hailing/onlineCarHailing/site/siteCrashCheck/v1" )
|
||||
Observable< BaseData > leaveStation( @Body RequestBody requestBody );
|
||||
Observable< OchBusRoutesResponse > leaveStation( @Body RequestBody requestBody );
|
||||
|
||||
/**
|
||||
* 调试用重置接口
|
||||
@@ -83,4 +85,14 @@ public interface IOchBusApiService {
|
||||
@POST( "/yycp-onlinecar-hailing/onlineCarHailing/site/siteDynamic/v1" )
|
||||
Observable< OchBusRoutesResponse > updateSiteStation( @Body UpdateSiteStatusRequest request );
|
||||
|
||||
/**
|
||||
* 到站查询下车乘客
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Headers( {"Content-type:application/json;charset=UTF-8"} )
|
||||
@POST( "/yycp-onlinecar-hailing/onlineCarHailing/busOrder/queryOrderBySiteAndSn/v1" )
|
||||
Observable< QueryLeaveAwayPassengersResponse > queryStationLeaveAwayPassengers( @Body QueryLeaveAwayPassengersRequest request );
|
||||
|
||||
}
|
||||
|
||||
@@ -73,21 +73,6 @@ class OchBusOrderModel {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 小巴达到站点,推送需要下车的乘客列表
|
||||
*/
|
||||
private IMogoOnMessageListener< OchBusArriveAtStationMsg > mOnBusArriveAtStationMsg = new IMogoOnMessageListener< OchBusArriveAtStationMsg >() {
|
||||
@Override
|
||||
public Class< OchBusArriveAtStationMsg > target() {
|
||||
return OchBusArriveAtStationMsg.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived( OchBusArriveAtStationMsg obj ) {
|
||||
onArriveAtStation();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 站点信息变更推送
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.commons.network.Utils;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.HostConst;
|
||||
import com.mogo.och.bus.bean.OchBusLeaveStationRequest;
|
||||
@@ -23,6 +22,8 @@ import com.mogo.och.bus.bean.OchBusResetRequest;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesRequest;
|
||||
import com.mogo.och.bus.bean.OchBusRoutesResponse;
|
||||
import com.mogo.och.bus.bean.OchBusStation;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersRequest;
|
||||
import com.mogo.och.bus.bean.QueryLeaveAwayPassengersResponse;
|
||||
import com.mogo.och.bus.bean.QueryOchBusOperationStatusRequest;
|
||||
import com.mogo.och.bus.bean.UpdateSiteStatusRequest;
|
||||
import com.mogo.och.bus.fragment.OchBusFragment;
|
||||
@@ -43,7 +44,6 @@ import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_ARRIVING;
|
||||
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_IDLE;
|
||||
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_LEAVING;
|
||||
import static com.mogo.och.bus.constant.OchBusConst.STATION_STATUS_STOPPED;
|
||||
|
||||
@@ -103,11 +103,10 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
public void queryBusRoutes() {
|
||||
double lat = 40.1974932972;
|
||||
double lon = 116.7354579447;
|
||||
MogoLocation lastLocation = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient( getContext() ).getLastKnowLocation();
|
||||
if ( lastLocation != null ) {
|
||||
// lat = lastLocation.getLatitude();
|
||||
// lon = lastLocation.getLongitude();
|
||||
}
|
||||
|
||||
// lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
|
||||
// lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
|
||||
|
||||
OchBusRoutesRequest request = new OchBusRoutesRequest( Utils.getSn(), lat, lon );
|
||||
RequestBody requestBody = RequestBody.create( MediaType.get( "application/json;charset=UTF-8" ), GsonUtil.jsonFromObject( request ) );
|
||||
mService.querySiteByCoordinate( requestBody )
|
||||
@@ -151,6 +150,8 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
* @param site
|
||||
*/
|
||||
private void renderBusStationsStatus( List< OchBusStation > site ) {
|
||||
int lastStopStation = getNextStopStation();
|
||||
|
||||
stationList.clear();
|
||||
stationList.addAll( site );
|
||||
for ( int i = 0; i < stationList.size(); i++ ) {
|
||||
@@ -167,6 +168,34 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
}
|
||||
|
||||
mView.refreshBusStations( stationList, currentStationIndex, getNextStopStation() );
|
||||
|
||||
if ( isGoingToNextStation ) {
|
||||
mView.hideSlidePanel();
|
||||
mView.hideNotice();
|
||||
}
|
||||
|
||||
resetNextStopStation( lastStopStation );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置下一站
|
||||
*
|
||||
* @param lastStopStation
|
||||
*/
|
||||
private void resetNextStopStation( int lastStopStation ) {
|
||||
int nextStopStation = getNextStopStation();
|
||||
if ( nextStopStation < 0 ) {
|
||||
return;
|
||||
}
|
||||
if ( lastStopStation <= nextStopStation || nextStopStation <= currentStationIndex ) {
|
||||
return;
|
||||
}
|
||||
if ( MogoApisHandler.getInstance().getApis().getAdasControllerApi().getAutopilotStatus()
|
||||
== IMogoAdasOCHCallback.STATUS_AUTOPILOT_RUNNING ) {
|
||||
// 自动驾驶中动态设置下一个停靠站点
|
||||
autoDriveToNextStation( true );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,7 +223,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
public void restartAutopilot() {
|
||||
Logger.d( TAG, "重启自动驾驶===" + isGoingToNextStation );
|
||||
if ( isGoingToNextStation ) {
|
||||
autoDriveToNextStation();
|
||||
autoDriveToNextStation( true );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +269,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
/**
|
||||
* 开启自动驾驶到下一站
|
||||
*/
|
||||
public void autoDriveToNextStation() {
|
||||
public void autoDriveToNextStation( boolean isRestart ) {
|
||||
if ( currentStationIndex >= stationList.size() - 1 ) {
|
||||
// 当前站是最后一站,结束当前行程
|
||||
travelOver();
|
||||
@@ -255,6 +284,7 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
nextStation.setIsCurrentSite( STATION_STATUS_ARRIVING );
|
||||
|
||||
RemoteControlAutoPilotParameters currentAutopilot = new RemoteControlAutoPilotParameters();
|
||||
currentAutopilot.isSpeakVoice = !isRestart;
|
||||
currentAutopilot.startLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( currentStation.getLat(), currentStation.getLon() );
|
||||
currentAutopilot.endLatLon = new RemoteControlAutoPilotParameters.AutoPilotLonLat( nextStation.getLat(), nextStation.getLon() );
|
||||
currentAutopilot.vehicleType = VEHICLE_TYPE;
|
||||
@@ -262,10 +292,10 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().aiCloudToAdasData( currentAutopilot );
|
||||
|
||||
if ( mView != null ) {
|
||||
mView.refreshBusStations( stationList, currentStationIndex, getNextStopStation() );
|
||||
mView.refreshBusStations( stationList, currentStationIndex, nextStationIndex );
|
||||
mView.hideSlidePanel();
|
||||
mView.hideNotice();
|
||||
}
|
||||
mView.hideSlidePanel();
|
||||
mView.hideNotice();
|
||||
|
||||
if ( isGoingToNextStation ) {
|
||||
// 为了避免恢复自动驾驶时重复的接口请求
|
||||
@@ -276,10 +306,14 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
RequestBody request = RequestBody.create( MediaType.get( "application/json" ), GsonUtil.jsonFromObject( new OchBusLeaveStationRequest( Utils.getSn(), stationList.get( currentStationIndex ).getSiteId() ) ) );
|
||||
mService.leaveStation( request ).subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( getContext() ) ) {
|
||||
.subscribe( new SubscribeImpl< OchBusRoutesResponse >( RequestOptions.create( getContext() ) ) {
|
||||
@Override
|
||||
public void onSuccess( BaseData o ) {
|
||||
public void onSuccess( OchBusRoutesResponse o ) {
|
||||
super.onSuccess( o );
|
||||
if ( o.getResult() == null || o.getResult().getSite() == null || o.getResult().getSite().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
renderBusStationsStatus( o.getResult().getSite() );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -306,6 +340,14 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
isGoingToNextStation = false;
|
||||
// 到达站点后,更新站点状态
|
||||
currentStationIndex = getNextStopStation();
|
||||
updateSiteStation();
|
||||
queryLeaveAwayPassengers();
|
||||
}
|
||||
|
||||
/**
|
||||
* 到站后重置站点状态
|
||||
*/
|
||||
private void updateSiteStation() {
|
||||
mService.updateSiteStation( new UpdateSiteStatusRequest( stationList.get( currentStationIndex ).getSiteId() ) )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
@@ -331,12 +373,60 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
Logger.e( TAG, e, "leave station exception" );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
// stationList.get( nextStation ).setIsCurrentSite( STATION_STATUS_STOPPED );
|
||||
// stationList.get( currentStationIndex ).setIsCurrentSite( STATION_STATUS_IDLE );
|
||||
// if ( mView != null ) {
|
||||
// mView.refreshBusStations( stationList, currentStationIndex, nextStation );
|
||||
// }
|
||||
/**
|
||||
* 查询到站下车乘客
|
||||
*/
|
||||
private void queryLeaveAwayPassengers() {
|
||||
mService.queryStationLeaveAwayPassengers( new QueryLeaveAwayPassengersRequest( stationList.get( currentStationIndex ).getSiteId() ) )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< QueryLeaveAwayPassengersResponse >( RequestOptions.create( getContext() ) ) {
|
||||
@Override
|
||||
public void onSuccess( QueryLeaveAwayPassengersResponse o ) {
|
||||
super.onSuccess( o );
|
||||
playLeavePassengersMsg( o );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( String message, int code ) {
|
||||
super.onError( message, code );
|
||||
Logger.d( TAG, "leave station error: " + message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError( Throwable e ) {
|
||||
super.onError( e );
|
||||
Logger.e( TAG, e, "leave station exception" );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
private void playLeavePassengersMsg( QueryLeaveAwayPassengersResponse o ) {
|
||||
if ( currentStationIndex > stationList.size() - 1 ) {
|
||||
return;
|
||||
}
|
||||
String station = stationList.get( currentStationIndex ).getSiteName();
|
||||
StringBuilder builder = new StringBuilder( "已到达" );
|
||||
if ( station.endsWith( "站" ) ) {
|
||||
builder.append( station );
|
||||
}
|
||||
if ( o == null || o.result == null || o.result.info == null || o.result.info.isEmpty() ) {
|
||||
//
|
||||
} else {
|
||||
builder.append( ",请尾号为" );
|
||||
for ( QueryLeaveAwayPassengersResponse.LeaveAwayPassenger leaveAwayPassenger : o.result.info ) {
|
||||
if ( leaveAwayPassenger == null ) {
|
||||
continue;
|
||||
}
|
||||
String tailNum = leaveAwayPassenger.userPhone.substring( leaveAwayPassenger.userPhone.length() - 4 );
|
||||
builder.append( tailNum ).append( "," );
|
||||
}
|
||||
builder.append( "的乘客下车" );
|
||||
}
|
||||
builder.append( ",带好随身物品,下车请注意安全" );
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( builder.toString() );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -353,19 +443,16 @@ public class OchBusPresenter extends Presenter< OchBusFragment > implements IMog
|
||||
RequestBody request = RequestBody.create( MediaType.get( "application/json" ), GsonUtil.jsonFromObject( new OchBusLeaveStationRequest( Utils.getSn(), stationList.get( currentStationIndex ).getSiteId() ) ) );
|
||||
mService.leaveStation( request ).subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( getContext() ) ) {
|
||||
.subscribe( new SubscribeImpl< OchBusRoutesResponse >( RequestOptions.create( getContext() ) ) {
|
||||
@Override
|
||||
public void onSuccess( BaseData o ) {
|
||||
public void onSuccess( OchBusRoutesResponse o ) {
|
||||
super.onSuccess( o );
|
||||
// 始发站改为Stoped,其他站改为Idle
|
||||
Logger.d( TAG, "单程真的结束了====" );
|
||||
stationList.get( currentStationIndex ).setIsCurrentSite( STATION_STATUS_IDLE );
|
||||
currentStationIndex = 0;
|
||||
stationList.get( currentStationIndex ).setIsCurrentSite( STATION_STATUS_STOPPED );
|
||||
stationList.get( currentStationIndex++ ).setIsCurrentSite( STATION_STATUS_ARRIVING );
|
||||
if ( mView != null ) {
|
||||
mView.refreshBusStations( stationList, currentStationIndex, getNextStopStation() );
|
||||
if ( o.getResult() == null || o.getResult().getSite() == null || o.getResult().getSite().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
renderBusStationsStatus( o.getResult().getSite() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/module_mogo_och_autopilot_text_color_checked" android:state_checked="true" />
|
||||
<item android:color="@color/module_mogo_och_autopilot_text_color_normal"/>
|
||||
</selector>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -1,14 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:bottomLeftRadius="20px"
|
||||
android:bottomRightRadius="45px"
|
||||
android:topLeftRadius="45px"
|
||||
android:topRightRadius="20px" />
|
||||
<gradient
|
||||
android:angle="315"
|
||||
android:endColor="#FF28376B"
|
||||
android:startColor="#FF405591" />
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
|
||||
<gradient android:angle="315" android:endColor="#2B6EFF" android:startColor="#2B6EFF" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="20px" android:bottomRightRadius="45px" android:topLeftRadius="45px" android:topRightRadius="20px" />
|
||||
<gradient android:angle="315" android:endColor="#3B4577" android:startColor="#3B4577" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
</shape>
|
||||
@@ -5,8 +5,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingStart="@dimen/module_mogo_och_margin_left"
|
||||
android:paddingTop="@dimen/module_mogo_och_margin_top"
|
||||
android:paddingEnd="@dimen/module_mogo_och_margin_right"
|
||||
android:paddingBottom="@dimen/module_mogo_och_margin_bottom">
|
||||
|
||||
<CheckedTextView
|
||||
@@ -15,17 +13,17 @@
|
||||
android:layout_height="@dimen/module_mogo_och_autopilot_status_bg_height"
|
||||
android:layout_marginTop="@dimen/module_mogo_och_station_panel_container_margin_top_no_call"
|
||||
android:background="@drawable/module_mogo_och_autopilot_status_bg"
|
||||
android:drawableLeft="@drawable/module_mogo_och_base_autopilot_status_icon_selector"
|
||||
android:drawableLeft="@drawable/module_och_bus_ic_autopilot"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="35px"
|
||||
android:text="自动驾驶"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/module_mogo_och_autopilot_text_color_selector"
|
||||
android:textColor="@color/module_mogo_och_autopilot_text_color_normal"
|
||||
android:textSize="@dimen/module_mogo_och_autopilot_status_text_size"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible"/>
|
||||
tools:visibility="visible" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
@@ -40,7 +38,6 @@
|
||||
android:id="@+id/module_mogo_och_operation_status"
|
||||
android:layout_width="@dimen/module_mogo_och_operation_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_och_operation_status_bg_height"
|
||||
android:layout_marginBottom="10px"
|
||||
android:background="@drawable/module_mogo_och_operation_status_bg"
|
||||
android:gravity="center"
|
||||
android:text="开启"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- 此资源适配分体机 xhdpi -->
|
||||
<dimen name="module_mogo_och_margin_left">55px</dimen>
|
||||
<dimen name="module_mogo_och_margin_left">40px</dimen>
|
||||
<dimen name="module_mogo_och_margin_right">40px</dimen>
|
||||
<dimen name="module_mogo_och_margin_bottom">40px</dimen>
|
||||
<dimen name="module_mogo_och_margin_bottom">46px</dimen>
|
||||
<dimen name="module_mogo_och_margin_top">24px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_station_panel_container_margin_top_no_call">400px</dimen>
|
||||
<dimen name="module_mogo_och_station_panel_container_margin_top_no_call">351px</dimen>
|
||||
<dimen name="module_mogo_och_station_panel_container_margin_top_with_call">492px</dimen>
|
||||
|
||||
<dimen name="module_mogo_och_autopilot_status_bg_corner">24px</dimen>
|
||||
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.4.6'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.4.8'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
|
||||
}
|
||||
|
||||
|
||||
@@ -1044,7 +1044,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
Map<String, RoadCacheWrapper> roadCacheMap = new ConcurrentHashMap<>();
|
||||
private RoadCacheWrapper noCache = new RoadCacheWrapper(null);
|
||||
private final RoadCacheWrapper noCache = new RoadCacheWrapper(null);
|
||||
|
||||
@Override
|
||||
public void clearRoadCacheById(String id) {
|
||||
@@ -1056,21 +1056,32 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK, true);
|
||||
}
|
||||
|
||||
int[] colors = new int[]{Color.RED, Color.GREEN, Color.BLUE};
|
||||
int colorIndex = 0;
|
||||
/**
|
||||
* 带缓存的道路匹配算法
|
||||
*
|
||||
* 使用{@link MapDataApi#INSTANCE#getSinglePointMatchRoad()}这个方法获取道路数据会存在一定耗时,目前是4-10ms,因为请求频繁,为了
|
||||
* 减小这部分耗时,使用一个ConcurrentHashMap{@link #roadCacheMap}缓存道路数据,此缓存是以目标车id为key,道路数据为value,以此减少
|
||||
* 道路数据获取次数。
|
||||
*
|
||||
* 当出现道路改变的情况,需要重新获取道路数据,采用递归的方式重获道路数据以及添加缓存,为了避免一直获取不到道路数据,一直递归,增加useCache参数跳出递归。
|
||||
*
|
||||
* 道路改变的情况主要分为:
|
||||
* 1. 目标车距离道路中心线距离超过阈值 matchThreshold(取路宽的1/4为阈值);
|
||||
* 2. 目标车到道路中心线的映射点不在道路上(此判断在{@link PointInterpolatorUtil#mergeToRoad(double, double, List)}),也就是说已经驶出了这条道路
|
||||
*
|
||||
* @param id 目标车唯一标识
|
||||
* @param lon 目标车经度
|
||||
* @param lat 目标车纬度
|
||||
* @param angle 目标车角度
|
||||
* @param isGpsLocation true-使用gps定位数据
|
||||
* @param isRTK true-使用rtk数据
|
||||
* @param usdCache true-使用道路缓存 false-不使用道路缓存
|
||||
* @return double[]{匹配后经度,匹配后纬度,目标车距离车道中心线距离},若匹配后经纬度值为-1,则没有匹配成功
|
||||
*/
|
||||
private double[] matchRoad(String id, double lon, double lat, double angle, boolean isGpsLocation, boolean isRTK, boolean usdCache) {
|
||||
double wgs[] = new double[]{lon, lat};
|
||||
double[] wgs = new double[]{lon, lat};
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
//
|
||||
|
||||
// SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad(((float) wgs[0]), ((float) wgs[1]), ((float) angle), isGpsLocation, isRTK);
|
||||
// if ( singlePointRoadInfo == null || singlePointRoadInfo.getCoords() == null || singlePointRoadInfo.getCoords().isEmpty() ) {
|
||||
// return null;
|
||||
// }
|
||||
// double matchedPoint[] = PointInterpolatorUtil.mergeToRoad(wgs[0], wgs[1], singlePointRoadInfo.getCoords());
|
||||
// return matchedPoint;
|
||||
|
||||
RoadCacheWrapper roadCache = roadCacheMap.get(id);
|
||||
double matchThreshold = -1;
|
||||
if (roadCache == null||roadCache == noCache) {
|
||||
@@ -1079,6 +1090,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
Log.i("timer-matchRoad-4", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + singlePointRoadInfo.getRoadId());
|
||||
roadCache = new RoadCacheWrapper(singlePointRoadInfo.getCoords());
|
||||
roadCache.setLaneWidth(singlePointRoadInfo.getLaneWidth());
|
||||
// 在地图上画点的测试方法
|
||||
// try {
|
||||
// PolylineOptions options = new PolylineOptions( );
|
||||
// options.setColor( colors[colorIndex++] );
|
||||
@@ -1105,22 +1117,22 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (roadCache != null
|
||||
&& roadCache.getRoad() != null
|
||||
&& !roadCache.getRoad().isEmpty()) {
|
||||
// 未获取到道路中心线数据
|
||||
start = System.currentTimeMillis();
|
||||
matchThreshold = roadCache.getLaneWidth() / 4;
|
||||
|
||||
double matchedPoint[] = PointInterpolatorUtil.mergeToRoad(wgs[0], wgs[1], roadCache.getRoad());
|
||||
double[] matchedPoint = PointInterpolatorUtil.mergeToRoad(wgs[0], wgs[1], roadCache.getRoad());
|
||||
if (matchThreshold>0&&matchedPoint[2] > 0 && matchedPoint[2] <= matchThreshold) {
|
||||
// if (roadCache.inCache(matchedPoint[0], matchedPoint[1])) {
|
||||
// 目标车在阈值范围内
|
||||
roadCacheMap.put(id, roadCache);
|
||||
Log.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return matchedPoint;
|
||||
// }
|
||||
// roadCacheMap.put(id, null);
|
||||
// Log.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: "+roadCache.getLastLat());
|
||||
// return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK,false);
|
||||
} else if (matchedPoint[2] > matchThreshold && matchedPoint[2] < 1.5) {
|
||||
// 目标车在阈值范围外,也就是说距离道路中心线太远了,就不吸附了
|
||||
return null;
|
||||
} else {
|
||||
// 目标车到道路中心线的映射点不在道路上,也就是已经使出了缓存的那条道路,需要重新获取一条道路,用useCache这个参数来避免重复递归
|
||||
roadCacheMap.put(id, noCache);
|
||||
Log.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + roadCache.getLastLat());
|
||||
if (usdCache) {
|
||||
@@ -1128,7 +1140,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
// return null;
|
||||
}
|
||||
}
|
||||
roadCacheMap.put(id, noCache);
|
||||
|
||||
@@ -242,6 +242,8 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -93,7 +93,7 @@ class CustomMapApiBuilder implements IMogoMapApiBuilder {
|
||||
@Override
|
||||
public IMogoMapView getMapView( Context context ) {
|
||||
NavAutoApi.INSTANCE.init( context, MapParams.Companion.init()
|
||||
.setDebugMode( true )
|
||||
.setDebugMode( false )
|
||||
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
|
||||
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
|
||||
.setZoom( 20 )
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.mogo.map.impl.custom.utils;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -35,22 +31,22 @@ public class PointInterpolatorUtil {
|
||||
* @deprecated 这个方法有问题,并不能算出来想要的值
|
||||
*/
|
||||
@Deprecated
|
||||
public static void interpolate( List< MogoLatLng > points ) {
|
||||
if ( points.size() >= 2 ) {
|
||||
public static void interpolate(List<MogoLatLng> points) {
|
||||
if (points.size() >= 2) {
|
||||
// 插值
|
||||
for ( int i = 0; i < points.size() - 1; i++ ) {
|
||||
MogoLatLng current = points.get( i );
|
||||
MogoLatLng next = points.get( i + 1 );
|
||||
float distance = CoordinateUtils.calculateLineDistance( current.lon, current.lat, next.lon, next.lat );
|
||||
Logger.d( TAG, i + ": " + distance );
|
||||
if ( distance > DISTANCE_THRESHOLD ) {
|
||||
int inter = ( int ) ( distance / DISTANCE_THRESHOLD ) + 1;
|
||||
for ( int j = 1; j < inter; j++ ) {
|
||||
double newLat = current.lat + ( next.lat - current.lat ) * j / inter;
|
||||
double newLon = current.lon + ( next.lon - current.lon ) * j / inter;
|
||||
Logger.d( TAG, "distance: " + distance + ", j: " + j + ", nextLat: " + next.lat + ", nextLon: " + next.lon + ", newLat: " + newLat + ", newLon: " + newLon );
|
||||
points.add( i + 1, new MogoLatLng( newLat, newLon ) );
|
||||
current = points.get( ++i );
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
MogoLatLng current = points.get(i);
|
||||
MogoLatLng next = points.get(i + 1);
|
||||
float distance = CoordinateUtils.calculateLineDistance(current.lon, current.lat, next.lon, next.lat);
|
||||
Logger.d(TAG, i + ": " + distance);
|
||||
if (distance > DISTANCE_THRESHOLD) {
|
||||
int inter = (int) (distance / DISTANCE_THRESHOLD) + 1;
|
||||
for (int j = 1; j < inter; j++) {
|
||||
double newLat = current.lat + (next.lat - current.lat) * j / inter;
|
||||
double newLon = current.lon + (next.lon - current.lon) * j / inter;
|
||||
Logger.d(TAG, "distance: " + distance + ", j: " + j + ", nextLat: " + next.lat + ", nextLon: " + next.lon + ", newLat: " + newLat + ", newLon: " + newLon);
|
||||
points.add(i + 1, new MogoLatLng(newLat, newLon));
|
||||
current = points.get(++i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,77 +54,67 @@ public class PointInterpolatorUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static double[] mergeToRoad( double lon, double lat, List< LonLatPoint > road ) {
|
||||
/**
|
||||
* 道路吸附算法
|
||||
* <p>
|
||||
* 所谓的道路数据,实际就是道路对应的点集,每两个点之间是直线,但是两点间距并不固定,点集内点的数量也不固定,点集是有序的,按道路方向排序,road[0]是起点。
|
||||
* 为了避免拐弯道路的问题,先使用{@link #getCloseTwoPoint(int, int, double, double, List)}从道路数据里面找出距离目标点最近的两个点,记为A、B,最近的两个点就在目标点一前一后排列,
|
||||
* 这样的话,求一下目标点到AB的垂直映射以及距离{@link #getFootAndMinDistance(double, double, double, double, double, double)},就是吸附后的经纬度和距离
|
||||
*
|
||||
* @param lon 目标经度
|
||||
* @param lat 目标纬度
|
||||
* @param road 目标道路数据
|
||||
* @return double[]{吸附后的经度,吸附后的纬度,目标经纬度距离道路的垂直距离}
|
||||
*/
|
||||
public static double[] mergeToRoad(double lon, double lat, List<LonLatPoint> road) {
|
||||
int closeStart = 0;
|
||||
int closeEnd = road.size() - 1;
|
||||
int[] result = getCloseTwoPoint(closeStart,closeEnd, lon, lat, road );
|
||||
LonLatPoint start = road.get( result[0] );
|
||||
LonLatPoint end = road.get( result[1] );
|
||||
// Logger.d( TAG, "mergeToRoad start: " + closeStart + " end: " + closeEnd );
|
||||
// return getMid(start, end);
|
||||
// double[] foot = getFoot( lon, lat, start, end );
|
||||
|
||||
// float d = CoordinateUtils.calculateLineDistance( foot[0], foot[1], lon, lat );
|
||||
// Logger.d( TAG, "distance to mid line==" + d );
|
||||
// return new double[]{foot[0], foot[1], d};
|
||||
|
||||
int[] result = getCloseTwoPoint(closeStart, closeEnd, lon, lat, road);
|
||||
LonLatPoint start = road.get(result[0]);
|
||||
LonLatPoint end = road.get(result[1]);
|
||||
return getFootAndMinDistance(lon, lat, start.getLongitude(), start.getLatitude(), end.getLongitude(), end.getLatitude());
|
||||
}
|
||||
|
||||
private static int[] getCloseTwoPoint(int closeStart,int closeEnd, double lon, double lat, List< LonLatPoint > road ) {
|
||||
if ( closeEnd - closeStart == 1 ) {
|
||||
return new int[]{closeStart,closeEnd};
|
||||
/**
|
||||
* 获取距离目标点经纬度最近的道路点index
|
||||
* <p>
|
||||
* 采用二分查找思想,先用道路数据的起点和终点分别计算距离目标点的距离:
|
||||
* 若起点距离较远,则说明目标点在整条道路的后半段,则将起点后移至原起点和终点的中间,继续递归计算;
|
||||
* 同理,若终点距离较远,则目标点在前半段,则终点前移,继续递归计算;
|
||||
* 递归结束条件是起点index和终点index间隔是1;
|
||||
*
|
||||
* @param closeStart 距离目标点最近的起始点index
|
||||
* @param closeEnd 距离目标点最近的终点index
|
||||
* @param lon 目标点经度
|
||||
* @param lat 目标点纬度
|
||||
* @param road 目标道路
|
||||
* @return int[]{距离目标点最近的起始点index,距离目标点最近的终点index}
|
||||
*/
|
||||
private static int[] getCloseTwoPoint(int closeStart, int closeEnd, double lon, double lat, List<LonLatPoint> road) {
|
||||
if (closeEnd - closeStart == 1) {
|
||||
return new int[]{closeStart, closeEnd};
|
||||
}
|
||||
LonLatPoint start = road.get( closeStart );
|
||||
LonLatPoint end = road.get( closeEnd );
|
||||
float startDistance = CoordinateUtils.calculateLineDistance( start.getLongitude(), start.getLatitude(), lon, lat );
|
||||
float endDistance = CoordinateUtils.calculateLineDistance( end.getLongitude(), end.getLatitude(), lon, lat );
|
||||
if ( startDistance > endDistance ) {
|
||||
closeStart += ( closeEnd - closeStart ) / 2;
|
||||
LonLatPoint start = road.get(closeStart);
|
||||
LonLatPoint end = road.get(closeEnd);
|
||||
float startDistance = CoordinateUtils.calculateLineDistance(start.getLongitude(), start.getLatitude(), lon, lat);
|
||||
float endDistance = CoordinateUtils.calculateLineDistance(end.getLongitude(), end.getLatitude(), lon, lat);
|
||||
if (startDistance > endDistance) {
|
||||
closeStart += (closeEnd - closeStart) / 2;
|
||||
} else {
|
||||
closeEnd -= ( closeEnd - closeStart ) / 2;
|
||||
closeEnd -= (closeEnd - closeStart) / 2;
|
||||
}
|
||||
return getCloseTwoPoint(closeStart,closeEnd, lon, lat, road );
|
||||
return getCloseTwoPoint(closeStart, closeEnd, lon, lat, road);
|
||||
}
|
||||
|
||||
private static double[] getFoot( double lon, double lat, LonLatPoint beginPt, LonLatPoint endPt ) {
|
||||
double dx = beginPt.getLatitude() - endPt.getLatitude();
|
||||
double dy = beginPt.getLongitude() - endPt.getLongitude();
|
||||
|
||||
double u = ( lat - beginPt.getLatitude() ) * ( beginPt.getLatitude() - endPt.getLatitude() ) +
|
||||
( lon - beginPt.getLongitude() ) * ( beginPt.getLongitude() - endPt.getLongitude() );
|
||||
u = u / ( dx * dx + dy * dy );
|
||||
return new double[]{beginPt.getLongitude() + u * dy, beginPt.getLatitude() + u * dx};
|
||||
}
|
||||
|
||||
|
||||
// un minDistance(x: Double, y: Double, x1: Double, y1: Double, x2: Double, y2: Double): Double {
|
||||
// val cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1)
|
||||
// println("1.cross:$cross")
|
||||
// if (cross <= 0) {
|
||||
// return Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1))
|
||||
// }
|
||||
// val d2 = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)
|
||||
// println("2.d2:$cross")
|
||||
// if (cross > d2) {
|
||||
// return Math.sqrt((x - x2) * (x - x2) + (y - y2) * (y - y2))
|
||||
// }
|
||||
// val r = cross / d2
|
||||
// val px = x1 + (x2 - x1) * r
|
||||
// val py = y1 + (y2 - y1) * r
|
||||
// println("3.r:$r,px:$px,py:$py")
|
||||
// return Math.sqrt((x - px) * (x - px) + (py - y) * (py - y))
|
||||
// }
|
||||
|
||||
/**
|
||||
* 计算垂足以及最短距离
|
||||
*
|
||||
* @param x target point lon
|
||||
* @param y target point lat
|
||||
* @param x1 start point lon
|
||||
* @param y1 start point lat
|
||||
* @param x2 end point lon
|
||||
* @param y2 end point lat
|
||||
* @param x target point lon
|
||||
* @param y target point lat
|
||||
* @param x1 线段起点 lon
|
||||
* @param y1 起点起点 lat
|
||||
* @param x2 线段终点 lon
|
||||
* @param y2 线段终点 lat
|
||||
* @return double[]{footLon,footLat,minDistance} if(footLon == -1) => no foot or foot not in line
|
||||
*/
|
||||
private static double[] getFootAndMinDistance(double x, double y, double x1, double y1, double x2, double y2) {
|
||||
@@ -136,30 +122,17 @@ public class PointInterpolatorUtil {
|
||||
double cross = (x2 - x1) * (x - x1) + (y2 - y1) * (y - y1);
|
||||
if (cross < 0) {
|
||||
// 垂足没有在线段内,所以也无需计算最短距离
|
||||
// result[2] = Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));
|
||||
// Log.d("getFootAndMinDistance", "垂足不在线段内--1");
|
||||
return result;
|
||||
}
|
||||
double d2 = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
|
||||
if (cross > d2) {
|
||||
// 垂足没有在线段内,所以也无需计算最短距离
|
||||
// result[2] = Math.sqrt((x - x2) * (x - x2) + (y - y2) * (y - y2));
|
||||
// Log.d("getFootAndMinDistance", "垂足不在线段内--2");
|
||||
return result;
|
||||
}
|
||||
double r = cross / d2;
|
||||
result[0] = x1 + (x2 - x1) * r;
|
||||
result[1] = y1 + (y2 - y1) * r;
|
||||
// NumberFormat numberFormat = NumberFormat.getInstance();
|
||||
// numberFormat.setMaximumFractionDigits(4);
|
||||
// String formatNum = numberFormat.format(Math.sqrt((x - result[0]) * (x - result[0]) + (result[1] - y) * (result[1] - y)));
|
||||
// result[2] = Double.parseDouble(formatNum);
|
||||
result[2] = CoordinateUtils.calculateLineDistance(result[0], result[1], x, y);
|
||||
// Log.d("getFootAndMinDistance", "计算距离--lon: "+result[0]+" lat: "+result[1]+" dis: "+result[2]);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static double[] getMid( LonLatPoint start, LonLatPoint end ) {
|
||||
return new double[]{( start.getLongitude() + end.getLongitude() ) / 2, ( start.getLatitude() + end.getLatitude() ) / 2};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,20 +19,37 @@ public class V2XWarningEntity implements Serializable {
|
||||
//预测碰撞点位置
|
||||
private double collisionLat;
|
||||
private double collisionLon;
|
||||
//来源 ADAS/云端
|
||||
private int from;
|
||||
//朝向 角度
|
||||
private double angle;
|
||||
//方位 前 后 左 右
|
||||
private int direction;
|
||||
//速度
|
||||
private float speed;
|
||||
//停止线经纬度
|
||||
private double stopLineLat;
|
||||
private double stopLineLon;
|
||||
|
||||
//以下为自组字段
|
||||
//预警文案
|
||||
private String tipContent;
|
||||
//tts播报
|
||||
private String tts;
|
||||
//打点位置
|
||||
private MarkerLocation location;
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
if (location == null) {
|
||||
MarkerLocation location = new MarkerLocation();
|
||||
location.setLat(getLat());
|
||||
location.setLon(getLon());
|
||||
setLocation(location);
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
public void setTipContent(int type) {
|
||||
switch (type) {
|
||||
@@ -96,10 +113,6 @@ public class V2XWarningEntity implements Serializable {
|
||||
this.collisionLon = collisionLon;
|
||||
}
|
||||
|
||||
public void setFrom(int from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
@@ -137,9 +150,6 @@ public class V2XWarningEntity implements Serializable {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public int getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
@@ -167,6 +177,30 @@ public class V2XWarningEntity implements Serializable {
|
||||
return tts;
|
||||
}
|
||||
|
||||
public void setStopLineLat(double stopLineLat) {
|
||||
this.stopLineLat = stopLineLat;
|
||||
}
|
||||
|
||||
public void setStopLineLon(double stopLineLon) {
|
||||
this.stopLineLon = stopLineLon;
|
||||
}
|
||||
|
||||
public void setTipContent(String tipContent) {
|
||||
this.tipContent = tipContent;
|
||||
}
|
||||
|
||||
public void setTts(String tts) {
|
||||
this.tts = tts;
|
||||
}
|
||||
|
||||
public double getStopLineLat() {
|
||||
return stopLineLat;
|
||||
}
|
||||
|
||||
public double getStopLineLon() {
|
||||
return stopLineLon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XWarningEntity{" +
|
||||
@@ -176,12 +210,14 @@ public class V2XWarningEntity implements Serializable {
|
||||
", distance=" + distance +
|
||||
", collisionLat=" + collisionLat +
|
||||
", collisionLon=" + collisionLon +
|
||||
", from=" + from +
|
||||
", angle=" + angle +
|
||||
", direction=" + direction +
|
||||
", speed=" + speed +
|
||||
", stopLineLat=" + stopLineLat +
|
||||
", stopLineLon=" + stopLineLon +
|
||||
", tipContent='" + tipContent + '\'' +
|
||||
", tts='" + tts + '\'' +
|
||||
", location=" + location +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
BIN
modules/mogo-module-service/src/main/assets/LocParse$1.class
Normal file
BIN
modules/mogo-module-service/src/main/assets/LocParse$1.class
Normal file
Binary file not shown.
BIN
modules/mogo-module-service/src/main/assets/LocParse.class
Normal file
BIN
modules/mogo-module-service/src/main/assets/LocParse.class
Normal file
Binary file not shown.
15365
modules/mogo-module-service/src/main/assets/adas0.txt
Normal file
15365
modules/mogo-module-service/src/main/assets/adas0.txt
Normal file
File diff suppressed because it is too large
Load Diff
15315
modules/mogo-module-service/src/main/assets/adas1.txt
Normal file
15315
modules/mogo-module-service/src/main/assets/adas1.txt
Normal file
File diff suppressed because it is too large
Load Diff
15265
modules/mogo-module-service/src/main/assets/adas2.txt
Normal file
15265
modules/mogo-module-service/src/main/assets/adas2.txt
Normal file
File diff suppressed because it is too large
Load Diff
15215
modules/mogo-module-service/src/main/assets/adas3.txt
Normal file
15215
modules/mogo-module-service/src/main/assets/adas3.txt
Normal file
File diff suppressed because it is too large
Load Diff
15165
modules/mogo-module-service/src/main/assets/adas4.txt
Normal file
15165
modules/mogo-module-service/src/main/assets/adas4.txt
Normal file
File diff suppressed because it is too large
Load Diff
15115
modules/mogo-module-service/src/main/assets/adas5.txt
Normal file
15115
modules/mogo-module-service/src/main/assets/adas5.txt
Normal file
File diff suppressed because it is too large
Load Diff
15065
modules/mogo-module-service/src/main/assets/adas6.txt
Normal file
15065
modules/mogo-module-service/src/main/assets/adas6.txt
Normal file
File diff suppressed because it is too large
Load Diff
15015
modules/mogo-module-service/src/main/assets/adas7.txt
Normal file
15015
modules/mogo-module-service/src/main/assets/adas7.txt
Normal file
File diff suppressed because it is too large
Load Diff
14965
modules/mogo-module-service/src/main/assets/adas8.txt
Normal file
14965
modules/mogo-module-service/src/main/assets/adas8.txt
Normal file
File diff suppressed because it is too large
Load Diff
14915
modules/mogo-module-service/src/main/assets/adas9.txt
Normal file
14915
modules/mogo-module-service/src/main/assets/adas9.txt
Normal file
File diff suppressed because it is too large
Load Diff
15415
modules/mogo-module-service/src/main/assets/loc.txt
Normal file
15415
modules/mogo-module-service/src/main/assets/loc.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,14 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<!--adas数据-->
|
||||
<receiver android:name=".receiver.AdasDataBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.v2x.adas_data_broadcast" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".receiver.TestPanelBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.v2x.test_panel_control" />
|
||||
@@ -25,13 +33,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!--adas数据-->
|
||||
<receiver android:name=".receiver.AdasDataBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.v2x.adas_data_broadcast" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -37,6 +37,12 @@ public class MoGoV2XServicePaths {
|
||||
@Keep
|
||||
public static final String PATH_V2X_WARN_POLYLINE_MANAGER = "/v2xWarnPolylineManager/api";
|
||||
|
||||
/**
|
||||
* V2X 云端数据处理
|
||||
*/
|
||||
@Keep
|
||||
public static final String PATH_V2X_WARN_CLOUND_DATA_MANAGER = "/v2xWarnCloundDataManager/api";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -140,4 +140,9 @@ public class V2XConst {
|
||||
*/
|
||||
public static final String V2X_OPTIMAL_SPEED_MARKER = "V2X_OPTIMAL_SPEED_MARKER";
|
||||
|
||||
/*
|
||||
*V2X 车路云前方预警
|
||||
* */
|
||||
public static final String V2X_FRONT_WARNING_MARKER = "V2X_FRONT_WARNING_MARKER";
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.mogo.module.common.utils.Const;
|
||||
import com.mogo.module.v2x.entity.net.V2XSeekHelpRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XStrategyPushRes;
|
||||
import com.mogo.module.v2x.network.V2XRefreshCallback;
|
||||
import com.mogo.module.v2x.receiver.AdasDataBroadcastReceiver;
|
||||
import com.mogo.module.v2x.receiver.SceneBroadcastReceiver;
|
||||
import com.mogo.module.v2x.scenario.impl.V2XScenarioManager;
|
||||
import com.mogo.module.v2x.scenario.scene.livecar.V2XVoiceCallLiveBiz;
|
||||
@@ -302,6 +303,9 @@ public class V2XModuleProvider implements
|
||||
V2XServiceManager.getV2XMarkerService().startAutoRefresh();
|
||||
// 锁车就是将地图视图移植中心点,因为行驶中的车和地图要相对的跟随
|
||||
V2XServiceManager.getMapUIController().recoverLockMode();
|
||||
Log.d("liyz", "V2XModuleProvider ------> ");
|
||||
//注册adas数据通道
|
||||
V2XWaringManager.getInstance().registerAdasSocketMessage(mContext);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.v2x;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -15,10 +16,12 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.v2x.alarm.V2XCalculateServer;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XCloundDataManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XMarkerManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XPolylineManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.module.v2x.manager.IMoGoWarnPolylineManager;
|
||||
import com.mogo.module.v2x.manager.impl.MoGoV2XCloundDataManager;
|
||||
import com.mogo.module.v2x.network.V2XRefreshModel;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
@@ -109,9 +112,7 @@ public class V2XServiceManager {
|
||||
private static IMoGoV2XPolylineManager moGoV2XPolylineManager;
|
||||
private static IMoGoV2XStatusManager moGoV2XStatusManager;
|
||||
private static IMoGoWarnPolylineManager moGoWarnPolylineManager;
|
||||
|
||||
List<ADASRecognizedResult> resultList = new ArrayList<>();
|
||||
|
||||
private static IMoGoV2XCloundDataManager moGoV2XCloundDataManager;
|
||||
|
||||
private V2XServiceManager() {
|
||||
|
||||
@@ -165,36 +166,9 @@ public class V2XServiceManager {
|
||||
moGoV2XMarkerManager = (IMoGoV2XMarkerManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_MARKER_MANAGER).navigation(context);
|
||||
moGoV2XPolylineManager = (IMoGoV2XPolylineManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_POLYLINE_MANAGER).navigation(context);
|
||||
moGoWarnPolylineManager = (IMoGoWarnPolylineManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_WARN_POLYLINE_MANAGER).navigation(context);
|
||||
moGoV2XCloundDataManager = (IMoGoV2XCloundDataManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_WARN_CLOUND_DATA_MANAGER).navigation(context);
|
||||
|
||||
moGoV2XStatusManager = (IMoGoV2XStatusManager) ARouter.getInstance().build(MoGoV2XServicePaths.PATH_V2X_STATUS_MANAGER).navigation(context);
|
||||
|
||||
List<MogoLatLng> lonLats = new ArrayList<>();
|
||||
|
||||
// adas 每隔一秒传递的他车或行人数据
|
||||
mIMogoADASController.addAdasRecognizedDataCallback(resultList -> {
|
||||
// 绘制近景识别到的车辆,行人和二轮车 TODO
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
|
||||
//清理
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
|
||||
// 绘制连接线 TODO 来的是列表数据
|
||||
// V2XServiceManager.getMoGoWarnPolylineManager().drawableWarnPolyline(context, roadEventEntity);
|
||||
|
||||
//更新数据
|
||||
for (ADASRecognizedResult result : resultList) {
|
||||
MogoLatLng latLng = new MogoLatLng(result.lat, result.lon);
|
||||
lonLats.add(latLng);
|
||||
}
|
||||
|
||||
IMogoPolyline mMogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
mMogoPolyline.setPoints(lonLats);
|
||||
|
||||
} );
|
||||
|
||||
//绘制自车数据 liyz
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,4 +323,20 @@ public class V2XServiceManager {
|
||||
public static IEventPanelProvider getEventPanelProvider() {
|
||||
return mIEventPanelProvider;
|
||||
}
|
||||
|
||||
public static IMogoADASController getmIMogoADASController() {
|
||||
return mIMogoADASController;
|
||||
}
|
||||
|
||||
public static void setmIMogoADASController(IMogoADASController mIMogoADASController) {
|
||||
V2XServiceManager.mIMogoADASController = mIMogoADASController;
|
||||
}
|
||||
|
||||
public static IMoGoV2XCloundDataManager getMoGoV2XCloundDataManager() {
|
||||
return moGoV2XCloundDataManager;
|
||||
}
|
||||
|
||||
public static void setMoGoV2XCloundDataManager(IMoGoV2XCloundDataManager moGoV2XCloundDataManager) {
|
||||
V2XServiceManager.moGoV2XCloundDataManager = moGoV2XCloundDataManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.mogo.module.v2x;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.listener.V2XMessageListener_401011;
|
||||
import com.mogo.module.v2x.listener.V2XWarnMessageListener;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
* desc : V2X报警事件管理,这里进行报警事件的分发处理,包括了adas数据
|
||||
*/
|
||||
public class V2XWaringManager {
|
||||
|
||||
List<MogoLatLng> lonLats = new ArrayList<>();
|
||||
List<ADASRecognizedResult> resultList = new ArrayList<>();
|
||||
private Context mContext;
|
||||
|
||||
private static V2XWaringManager mV2XWaringManager;
|
||||
//TODO 需要修改
|
||||
private V2XWarnMessageListener v2XWarnMessageListener;
|
||||
|
||||
|
||||
private V2XWaringManager() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取操作实体
|
||||
*/
|
||||
public static synchronized V2XWaringManager getInstance() {
|
||||
synchronized (V2XWaringManager.class) {
|
||||
if (mV2XWaringManager == null) {
|
||||
mV2XWaringManager = new V2XWaringManager();
|
||||
}
|
||||
}
|
||||
return mV2XWaringManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册长链接消息处理
|
||||
*/
|
||||
public void registerAdasSocketMessage(Context context) {
|
||||
Logger.d("liyz", "开始注册Socket通道....");
|
||||
mContext = context;
|
||||
|
||||
//根据云端,绘制自车和交点,以及行人或二轮车与交点的绘制
|
||||
registerWarnListener();
|
||||
|
||||
handleAdasData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 反注册消息通道,不再进行接受
|
||||
*/
|
||||
public void unregisterAdasSocketMessage() {
|
||||
Logger.w("liyz", "反注册Socket通道....");
|
||||
if (v2XWarnMessageListener != null) {
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.unregisterOnMessageListener(401011, v2XWarnMessageListener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 道路事件,行人 TODO type
|
||||
*/
|
||||
private void registerWarnListener() {
|
||||
v2XWarnMessageListener = new V2XWarnMessageListener();
|
||||
// 道路事件,在线车辆绘制
|
||||
V2XServiceManager
|
||||
.getMoGoSocketManager()
|
||||
.registerOnMessageListener(
|
||||
401011,
|
||||
v2XWarnMessageListener );
|
||||
}
|
||||
|
||||
public V2XWarnMessageListener getV2XMessageListener() {
|
||||
return v2XWarnMessageListener;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 处理adas返回的数据
|
||||
*/
|
||||
private void handleAdasData() {
|
||||
Log.d("liyz", "V2XWaringManager ---- handleAdasData ---0-- ");
|
||||
//清理
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
|
||||
// 绘制连接线 TODO 来的是列表数据
|
||||
DrawLineInfo info1 = new DrawLineInfo();
|
||||
MogoLatLng startLatlng1 = new MogoLatLng(39.968919,116.407642);
|
||||
MogoLatLng endLatlng1 = new MogoLatLng(40.010906,116.423821);
|
||||
info1.setStartLocation(startLatlng1);
|
||||
info1.setEndLocation(endLatlng1);
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawableWarnPolyline(getContext(), info1);
|
||||
|
||||
// adas 每隔一秒传递的他车或行人数据
|
||||
V2XServiceManager.getmIMogoADASController().addAdasRecognizedDataCallback(resultList -> {
|
||||
// 绘制近景识别到的车辆,行人和二轮车 TODO
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
Log.d("liyz", "V2XWaringManager ---- handleAdasData ----- ");
|
||||
|
||||
//清理
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
|
||||
// 绘制连接线 TODO 来的是列表数据
|
||||
DrawLineInfo info = new DrawLineInfo();
|
||||
MogoLatLng startLatlng = new MogoLatLng(39.969247,116.407299);
|
||||
MogoLatLng endLatlng = new MogoLatLng(39.971089,116.407384);
|
||||
info.setStartLocation(startLatlng);
|
||||
info.setEndLocation(endLatlng);
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawableWarnPolyline(mContext, info);
|
||||
|
||||
//更新数据
|
||||
for (ADASRecognizedResult result : resultList) {
|
||||
MogoLatLng latLng = new MogoLatLng(result.lat, result.lon);
|
||||
lonLats.add(latLng);
|
||||
}
|
||||
IMogoPolyline mMogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
mMogoPolyline.setPoints(lonLats);
|
||||
|
||||
} );
|
||||
|
||||
double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
|
||||
double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
|
||||
Log.d("liyz", "lon = " + lon + "----lat = " + lat);
|
||||
|
||||
//绘制自车数据 liyz
|
||||
// DrawLineInfo info = new DrawLineInfo();
|
||||
// MogoLatLng startLatlng = new MogoLatLng(lat,lon); //我的位置
|
||||
// MogoLatLng endLatlng = new MogoLatLng(39.971089,); //交点位置
|
||||
// info.setStartLocation(startLatlng);
|
||||
// info.setEndLocation(endLatlng);
|
||||
// V2XServiceManager.getMoGoWarnPolylineManager().drawableWarnPolyline(mContext, info);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.mogo.module.v2x.entity.model;
|
||||
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description 云端警告下发数据(二轮车和弱势群体)
|
||||
* @since 2021/3/30
|
||||
*/
|
||||
public class CloundWarningInfo {
|
||||
|
||||
/**
|
||||
* 识别物体类型
|
||||
*/
|
||||
public int type;
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*/
|
||||
public String warningContent;
|
||||
|
||||
/**
|
||||
* 道路唯一标识
|
||||
*/
|
||||
public String roadId;
|
||||
|
||||
/**
|
||||
* 车道唯一标识
|
||||
*/
|
||||
public String laneId;
|
||||
|
||||
/**
|
||||
* 识别物体唯一标识
|
||||
*/
|
||||
public String uuid;
|
||||
|
||||
/**
|
||||
* 红绿灯颜色
|
||||
*/
|
||||
public String color;
|
||||
|
||||
/**
|
||||
* 车ID 暂不使用
|
||||
*/
|
||||
public String carId;
|
||||
|
||||
/**
|
||||
* 识别物体的纬度
|
||||
*/
|
||||
public double lat;
|
||||
|
||||
/**
|
||||
* 识别物体的经度
|
||||
*/
|
||||
public double lon;
|
||||
|
||||
/**
|
||||
* 识别物经纬度
|
||||
* */
|
||||
private MogoLatLng startLocation;
|
||||
|
||||
/**
|
||||
* 行人经纬度交点
|
||||
*/
|
||||
private MogoLatLng endLocation;
|
||||
|
||||
/**
|
||||
* 停止线的纬度
|
||||
*/
|
||||
public double stopLinelat;
|
||||
|
||||
/**
|
||||
* 停止线的经度
|
||||
*/
|
||||
public double stopLinelon;
|
||||
|
||||
/**
|
||||
* 车头朝向
|
||||
*/
|
||||
public double heading;
|
||||
|
||||
/**
|
||||
* 系统时间 暂时没用
|
||||
*/
|
||||
public long systemTime;
|
||||
|
||||
/**
|
||||
* 定位卫星时间 暂时没用
|
||||
*/
|
||||
public long satelliteTime;
|
||||
|
||||
/**
|
||||
* 速度 暂时没用
|
||||
*/
|
||||
public double speed;
|
||||
|
||||
/**
|
||||
* 莫顿码 暂时没用
|
||||
*/
|
||||
public long mortonCode;
|
||||
|
||||
/**
|
||||
* 停车线距离
|
||||
*/
|
||||
public double distance;
|
||||
|
||||
}
|
||||
@@ -18,6 +18,8 @@ public class DrawLineInfo {
|
||||
//结束点位置
|
||||
private MogoLatLng endLocation;
|
||||
|
||||
private double heading;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@@ -41,4 +43,12 @@ public class DrawLineInfo {
|
||||
public void setEndLocation(MogoLatLng endLocation) {
|
||||
this.endLocation = endLocation;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.mogo.module.v2x.listener;
|
||||
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.model.CloundWarningInfo;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
|
||||
/**
|
||||
* desc: 下发的云端预警数据
|
||||
*/
|
||||
public class V2XWarnMessageListener implements IMogoOnMessageListener<CloundWarningInfo> {
|
||||
|
||||
@Override
|
||||
public Class<CloundWarningInfo> target() {
|
||||
return CloundWarningInfo.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(CloundWarningInfo info) {
|
||||
//Logger.d(MODULE_NAME, "V2XMessageListener_401011==V2X地图气泡数据刷新:\n" + GsonUtil.jsonFromObject(response));
|
||||
V2XUtils.runOnBackgroundThread(() -> {
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
if (info != null) {
|
||||
// 解析存储道路事件 liyz
|
||||
V2XServiceManager.getMoGoV2XCloundDataManager().analysisV2XCloundDataEvent(info);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mogo.module.v2x.manager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.module.v2x.entity.model.CloundWarningInfo;
|
||||
|
||||
/**
|
||||
* desc: V2X 处理云端预警消息
|
||||
*/
|
||||
public interface IMoGoV2XCloundDataManager extends IProvider {
|
||||
|
||||
/**
|
||||
* 处理下发数据
|
||||
*/
|
||||
void analysisV2XCloundDataEvent(CloundWarningInfo cloundWarningInfo);
|
||||
|
||||
/**
|
||||
* 清除 所有的 POI
|
||||
*/
|
||||
void clearALLPOI();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mogo.module.v2x.manager.impl;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.v2x.MoGoV2XServicePaths;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.model.CloundWarningInfo;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XCloundDataManager;
|
||||
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
* desc : V2X 服务端下发数据处理 点的绘制
|
||||
*/
|
||||
@Route(path = MoGoV2XServicePaths.PATH_V2X_WARN_CLOUND_DATA_MANAGER)
|
||||
public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager {
|
||||
private static final String TAG = "MoGoV2XCloundDataManager";
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void analysisV2XCloundDataEvent(CloundWarningInfo cloundWarningInfo) {
|
||||
//TODO
|
||||
//清理
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
|
||||
//绘制连接线自车与交汇点连线
|
||||
DrawLineInfo info1 = new DrawLineInfo();
|
||||
MogoLatLng startLatlng1 = new MogoLatLng(39.968919,116.407642);
|
||||
MogoLatLng endLatlng1 = new MogoLatLng(40.010906,116.423821);
|
||||
info1.setStartLocation(startLatlng1);
|
||||
info1.setEndLocation(endLatlng1);
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawableWarnPolyline(getContext(), info1);
|
||||
|
||||
//绘制识别物与交汇点连线 TODO
|
||||
|
||||
|
||||
//更新数据连线数据 他车和自车
|
||||
|
||||
|
||||
//自车的移动
|
||||
|
||||
|
||||
//他车的移动
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearALLPOI() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.v2x.manager.impl;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -22,7 +23,6 @@ import java.util.List;
|
||||
*/
|
||||
@Route(path = MoGoV2XServicePaths.PATH_V2X_WARN_POLYLINE_MANAGER)
|
||||
public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
|
||||
private static final String TAG = "MoGoWarnPolylineManager";
|
||||
private static IMogoPolyline mMogoPolyline;
|
||||
|
||||
|
||||
@@ -48,16 +48,15 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
|
||||
}
|
||||
|
||||
// 线条粗细,渐变,渐变色值
|
||||
options.width(30).useGradient(true).colorValues(colors);
|
||||
|
||||
options.width(60).useGradient(true).colorValues(colors);
|
||||
// 当前车辆位置
|
||||
options.add(info.getStartLocation());
|
||||
|
||||
// 目标车辆位置
|
||||
options.add(info.getStartLocation());
|
||||
options.add(info.getEndLocation());
|
||||
|
||||
// 绘制线的对象
|
||||
mMogoPolyline = V2XServiceManager.getMogoOverlayManager().addPolyline(options);
|
||||
Log.d("liyz", "MoGoWarnPolylineManager drawableWarnPolyline -----> ");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.mogo.module.v2x.receiver;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XWaringManager;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -17,10 +19,11 @@ public class AdasDataBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
try {
|
||||
ADASRecognizedResult adasResult = (ADASRecognizedResult) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
|
||||
Logger.d("AdasDataBroadcastReceiver", "adasResult:" + GsonUtil.jsonFromObject(adasResult));
|
||||
|
||||
// V2XScenarioManager.getInstance().handlerMessage(adasResult);
|
||||
// ADASRecognizedResult adasResult = (ADASRecognizedResult) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
|
||||
// Logger.d("liyz", "AdasDataBroadcastReceiver -->" + GsonUtil.jsonFromObject(adasResult));
|
||||
String adasResult = (String) intent.getSerializableExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY);
|
||||
Log.d("liyz", "AdasDataBroadcastReceiver -----> ");
|
||||
V2XWaringManager.getInstance().registerAdasSocketMessage(context);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.v2x.receiver;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
@@ -24,6 +25,7 @@ public class SceneBroadcastReceiver extends BroadcastReceiver {
|
||||
try {
|
||||
V2XMessageEntity v2XMessageEntity = (V2XMessageEntity) intent.getSerializableExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY);
|
||||
//Logger.d(TAG, "v2XMessageEntity:" + GsonUtil.jsonFromObject(v2XMessageEntity));
|
||||
Log.d("liyz", "SceneBroadcastReceiver ------->");
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -66,6 +66,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
private Button mBtnTriggerTrafficSearch;
|
||||
private Button mBtnTriggerRecommendRouteEvent;
|
||||
private ToggleButton nBtnTriggerVR;
|
||||
private Button mBtnAdasDataWarn;
|
||||
|
||||
private Button btnTriggerRearVIPCarTip,
|
||||
btnTriggerVehicleBrakes,
|
||||
@@ -129,6 +130,7 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
mBtnTriggerTrafficSearch = findViewById(R.id.btnTriggerTrafficSearch);
|
||||
mBtnTriggerRecommendRouteEvent = findViewById(R.id.btnTriggerRecommendRouteEvent);
|
||||
nBtnTriggerVR = findViewById(R.id.btnTriggerVR);
|
||||
mBtnAdasDataWarn = findViewById(R.id.btnAdasDataWarn);
|
||||
|
||||
switch (showType) {
|
||||
case 0:
|
||||
@@ -301,6 +303,12 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
|
||||
});
|
||||
|
||||
mBtnAdasDataWarn.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_ADAS_SCENE_HANDLER_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_ADAS_EXTRA_KEY, "23");
|
||||
getContext().sendBroadcast(intent);
|
||||
});
|
||||
|
||||
mBtnTriggerTrafficSearch.setOnClickListener(v -> V2XServiceManager.getIMogoTrafficUploadProvider().verifyCurrentTrafficStatus());
|
||||
|
||||
mBtnTriggerRecommendRouteEvent.setOnClickListener(view -> {
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPoiTypeEnum;
|
||||
@@ -44,6 +45,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
|
||||
|
||||
public V2XFrontWarningScenario() {
|
||||
setV2XWindow(new V2XWarningWindow());
|
||||
setV2XMarker(new V2XWarningMarker());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,6 +56,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
|
||||
direction = mMarkerEntity.getDirection();
|
||||
MarkerServiceHandler.getApis().getV2XListenerManager().warningChangedForListenerWithDirection(direction, MogoReceiver.ACTION_V2X_FRONT_WARNING);
|
||||
show();
|
||||
drawPOI();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -78,6 +81,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
|
||||
.getMogoTopViewManager()
|
||||
.addView(getV2XWindow().getView(), layoutParams, this);
|
||||
getV2XWindow().show(mMarkerEntity);
|
||||
getV2XMarker().drawPOI(mMarkerEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +102,8 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMogoTopV
|
||||
|
||||
@Override
|
||||
public void drawPOI() {
|
||||
|
||||
getV2XMarker().drawPOI(mMarkerEntity);
|
||||
Log.d(TAG, "drawPOI");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.mogo.module.v2x.scenario.scene.warning;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 描述
|
||||
* @since: 2021/3/30
|
||||
*/
|
||||
public class V2XWarningMarker implements IV2XMarker {
|
||||
private V2XWarningEntity mMarkerEntity;
|
||||
private Context mContext = V2XServiceManager.getContext();
|
||||
|
||||
@Override
|
||||
public void drawPOI(Object entity) {
|
||||
try {
|
||||
mMarkerEntity = (V2XWarningEntity) entity;
|
||||
MarkerLocation location = new MarkerLocation();
|
||||
location.setLat(mMarkerEntity.getLat());
|
||||
location.setLon(mMarkerEntity.getLon());
|
||||
|
||||
MarkerShowEntity markerShowEntity = new MarkerShowEntity();
|
||||
markerShowEntity.setMarkerLocation(location);
|
||||
markerShowEntity.setMarkerType(V2XConst.V2X_FRONT_WARNING_MARKER);
|
||||
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
V2XServiceManager.getMarkerManager().removeMarkers(V2XConst.V2X_FRONT_WARNING_MARKER);
|
||||
WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
Bitmap bitmap = BitmapFactory.decodeResource(AbsMogoApplication.getApp().getResources(), R.drawable.v2x_road_front_p_warning);
|
||||
options.icon(bitmap);
|
||||
IMogoMarker marker = V2XServiceManager.getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
marker.setToTop();
|
||||
}, 1000);
|
||||
} else {
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearPOI() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.mogo.module.v2x.utils;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -172,7 +175,6 @@ public class TestOnLineCarUtils {
|
||||
|
||||
// 加载数据源
|
||||
V2XWarningEntity warningEntity = GsonUtil.objectFromJson(baos.toString(), V2XWarningEntity.class);
|
||||
|
||||
V2XMessageEntity<V2XWarningEntity> v2xMessageEntity = new V2XMessageEntity<>();
|
||||
// 控制类型
|
||||
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_CRASH_WARNING_TOP);
|
||||
|
||||
@@ -461,7 +461,22 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnAdasDataWarn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="#8BC34A"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:text="adas预警数据发送"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_22"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"type":0,
|
||||
"targetType": "1",
|
||||
"lat":39.9760799115428,
|
||||
"lon":116.411360351446,
|
||||
"lat":39.977121,
|
||||
"lon":116.417537,
|
||||
"distance": 2.22,
|
||||
"collisionLat": 39.9760799115429,
|
||||
"collisionLon": 116.411360351446,
|
||||
|
||||
@@ -16,6 +16,10 @@ class RemoteControlAutoPilotParameters {
|
||||
public AutoPilotLonLat endLatLon;
|
||||
public float speedLimit;
|
||||
public int vehicleType;// 运营类型
|
||||
/**
|
||||
* 是否播放adas的 开始自动驾驶 语音
|
||||
*/
|
||||
public boolean isSpeakVoice = true;
|
||||
|
||||
public static class AutoPilotLonLat {
|
||||
public double lat;
|
||||
|
||||
Reference in New Issue
Block a user