This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <tf/tf.h> | |
int main(){ | |
/**< Declaration of quaternion */ | |
tf::Quaternion q; | |
q.setW(1); | |
q.setX(0); | |
q.setY(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <tf/tf.h> | |
void coutQuaternion(tf::Quaternion q){ | |
std::cout<<q.getX()<<", "<<q.getX()<<", "<<q.getZ()<<", "<<q.getW()<<std::endl; | |
} | |
void coutTfMat(const tf::Matrix3x3& mat){ | |
std::cout<<mat[0][0]<<mat[0][1]<<mat[0][2]<<std::endl; | |
std::cout<<mat[1][0]<<mat[1][1]<<mat[1][2]<<std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
vector<float> ints = {0.01, 0.02, 0.03, 0.04}; | |
void main(){ | |
// to avoid copying | |
for (auto &i: ints){ | |
std::cout<< i <<std::endl; | |
} | |
// to prevent to change the value | |
for (auto const i: ints){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
from torch.autograd import Variable | |
import torch.nn.functional as F | |
num_classes = 5 | |
input = torch.randn(3, num_classes, requires_grad=True) | |
print(input) | |
target = torch.randint(num_classes, (3,), dtype=torch.int64) | |
print(target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
gpu='1' | |
seq='0' | |
batch=6400 | |
dir="/home/shapelim/RONet/0213fc_" | |
network_type='fc' | |
# | |
count="_1/" | |
python3.5 train.py --save_dir $dir$count --gpu $gpu --sequence_length $seq --batch_size $batch --network_type $network_type | |
python3.5 test.py --load_model_dir $dir$count --gpu $gpu --sequence_length $seq --network_type $network_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import os | |
import numpy as np | |
import cv2 | |
import matplotlib.pyplot as plt | |
from scipy import ndimage, misc | |
from scipy.stats import norm | |
def draw_histogram(x, n_bins, name): | |
n, bins, patches = plt.hist(x, bins=n_bins, color=(0.0, 0.0, 0.5), density=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global_config] | |
focus = system | |
handle_size = 1 | |
tab_position = bottom | |
[keybindings] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Normalize for Esential Matrix calaculation | |
pts_l_norm = cv2.undistortPoints(np.expand_dims(pts_l, axis=1), cameraMatrix=K_l, distCoeffs=None) | |
pts_r_norm = cv2.undistortPoints(np.expand_dims(pts_r, axis=1), cameraMatrix=K_r, distCoeffs=None) | |
E, mask = cv2.findEssentialMat(pts_l_norm, pts_r_norm, focal=1.0, pp=(0., 0.), method=cv2.RANSAC, prob=0.999, threshold=3.0) | |
points, R, t, mask = cv2.recoverPose(E, pts_l_norm, pts_r_norm) | |
M_r = np.hstack((R, t)) | |
M_l = np.hstack((np.eye(3, 3), np.zeros((3, 1)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import rospy | |
from std_msgs.msg import String | |
from sensor_msgs.msg import CompressedImage, Image | |
from cv_bridge import CvBridge | |
import cv2 | |
import threading | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <pcl/common/transforms.h> | |
#include <pcl/point_types.h> | |
#include <pcl/point_cloud.h> | |
// Input: pcl::PointCloud source, namely cloud_src | |
//Output: Transformed pcl::PointCloud, namely pc_transformed, via 4x4 transformation matrix | |
int main(int argc, char **argv){ |
OlderNewer