[change]相工控机发送红绿灯接口添加时间字段

This commit is contained in:
xinfengkun
2022-06-13 17:25:00 +08:00
parent 3f72e395ef
commit e20f9f21d3
6 changed files with 12 additions and 6 deletions

View File

@@ -1115,7 +1115,7 @@ public class MainActivity extends BaseActivity implements OnAdasListener, OnAdas
.setMid(mid)
.setRight(right)
.build();
AdasManager.getInstance().sendTrafficLightData("10038", 26.848153, 112.574883, "180.0", "SN", 100413, -4, 201, 0, detail);
AdasManager.getInstance().sendTrafficLightData("10038", 26.848153, 112.574883, "180.0", "SN", 100413, -4, 201, 0, detail, System.currentTimeMillis());
break;
case 7:
//速度设置

View File

@@ -259,7 +259,8 @@ class MoGoAutopilotProvider :
trafficLightResult.laneNo,
trafficLightResult.arrowNo,
trafficLightResult.flashYellow,
trafficLightResult.toTrafficLightDetail()
trafficLightResult.toTrafficLightDetail(),
0
)
}

View File

@@ -298,6 +298,7 @@ message TrafficLightData
int32 arrowNo = 8; //当前车道对应地面要素转向
int32 flashYellow = 9; //黄灯总时间
TrafficLightDetail laneDetail = 10; //灯态具体信息
uint64 timestamp =11;//当前卫星时间, 单位: ms
}
// message definition for MsgTypeWarn

View File

@@ -794,12 +794,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
* @param arrowNo 当前车道对应地面要素转向
* @param flashYellow 黄灯总时间
* @param laneDetail 灯态具体信息
* @param timestamp 当前卫星时间, 单位: ms
* @return
*/
@Override
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude,
@NonNull String heading, @NonNull String direction, int lightId, int laneNo,
int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail) {
int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp) {
if (crossID == null) {
crossID = "";
}
@@ -821,6 +822,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
builder.setFlashYellow(flashYellow);
if (laneDetail != null)
builder.setLaneDetail(laneDetail);
builder.setTimestamp(timestamp);
MessagePad.TrafficLightData req = builder.build();
return sendWsMessage(MessageType.TYPE_SEND_TRAFFIC_LIGHT_DATA.typeCode, req.toByteArray());
}

View File

@@ -365,11 +365,12 @@ public class AdasManager implements IAdasNetCommApi {
* @param arrowNo 当前车道对应地面要素转向
* @param flashYellow 黄灯总时间
* @param laneDetail 灯态具体信息
* @param timestamp 当前卫星时间, 单位: ms
* @return
*/
@Override
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude, @NonNull String heading, @NonNull String direction, int lightId, int laneNo, int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail) {
return mChannel != null && mChannel.sendTrafficLightData(crossID, latitude, longitude, heading, direction, lightId, laneNo, arrowNo, flashYellow, laneDetail);
public boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude, @NonNull String heading, @NonNull String direction, int lightId, int laneNo, int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp) {
return mChannel != null && mChannel.sendTrafficLightData(crossID, latitude, longitude, heading, direction, lightId, laneNo, arrowNo, flashYellow, laneDetail, timestamp);
}
/**

View File

@@ -157,11 +157,12 @@ public interface IAdasNetCommApi {
* @param arrowNo 当前车道对应地面要素转向
* @param flashYellow 黄灯总时间
* @param laneDetail 灯态具体信息
* @param timestamp 当前卫星时间, 单位: ms
* @return boolean
*/
boolean sendTrafficLightData(@NonNull String crossID, double latitude, double longitude,
@NonNull String heading, @NonNull String direction, int lightId, int laneNo,
int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail);
int arrowNo, int flashYellow, MessagePad.TrafficLightDetail laneDetail, long timestamp);
/**
* 自动驾驶路径请求