Merge branch 'dev_robotaxi-d-app-module_290_220715_2.9.0' into 'test_robotaxi-d-app-module_290_220715_2.9.0.1'
Dev robotaxi d app module 290 220715 2.9.0 See merge request zhjt/AndroidApp/MoGoEagleEye!85
This commit is contained in:
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_CAR_STATE
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
|
||||
@@ -374,14 +375,19 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
}
|
||||
}
|
||||
|
||||
//状态查询应答
|
||||
// @ChainLog(
|
||||
// linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
// linkCode = CHAIN_LINK_ADAS,
|
||||
// endpoint = PAD,
|
||||
// nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP,
|
||||
// paramIndexes = [0, 1],
|
||||
// clientPkFileName = "sn"
|
||||
// )
|
||||
override fun onStatusQueryResp(
|
||||
header: MessagePad.Header?,
|
||||
statusInfo: SystemStatusInfo.StatusInfo?
|
||||
) {
|
||||
//状态查询应答
|
||||
statusInfo?.let {
|
||||
Log.d(TAG, GsonUtil.jsonFromObject(it))
|
||||
}
|
||||
invokeAutopilotStatusRespByQuery(statusInfo)
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ public class TapPositionView extends ConstraintLayout {
|
||||
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
Log.d(TAG, "2");
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_tap_position, this);
|
||||
tabP = findViewById(R.id.tap_p);
|
||||
tabR = findViewById(R.id.tap_r);
|
||||
@@ -48,7 +47,6 @@ public class TapPositionView extends ConstraintLayout {
|
||||
if (tabP != null && tabR != null && tabN != null && tabD != null) {
|
||||
int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1);
|
||||
int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1);
|
||||
Log.d(TAG, "gear:" + gear);
|
||||
switch (gear) {
|
||||
case GEAR_NONE:
|
||||
tabP.setTextColor(defaultColor);
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateList
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -76,7 +77,9 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
if(lightSwitch != null){
|
||||
CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +88,7 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车灯:" + brakeLight);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,18 +97,11 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
Log.d(TAG, "steering原始值====" + String.valueOf(steering));
|
||||
CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering);
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "steering忽略小数点后====" + String.valueOf((int) steeringValue));
|
||||
}
|
||||
});
|
||||
|
||||
CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,16 +110,12 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "司机屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString());
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,30 +125,36 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
|
||||
@Override
|
||||
public void onAutopilotAcc(float carAcc) {
|
||||
Log.d(TAG, "司机屏加速度:" + carAcc);
|
||||
java.text.DecimalFormat myformat = new java.text.DecimalFormat("0.00");
|
||||
String accStr = myformat.format(carAcc);
|
||||
accTextView.setText("a: " + String.valueOf(accStr));
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏加速度:" + carAcc);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
java.text.DecimalFormat mFormat = new java.text.DecimalFormat("0.00");
|
||||
String accStr = mFormat.format(carAcc);
|
||||
accTextView.setText("a: " + accStr);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
Log.d(TAG, "刹车:" + String.valueOf(brake));
|
||||
if (brake > 0){
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
}else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车:" + brake);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (brake > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
} else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
Log.d(TAG, "油门:" + String.valueOf(throttle));
|
||||
if (throttle > 0){
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
|
||||
}else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "油门:" + throttle);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (throttle > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
|
||||
} else {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -42,6 +42,7 @@ class ChainConstant {
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE = "PAD_ADAS_MESSAGE_AUTOPILOT_VEHICLE"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_TRAFFIC_LIGHT = "PAD_ADAS_MESSAGE_AUTOPILOT_TRAFFIC_LIGHT"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP = "CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN = "PAD_ADAS_MESSAGE_AUTOPILOT_WARN"
|
||||
|
||||
const val CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL = "CHAIN_ALIAS_CODE_CLOUD_CONNECT_FAIL"
|
||||
|
||||
@@ -506,7 +506,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
|
||||
if (checkAMapView()) {
|
||||
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -813,16 +815,18 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
mMapLoaded = true;
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
Trace.endSection();
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
loadPreVehicleModel();
|
||||
if (checkAMapView()) {
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
MogoMapListenerHandler.getInstance().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
Trace.endSection();
|
||||
initMapView();
|
||||
initMyLocation();
|
||||
loadPreVehicleModel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1039,7 +1043,9 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
mMapView.getMapAutoViewHelper().setMapDAngle(angle);
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setMapDAngle(angle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user