Skip to content

Instantly share code, notes, and snippets.

View AlbertoCasasOrtiz's full-sized avatar
🏠
Working from home

Alberto AlbertoCasasOrtiz

🏠
Working from home
View GitHub Profile
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / install_turtlebot3.sh
Last active September 5, 2019 23:08
Install turtlebot3 in Ros Melodic and use with Gazebo
#!/bin/bash
### Instalation
# Go to catkin src directory:
cd ~/catkin_ws/src/
# Source setup.bash
source ../devel/setup.bash
# Clone repositories for turtlebot and dependencie of msgs:
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / fix-shared-libraries.txt
Created September 6, 2019 16:18
Fix error while loading shared libraries in CLion
Go to: Run -> Edit Configurations -> (select your application) -> Environment variables
Add the following environment variable:
LD_LIBRARY_PATH=/usr/local/lib
### Keybase proof
I hereby claim:
* I am albertocasasortiz on github.
* I am albertcasasortiz (https://keybase.io/albertcasasortiz) on keybase.
* I have a public key ASBHZPqRi0uxEfRWZD_IuCFfN2PdOR1Hof2wvj2iKmZQnQo
To claim this, I am signing this object:
1. Install PyInstaller as a dependency in File->Settings->Project->Project Interpreter.
2. In Edit Configurations, add as Interpreter Options: -m PyInstaller
3. Add -F if you want to generate a pacakge with just one executable file (can be slower).
3. Add --noconsole to get rid of console.
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / change_colab_tf_version.py
Created June 12, 2020 07:06
Change Google colab Tensorflow version
# It is necessary to restart the environment before changing version
# if you have already imported tensorflow.
# Change to version 1.x
%tensorflow_version 1.x
import tensorflow
print(tensorflow.__version__)
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / keras_to_tflite.py
Created June 15, 2020 06:05
Convert keras model into tflite
import tensorflow as tf
from keras.models import model_from_json
keras.backend.clear_session()
# Model reconstruction from JSON file.
with open('model.json', 'r') as f:
model = model_from_json(f.read())
# Load weights from h5 file.
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / deploy_mac_qt.txt
Created October 15, 2020 01:11
Deployment Qt Mac
1. Build in release mode.
2. Execute macdeployqt. My project is formed by 2 subprojects. one of them containing the gui components (qrc, qml...), and other containing all the logic.
The project with the gui is in <Dir_to_gui_project>. <Dir_to_release> must contain the library generated by Qt from the logic project.
<Dir_to_Qt>/5.15.1/clang_64/bin/macdeployqt <app_name>.app -qmldir="<Dir_to_gui_project>" -libpath=<Dir_to_release>
3. Test that all Qt libraries are inside the bundle.
Use otool to see which libraries are required, then test if they are inside of <app_name>.app/Contents/Frameworks.
@AlbertoCasasOrtiz
AlbertoCasasOrtiz / opensim-windows-build-script.ps1
Last active July 4, 2023 23:29
Script to build opensim-gui on Windows 7+
#Requires -RunAsAdministrator
param (
[switch]$s=$false,
[switch]$h=$false,
[string]$d="Release",
[string]$c="main",
[string]$g="main",
[int]$j=[int]4
)
#!/bin/bash
# Exit when an error happens instead of continue.
set -e
# Default values for flags.
DEBUG_TYPE="Release"
NUM_JOBS=4
MOCO="on"
CORE_BRANCH="main"
#!/bin/bash
# Exit when an error happens instead of continue.
set -e
# Default values for flags.
DEBUG_TYPE="Release"
NUM_JOBS=4
MOCO="on"
CORE_BRANCH="main"