Skip to content

Instantly share code, notes, and snippets.

Eigen::Quaternion<float> q;
Eigen::AngleAxis<float> aaZ(pcl::deg2rad(rz), Eigen::Vector3f::UnitZ());
Eigen::AngleAxis<float> aaY(pcl::deg2rad(ry), Eigen::Vector3f::UnitY());
Eigen::AngleAxis<float> aaX(pcl::deg2rad(rx), Eigen::Vector3f::UnitX());
q = aaZ * aaY * aaX;
Q: How to get rid of git submodules untracked status?
A: move into the submodule's directory, then
git reset --hard
@qh-huang
qh-huang / c_cpp_useful_code_pieces.h
Last active October 8, 2018 06:58
Commonly Used Code Pieces
// thread sleep in C++11
void ThreadSleep(int duration_ms) {
std::cout << "Thread Sleeping..." << std::endl;
auto start = std::chrono::high_resolution_clock::now();
std::this_thread::sleep_for(std::chrono::milliseconds(duration_ms));
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> elapsed = end - start;
cout << << "Thread Awake. Sleeping for " << elapsed.count() << " ms." << std::cout;
}