Skip to content

Instantly share code, notes, and snippets.

View jokla's full-sized avatar

Giovanni Claudio jokla

View GitHub Profile
@jokla
jokla / velocity.cpp
Last active September 14, 2016 12:42
for (unsigned i = 0 ; i < jointVel.getSize() ; ++i)
{
float vel = jointVel[i];
AL::ALValue limits = m_motionProxy->getLimits(jointName[i]);
if (vel > 0.0f)
angles.arrayPush(limits[0][1]); //max
else if (vel < 0.0f)
angles.arrayPush(limits[0][0]); //min
@jokla
jokla / computeTF2frames.py
Last active August 8, 2016 09:10
How to compute frame transformations with Tf (ROS)
import rospy
import math
import tf
if __name__ == '__main__':
rospy.init_node('look_up_pepper_tf')
listener = tf.TransformListener()
trans = []
@jokla
jokla / gist:9a717be0d5090a41905fb2890b3a14c1
Created July 29, 2016 07:40
Check hostname pc in bash
if [ "$(hostname)" == 'Dell-PC' ]; then
echo "This pc is Dell-PC"
pc_dell_pc=true
fi
if [ "$pc_dell_pc" = true ] ; then
echo 'Dell pc check'
fi
@jokla
jokla / gist:1eb08d7bb40ee692964d5653395f1158
Created April 8, 2016 08:47
Example jointState msg Romeo
name: ['NeckYaw', 'NeckPitch', 'HeadPitch', 'HeadRoll', 'LEyeYaw', 'LEyePitch', 'REyeYaw', 'REyePitch', 'TrunkYaw', 'LHipYaw', 'LHipRoll', 'LHipPitch', 'LKneePitch', 'LAnklePitch', 'LAnkleRoll', 'RHipYaw', 'RHipRoll', 'RHipPitch', 'RKneePitch', 'RAnklePitch', 'RAnkleRoll', 'LShoulderPitch', 'LShoulderYaw', 'LElbowRoll', 'LElbowYaw', 'LWristRoll', 'LWristYaw', 'LWristPitch', 'RShoulderPitch', 'RShoulderYaw', 'RElbowRoll', 'RElbowYaw', 'RWristRoll', 'RWristYaw', 'RWristPitch']
position: [0.0011198638558120363, 0.0199619836411628, 0.00800388535599487, 0.007115997927261007, 0.0, 0.0, 0.0, 0.0, -0.008644184289032597, 0.010997223159075456, 0.008898095766382428, -0.11475175707583844, 0.24763984418165202, -0.13871817692999452, 0.0010332776404101411, 0.010997019495483241, 0.008867129830932338, -0.09116471056488372, 0.19049250220840877, -0.10515787929845143, 0.001064244060971629, 1.7093324732498913, -0.0097031549001955, -1.3006052480378474, -0.18327574744861536, -0.35009075918831256, -0.0022313540171367287, 0.000250023