diff --git a/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml b/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml index d9833a54ed..548ae4505e 100644 --- a/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml +++ b/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_base_fragment.xml @@ -100,7 +100,7 @@ android:layout_marginTop="@dimen/dp_27" app:roundLayoutRadius="@dimen/dp_16" > - target = new CustomTarget() { @@ -60,7 +65,7 @@ public class SweeperVideoView extends AppCompatImageView implements IMoGoSweeper public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { //回调内容 if (!resource.isRecycled()) { - SweeperVideoView.this.setImageBitmap(resource); + MogoVideoView.this.setImageBitmap(resource); } } @@ -70,18 +75,28 @@ public class SweeperVideoView extends AppCompatImageView implements IMoGoSweeper } }; - @Override - public void onSweeperFutianBackCameraVideo(@NonNull byte[] data) { + private void draw(@NonNull byte[] data) { ThreadUtils.runOnUiThread(new Runnable() { @Override public void run() { - GlideApp.with(SweeperVideoView.this) + GlideApp.with(MogoVideoView.this) .asBitmap() .load(data) - .placeholder(SweeperVideoView.this.getDrawable()) + .placeholder(MogoVideoView.this.getDrawable()) .apply(requestOptions) .into(target); } }); } + + @Override + public void onSweeperFutianBackCameraVideo(@NonNull byte[] data) { + draw(data); + } + + @Override + public void onRoboBusJinlvM1StitchedVideo(@NonNull byte[] data) { + draw(data); + } + } diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt index 03509c9813..6292b53abc 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt @@ -367,6 +367,12 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { */ fun setIsDrawPointCloud(isDrawPointCloud: Boolean) + /** + * 设置M1拼接视频接口订阅 + * @param isSubscribe 是否订阅 + */ + fun setIsSubscribeM1StitchedVideo(isSubscribe: Boolean) + fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean fun sendRoboBusJinlvM1AirConditionerCmd( diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StitchedVideoListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StitchedVideoListener.kt new file mode 100644 index 0000000000..701b364821 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoRoboBusJinlvM1StitchedVideoListener.kt @@ -0,0 +1,11 @@ +package com.mogo.eagle.core.function.api.autopilot + +/** + * M1拼接视频 10Hz + */ +interface IMoGoRoboBusJinlvM1StitchedVideoListener { + /** + * 金旅M1拼接视频数据 10Hz 每一帧为一张图片 + */ + fun onRoboBusJinlvM1StitchedVideo(data: ByteArray) +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt index 02d52f2a61..ac9d0f4e5d 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt @@ -511,6 +511,14 @@ object CallerAutoPilotControlManager { providerApi?.setIsDrawPointCloud(isDrawPointCloud) } + /** + * 设置M1拼接视频接口订阅 + * @param isSubscribe 是否订阅 + */ + fun setIsSubscribeM1StitchedVideo(isSubscribe: Boolean) { + providerApi?.setIsSubscribeM1StitchedVideo(isSubscribe) + } + fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean { return providerApi?.sendRoboBusJinlvM1FrontDoorCmd(switchCmd) ?: false } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerRoboBusJinlvM1StitchedVideoListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerRoboBusJinlvM1StitchedVideoListenerManager.kt new file mode 100644 index 0000000000..7b40b6ffb5 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerRoboBusJinlvM1StitchedVideoListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.autopilot + +import com.mogo.eagle.core.function.api.autopilot.IMoGoRoboBusJinlvM1StitchedVideoListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 清扫车(福田)后摄像头视频数据 + */ +object CallerRoboBusJinlvM1StitchedVideoListenerManager : CallerBase() { + + /** + * 后摄像头视频数据 + */ + fun invokeRoboBusJinlvM1StitchedVideo(data: ByteArray) { + M_LISTENERS.forEach { + val listener = it.value + listener.onRoboBusJinlvM1StitchedVideo(data) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSweeperFutianBackCameraVideoListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSweeperFutianBackCameraVideoListenerManager.kt index 95d2dde9e8..ecf3d4dbff 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSweeperFutianBackCameraVideoListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerSweeperFutianBackCameraVideoListenerManager.kt @@ -1,9 +1,6 @@ package com.mogo.eagle.core.function.call.autopilot -import chassis.ChassisStatesOuterClass -import chassis.VehicleStateOuterClass import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianBackCameraVideoListener -import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener import com.mogo.eagle.core.function.call.base.CallerBase /**