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
//output a compile time constant | |
template<size_t size> | |
struct overflow{ operator char() { return size + 999999; } }; //always overflow | |
template<int VALUE> | |
void echoCompileTimeConstant() | |
{ | |
char(overflow<VALUE>()); | |
} | |
Usage: |
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
cv::Mat image; | |
image.create(image_height, image_width, CV_16UC1); | |
cv::Mat image_8bit; | |
image_8bit.create(image_height, image_width, CV_8UC1); | |
memcpy(image.data,frame_ptr->getImageRawPtr(),(image_width)*image_height*2); | |
uint16_t max=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
for file in *.bag; do echo "$file" && rosbag info "$file" -y; done |
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 sh | |
# It's a reference about what to do after freshly installing Ubuntu 12.04 desktop amd64. | |
# It's MY note and it suit me. | |
# Though I note the process down here as a ".sh" file, | |
# you SHOULD check it first or copy-and-paste the useful sections into your terminal | |
# to ensure the availability. | |
# I am NOT GUARANTEE the availability of this file (note) | |
# or I am not responsible for your lost if you follow this note. | |
# It's for amd64 only, not i386, though most of the codes should meet no problems in i386. |
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
for file in *.bag; do echo "$file" && rosrun irdetect_16_8 bag_to_image "$file" /cam2/image_raw ~/Desktop/$file 16 1 1; done |
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
function [ q3 ] = slerp( q1, q2, t ) | |
%SLERP quaternion slerp | |
% computes the slerp of value t between quaternions q1 and q2 | |
q1 = q1 ./ norm(q1); | |
q2 = q2 ./ norm(q2); | |
one = 1.0 - eps; | |
d = q1'*q2; | |
absD = abs(d); |
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
function [ averagequat ] = average_quats( diffquats ) | |
%AVERAGE_QUATS Average a series of quats, needs to be a two power length | |
%vector | |
% using slrp | |
range = size(diffquats); | |
if(range(1) ~= 4) | |
error 'quaternions must be 4 row vectors' | |
end |
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
#use some preinstalled ubuntu and activate swap: | |
http://wiki.ubuntuusers.de/Swap#Swap-als-Datei | |
#install some packages: | |
sudo apt-get update | |
sudo apt-get build-dep libcppunit-dev autoconf automake autotools-dev dh-autoreconf doxygen libtool m4 -y | |
sudo apt-get install python-nose python-empy python-sip-dev python-sip -y | |
sudo apt-get install cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev liblog4cxx10-dev liblog4cxx10 libbz2-* wx-common libwxgtk2.8-dev libgtest* swig -y |
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
sudo dd ... & | |
ps auxww |grep " dd " |grep -v grep |awk '{print $2}' |while read pid; do sudo kill -USR1 $pid; done |
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
git config --global color.ui "auto" | |
__git_ps1 () | |
{ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)"; | |
if [ -n "$b" ]; then | |
printf " (%s)" "${b##refs/heads/}"; | |
fi | |
} |
OlderNewer