Skip to content

定位传感器(GPS)/ GPS Sensor

说明 / Overview

获取主车 GPS 数据(位置、速度、朝向等)的主动查询与回调注册接口。
Interfaces for retrieving ego vehicle GPS data (position, velocity, heading, etc.) via active query or callback registration.

SimOneSensorAPI.SoGetGps(mainVehicleId, gpsData)

获取主车GPS信息

Get vehicle GPS info

Parameters:

Name Type Description Default
mainVehicleId string

车辆ID
vehicle id

required
gpsData SimOne_Data_Gps

车辆GPS数据(含基础底盘信息)
vehicle gps including basic chassis info

required

Returns:

Type Description
bool

executive outcome: success/faile

SimOneSensorAPI.SoApiSetGpsUpdateCB(cb)

主车GPS更新回调

Register the callback func applying for GPS info

Parameters:

Name Type Description Default
cb GPS callback function mainVehicleId (str): vehicle id Data_Gps (SimOne_Data_Gps): gps info

回调函数,格式:cb(mainVehicleId, Data_Gps)
cb(mainVehicleId, Data_Gps)

required