This file contains hidden or 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 <fstream> | |
#include <string> | |
#include <vector> | |
/* | |
* Rotate square matrix by 90 deg clock wise. | |
*/ | |
template<typename T> | |
bool rotateMatrix(std::vector< std::vector<T> >& mat) |
This file contains hidden or 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 sys | |
from collections import defaultdict, deque | |
INVALID = "Invalid" | |
class Record(object): | |
SOUND = "neigh" | |
def __init__(self): | |
self._next = 0 |
This file contains hidden or 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 <Eigen/Geometry> | |
int main(int argc, char** argv) | |
{ | |
Eigen::Quaterniond q1(0, 0, 0, 1.); | |
Eigen::Vector3d t1(1., 0, 1.); | |
Eigen::Vector3d p1 = q1*Eigen::Vector3d(0,0,0) + t1; | |
//Isometry if only rotation and translation components | |
Eigen::Isometry3d tf = Eigen::Translation3d(t1) * q1; | |
Eigen::Affine3d tf_affine = tf; |
This file contains hidden or 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 <camera_info_manager/camera_info_manager.h> | |
ros::NodeHandle nh("~"); | |
camera_info_manager::CameraInfoManager mgr(nh); | |
mgr.setCameraName("camera"); | |
mgr.loadCameraInfo("file://my/camera_info.yaml"); | |
sensor_msgs::CameraInfo info = mgr.getCameraInfo(); |
This file contains hidden or 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
# example color list: | |
c = """#e41a1c | |
#377eb8 | |
#4daf4a | |
#984ea3 | |
#ff7f00 | |
#ffff33 | |
#a65628 | |
#f781bf | |
#999999""" |
This file contains hidden or 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
bool | |
compare (int idx1, int idx2) const | |
{ | |
bool dist_ok; | |
if(this->depth_dependent_) | |
{ | |
Eigen::Vector3f vec = input_->points[idx1].getVector3fMap (); | |
float z = vec.dot (this->z_axis_); | |
dist_ok = (fabs ((*plane_coeff_d_)[idx1] - (*plane_coeff_d_)[idx2]) < distance_threshold_ * z * z); | |
} |
NewerOlder