首页 / 浏览问题 / 移动GIS / 问题详情
终端使用后台传输的规划路径进行导航
9EXP 2021年06月02日
您好,在开发andorid APP的过程中,需要使用后台规划好的指定路径进行导航。麻烦问下,收到后台发送的轨迹点后,应该如何进行操作才能实现导航功能

1个回答

您好,实现思路如下:
1.先获取到轨迹点,然后通过GeoLine的构造方法将点数据构成线数据,这步可以根据道路名称来构造不同的线对象,然后将线对象追加到线数据集中。
2.使用 NetworkBuilder.buildNetwork方法构造网络数据集
3.使用transportationAnalyst.createModel创建网络模型文件
4.最后使用导航类Navigation2设置相关参数进行导航
9,127EXP 2021年06月02日
按照上述步骤1、2、3、4都已实现,同时可以进行路径规划,但是在导航的时候,导航页面一闪而过,有“路径导航开始,请按照交通规则行驶”的语音,但是导航页面并没有加载
使用的是模拟导航还是真实导航呢?可以看下是否有报错信息

使用的真实导航,没有任何报错信息。在调用getNaviPath语句时,app卡住不动

NaviPath naviPath = m_Navigation2.getNaviPath();

而且刚开始导航就进入了Navigation2的监听函数:onAarrivedDestination()

debug时输出

/LogInfoService: Get VideoList Request Failed....
E/: [ZeroHung]zrhung_send_event: watchpoint msg buffer too long, len=29196, max is 15360
E/ZrHungImpl:  sendAppFreezeEvent failed!
I/Choreographer: Skipped 205 frames!  The application may be doing too much work on its main thread.
I/OpenGLRenderer: Davey! duration=3585ms; Flags=0, IntendedVsync=164900411810447, Vsync=164903828476977, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=164903839311294, AnimationStart=164903839419628, PerformTraversalsStart=164903839442544, DrawStart=164903991350878, SyncQueued=164903993785253, SyncStart=164903994323273, IssueDrawCommandsStart=164903994421711, SwapBuffers=164903996864419, FrameCompleted=164903997819628, DequeueBufferDuration=117000, QueueBufferDuration=594000, 
I/HwViewRootImpl: removeInvalidNode jank list is null
E/libEGL: eglMakeCurrentImpl:1062 error 3006 (EGL_BAD_CONTEXT)
D/ActivityThread: Remove activity client record, r= ActivityRecord{5851cba token=android.os.BinderProxy@6244960 {com.navigation/com.navigation.ui.home.PoiActivity}} token= android.os.BinderProxy@6244960
D/ZrHung.AppEyeUiProbe: sendAppEye recover Events.
D/: [ZeroHung]zrhung_send_event: wp = 280, ret = 0
W/libEGL: EGLNativeWindowType 0xe3b2e748 disconnect failed
E/ResMng NATIVE_MSG_FILTER: endActivityTransaction: margin state not match
W/mali_winsys: native_window_api_disconnect failed: -19
E/libEGL: eglMakeCurrentImpl:1062 error 3006 (EGL_BAD_CONTEXT)
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/OpenGLRenderer: disableOutlineDraw is true
W/libEGL: EGLNativeWindowType 0xe3b2e748 disconnect failed
D/OpenGLRenderer: disableOutlineDraw is true
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
W/libEGL: EGLNativeWindowType 0xe3b2e748 disconnect failed
W/Settings: Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
V/HiTouch_HiTouchSensor: User setup is finished.
I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time
I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time
I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time
I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time
 

您那边使用的我们的导航demo看下是否正常运行?能够正常运行然后换下数据就可以了
为什么路径规划正常,但是导航的时候,显示剩余1米,1分钟到达
这个需要查看您的数据了。如果您的定位点坐标是在路径规划的位置也会出现这种情况的。检查下当前定位的坐标位置。可以参考一下这个demo,与你们的需求基本保持一致:链接:https://pan.baidu.com/s/1VaEtkadWKQvfH0SwVd6P-g
提取码:vsdo
你好,我这也需要这个功能,你这个demo是不是缺少工作空间文件?运行后没数据,打开工作空间失败
...