Exemplo n.º 1
0
p.add_argument(
    '--cloud_path',
    type=str,
    default=
    '/home/torroba/Downloads/post_deployment/KTH_Post_Deployment_AVG_WGS84UTM32N_RH200_50cm.xyz',
    help=
    'Options are "sine" (all sine activations) and "mixed" (first layer sine, other layers tanh)'
)
opt = p.parse_args()

mesh_res = 0.6
beam_width = math.pi / 180. * 60.

cloud = xyz_data.cloud.parse_file(opt.cloud_path)
pings = std_data.mbes_ping.read_data(opt.mbes_path)

getcontext().prec = 28

R = rot.from_euler("zyx", [pings[0].heading_, pings[0].pitch_, 0.]).as_dcm()
pos = pings[0].pos_
R_inv = R.transpose()

pos_inv = R_inv.dot(pos)
cloud[:] = [R_inv.dot(p) - pos_inv for p in cloud]

#  V, F, bounds = mesh_map.mesh_from_cloud(cloud, mesh_res)
V, F, bounds = mesh_map.mesh_from_dtm_cloud(cloud, mesh_res)
np.savez("mesh.npz", V=V, F=F, bounds=bounds)

mesh_map.show_mesh(V, F)
Exemplo n.º 2
0
    if len(beam_idx_list) > 0:
        # discard bad beams
        choosen_pings[idx].beams = np.delete(ping.beams, beam_idx_list, axis = 0)
        # newPing is used to plot data
    #     new_ping = copy.copy(beams)
    #     new_ping[beam_idx_list] = 0 # fill bad beam with empty value(0)
    # else:
    #     new_ping = beams


    ''' Show beams before and after '''
    # plt.figure(1)
    # plt.clf()
    # plt.subplot(121)
    # plt.title('var: %f' % np.var(beams))
    # plt.axis([0, 400, -95, -75])
    # plt.grid()
    # plt.scatter(np.arange(len(beams)), beams, s=2, c='b', marker='.')
    # plt.subplot(122)
    # plt.title(idx) 
    # plt.scatter(np.arange(len(beams)), new_ping, s=2, c='b', marker='.')
    # plt.axis([0, 400, -95, -75])
    # plt.grid()
    # plt.pause(0.001)

std_data.write_data(choosen_pings, 'Data/EM2040/mid/pings_outlier_discard.cereal')

''' Show mesh (praying Orz...) '''
V_f, F_f, bounds_f = mesh_map.mesh_from_pings(choosen_pings, 0.5)
mesh_map.show_mesh(V_f, F_f)