-
Notifications
You must be signed in to change notification settings - Fork 0
Home
HanselLi edited this page Feb 24, 2022
·
1 revision
自检完成后可以通过PuduOS获取导航管理类
val puDuNavigationManager by lazy { PuduOS.getService(PuduOS.NAVIGATION_SERVICE) as NavigationManager }
val locationStatus=puDuNavigationManager .getLocationStatus()
方法 | 类型 | 描述 |
---|---|---|
isNormal | Boolean | 是否正常 |
isWarning | Boolean | 是否警告 |
isError | Boolean | 是否出错 |
我们可以通过isNormal判断机器人是否获取定位
val pose=puDuNavigationManager.getCurrentPose()
字段 | 类型 | 含义 |
---|---|---|
x | Double | 位置坐标X |
y | Double | 位置坐标Y |
z | Double | 位置坐标Z |
val locateType=puDuNavigationManager.getLocateType()
常量 | 值 | 含义 |
---|---|---|
DEFAULT | 0 | 默认 |
MARKER | 1 | 标记 |
LASER | 2 | 激光 |
LASER_MARKER | 3 | 融合 |
SLAM | 4 | 同步定位与建图 |
fun getLostLocation(view: View) {
puDuNavigationManager.setLostLocalization(false, object : ActionListener<String>() {
override fun onStatusUpdate(status: Int, result: ActionData?) {
super.onStatusUpdate(status, result)
val data=result?.any as LocationStatus
showResult(RESULT_OK, gson.toJson(data))
}
override fun onResult(code: Int, result: String?) {
}
})