Skip to content

Instantly share code, notes, and snippets.

View jokla's full-sized avatar

Giovanni Claudio jokla

View GitHub Profile
@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
@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 / 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 / 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
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import matplotlib.pyplot as plt
# Visualizations will be shown in the notebook.
%matplotlib inline
import random
import numpy as np
datagen = ImageDataGenerator(
rotation_range=40,
width_shift_range=0.2,
@jokla
jokla / change_docker_root_folder.txt
Last active July 15, 2019 09:02
Change Docker root folder Ubuntu 14.04 and Ubuntu 16.04
$ sudo service docker stop
$ gksudo gedit /etc/default/docker
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -g /home/jokla/docker/docker/"
$ sudo service docker start
UBUNTU 16.04
@jokla
jokla / gist:587c647c1372fa19fbcd22918a533b84
Created January 14, 2018 16:07
rosbag record image and export to video
$ rosbag record -O test2.bag /image_color
- Create a file export_img_rosbag.launch:
<launch>
<node pkg="rosbag" type="play" name="rosbag" args="-d 2 $(find carla_ros)/launch/test.bag"/>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
<remap from="image" to="/image_color"/>
</node>
</launch>
@jokla
jokla / aruco.test
Created May 27, 2018 14:22
Aruco painting
/**
Copyright 2017 Rafael Muñoz Salinas. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
function sysCall_init()
visionSensorHandles={}
for i=1,4,1 do
visionSensorHandles[i]=sim.getObjectHandle('velodyneVPL_16_sensor'..i)
end
ptCloudHandle=sim.getObjectHandle('velodyneVPL_16_ptCloud')
frequency=5 -- 5 Hz
options=2+8 -- bit0 (1)=do not display points, bit1 (2)=display only current points, bit2 (4)=returned data is polar (otherwise Cartesian), bit3 (8)=displayed points are emissive
pointSize=2
coloring_closeAndFarDistance={1,4}