- Download models from Google Drive (73.9 MB) in the base directory.
- Download dataset from Google Drive (97.8 MB)
- Selects four points in the image in the Region of interest, whose top view is required:
python getRealOneGazebo.py --rgb 'data/drone1/rgb/rgb000540.jpg' --depth 'data/drone1/depth/depth000540.npy' --camera_file configs/camera_gazebo_drone.txt
- It generates Homography matrics for orthographic view of the provided image.
In last part, we got Homography matrics for orthographic view for each and every images input. Now, we perform two steps:-
- Calculate the transformation from one orthographic view to another. By default, this is in camera frame(also left handed system).
- This need to be in odom frame(also right handed system). Hence, the step
2
.
The steps are:-
-
Inferring on gazebo dataset in orthographic view:
1.cd demo
2.python register.py --rgb1 <img1.jpg> --rgb2 <img2.jpg> --depth1 <depth1.npy> --depth2 <depth2.npy> --camera_file ../configs/camera_gazebo.txt --H ../configs/topH.npy --model_rord ../models/rord.pth --viz3d --save_trans
3. If homography is different for the two images, then use--H
and--H2
flags:
python register.py --H <first_homography.npy> --H2 <second_homography.npy>
4. Saves the Transformation matrix from one image to another. -
Converting RoRD transformations (in camera frame and in left handed system) to loop closure transformations (in odom frame and in right handed system):
-
Getting static transform from ros,
Tbase_camera
orCamera wrt Base link
rosrun tf tf_echo base_link camera_link
-
Transformations for SE2 and SE3:
- SE2 Optimization:
python cordTrans.py --static_trans ../configs/camWrtBase.txt --rord_trans ../demo/transLC.npy
- SE3 Optimization:
python cordTrans.py --static_trans ../configs/camWrtBaseDrone.txt --rord_trans ../data/drone1/transLC212_2275.npy --se3
- SE2 Optimization:
-
Derivation of how transformations in
cordTrans.py
are dervied can be found here.
-
cd pose_graph
- Generating odometry edges
noise.g2o
using gazebo's odometer outputposes.txt
.- SE2 Optimization:
python genG2o.py data5/poses.txt
- SE3 Optimization:
python genG2oSE3.py drone1/poses.txt
- SE2 Optimization:
- Adding loop closure edges
loop_pairs.txt
to generated odometry edgesnoise.g2o
to outputnoise_lc.g2o
. Also optimizing odometry and loop closure edges stored innoise_lc.g2o
to outputopt.g2o
.- SE2 Optimization:
python optimizePose.py data5/noise.g2o data5/loop_pairs.txt
- SE3 Optimization:
python optimizePoseSE3.py drone1/noise.g2o drone1/loop_pairs.txt drone1/gt.g2o
- SE2 Optimization: