Commit 843a9540 authored by oscar's avatar oscar

提交so库调用

parent c77a3957
import os
import sys
sys.path.append("./jfxmap_lib/")
import libjfxmap_python
# ret = libjfxmap_python.add(3,4)
# print(ret)
def init_jfxmap(path,cfg):
ret = libjfxmap_python.InitMap(path,cfg)
return ret
def get_map_data(lat,lon,heading):
info = libjfxmap_python.GetMapData(lat,lon,heading)
return info.isInMap,info.lOutRaodId,info.vctlOutPreRoadId,info.vctlOutNxtRoadId,info.nLaneCnt,info.nOutLaneNum,info.nOutLaneType,info.nOutLeftEdgeCrossType,info.nOutRightEdgeCrossType,info.nOutSpeedLimit,info.dOutLaneAngle,info.ptOutFoot_lat,info.ptOutFoot_lon
\ No newline at end of file
No preview for this file type
...@@ -14,7 +14,7 @@ import scipy ...@@ -14,7 +14,7 @@ import scipy
from utils.getloc_coll import get_loc, get_world_loc from utils.getloc_coll import get_loc, get_world_loc
from easydict import EasyDict from easydict import EasyDict
import yaml import yaml
from jfxmap_lib.jfxmap import init_jfxmap, get_map_data
def compute_pitch(A,B,C): def compute_pitch(A,B,C):
...@@ -445,6 +445,11 @@ if __name__ == '__main__': ...@@ -445,6 +445,11 @@ if __name__ == '__main__':
jsn_file = os.path.join(root_path, child_dir + ".json") jsn_file = os.path.join(root_path, child_dir + ".json")
print(jsn_file) print(jsn_file)
p_dir = "/home/oscar/ros/git/catkin_ws_xishan/src/jfx_traffic_events/thirdparty/jfxmap/"
f_path = "./maps/xishan/mapconfig.json"
ret = init_jfxmap(p_dir,f_path)
print(ret)
vis = True vis = True
with open(jsn_file, 'r',encoding='utf-8',errors='ignore') as fp: with open(jsn_file, 'r',encoding='utf-8',errors='ignore') as fp:
jsn = json.load(fp) jsn = json.load(fp)
...@@ -479,10 +484,13 @@ if __name__ == '__main__': ...@@ -479,10 +484,13 @@ if __name__ == '__main__':
for bbox in bboxes: for bbox in bboxes:
lidar_loc, out_BL, out_center_BL = get_loc([bbox[4][0], bbox[4][1], bbox[4][2], bbox[6][0], bbox[6][1], bbox[6][2], bbox[2]], 0, Trans, kitti2origin) lidar_loc, out_BL, out_center_BL = get_loc([bbox[4][0], bbox[4][1], bbox[4][2], bbox[6][0], bbox[6][1], bbox[6][2], bbox[2]], 0, Trans, kitti2origin)
print(out_center_BL) print(out_center_BL)
angle = bbox[2]/np.pi*180
isInMap = get_map_data(out_center_BL[0],out_center_BL[1],angle)
print("call get data isInMap = ",isInMap)
flag = in_hull(xyz,bbox[1]) flag = in_hull(xyz,bbox[1])
pickcloud = xyz[flag] pickcloud = xyz[flag]
dz = np.array([0,0,10]) dz = np.array([0,0,0])
addz = np.add(pickcloud,dz) addz = np.add(pickcloud,dz)
print(pickcloud) print(pickcloud)
print(addz) print(addz)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment