Skip to content

Commit

Permalink
fix python tool
Browse files Browse the repository at this point in the history
  • Loading branch information
HeYijia committed Jun 9, 2019
1 parent 11c902a commit 00562a2
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 2,160 deletions.
Binary file modified bin/data_gen
Binary file not shown.
17 changes: 17 additions & 0 deletions main/gener_alldata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,23 @@ CreatePointsLines(std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::V

int main(){

// Eigen::Quaterniond Qwb;
// Qwb.setIdentity();
// Eigen::Vector3d omega (0,0,M_PI/10);
// double dt_tmp = 0.005;
// for (double i = 0; i < 20.; i += dt_tmp) {
// Eigen::Quaterniond dq;
// Eigen::Vector3d dtheta_half = omega * dt_tmp /2.0;
// dq.w() = 1;
// dq.x() = dtheta_half.x();
// dq.y() = dtheta_half.y();
// dq.z() = dtheta_half.z();
//
// Qwb = Qwb * dq;
// }
//
// std::cout << Qwb.coeffs().transpose() <<"\n"<<Qwb.toRotationMatrix() << std::endl;

// 生成3d points
std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d> > points;
std::vector < std::pair< Eigen::Vector4d, Eigen::Vector4d > > lines;
Expand Down
4 changes: 0 additions & 4 deletions python_tool/.idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions python_tool/.idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions python_tool/.idea/python_tool.iml

This file was deleted.

385 changes: 0 additions & 385 deletions python_tool/.idea/workspace.xml

This file was deleted.

Binary file modified python_tool/GeometryLib.pyc
Binary file not shown.
11 changes: 7 additions & 4 deletions python_tool/draw_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@
from GeometryLib import drawCoordinateFrame, euler2Rbn,euler2Rnb
import transformations as tf

import os
#filepath=os.path.abspath('.') #表示当前所处的文件夹的绝对路径
filepath=os.path.abspath('..')+"/bin" #表示当前所处的文件夹上一级文件夹的绝对路径

point_id=[]
x=[]
y=[]
z=[]

with open('/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/all_points.txt', 'r') as f:
with open(filepath + '/all_points.txt', 'r') as f:
data = f.readlines() #txt中所有字符串读入data

for line in data:
Expand All @@ -33,7 +36,7 @@
quaterntions = []
timestamp = []
qw_index = 1
with open('/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/cam_pose.txt', 'r') as f: # imu_circle imu_spline
with open(filepath + '/cam_pose.txt', 'r') as f: # imu_circle imu_spline

data = f.readlines() #txt中所有字符串读入data
for line in data:
Expand Down Expand Up @@ -68,7 +71,7 @@
for j in range(len(rpy)):
drawCoordinateFrame(ax, rpy[j], t[j])

s = '/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/keyframe/all_points_' +str(i)+'.txt'
s = filepath + '/keyframe/all_points_' +str(i)+'.txt'
with open(s, 'r') as f:
data = f.readlines() #txt中所有字符串读入data
for line in data:
Expand All @@ -80,7 +83,7 @@

ax.plot( [ numbers_float[0], p[0] ] , [ numbers_float[1], p[1] ] , zs=[ numbers_float[2], p[2] ] )

s = '/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/house.txt'
s = filepath + '/house_model/house.txt'
with open(s, 'r') as f:
data = f.readlines() # txt中所有字符串读入data
for line in data:
Expand Down
103 changes: 0 additions & 103 deletions python_tool/draw_points.py~

This file was deleted.

10 changes: 7 additions & 3 deletions python_tool/draw_trajcory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

import os
filepath=os.path.abspath('..')+"/bin" #表示当前所处的文件夹上一级文件夹的绝对路径

position = []
quaterntions = []
timestamp = []
tx_index = 5
with open('/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/imu_pose.txt', 'r') as f: # imu_circle imu_spline

with open(filepath + '/imu_pose.txt', 'r') as f: # imu_circle imu_spline

data = f.readlines() # txt中所有字符串读入data
for line in data:
Expand All @@ -33,7 +37,7 @@
position1 = []
quaterntions1 = []
timestamp1 = []
with open('/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/imu_int_pose.txt', 'r') as f: # imu_pose imu_spline
with open(filepath + '/imu_int_pose.txt', 'r') as f: # imu_pose imu_spline

data = f.readlines() # txt中所有字符串读入data
for line in data:
Expand All @@ -47,7 +51,7 @@
position2 = []
quaterntions2 = []
timestamp2 = []
with open('/home/hyj/my_slam/vio_sim/vio_pl_sim/bin/imu_int_pose_noise.txt', 'r') as f: # cam_pose_opt_o_0 cam_pose_opt_o_0
with open(filepath + '/imu_int_pose_noise.txt', 'r') as f: # cam_pose_opt_o_0 cam_pose_opt_o_0

data = f.readlines() # txt中所有字符串读入data
for line in data:
Expand Down
Binary file modified python_tool/transformations.pyc
Binary file not shown.
Loading

0 comments on commit 00562a2

Please sign in to comment.