Skip to content

Instantly share code, notes, and snippets.

View eborghi10's full-sized avatar
🤖
Making robots! 🇦🇷

Emiliano Borghi eborghi10

🤖
Making robots! 🇦🇷
View GitHub Profile
@eborghi10
eborghi10 / points.cpp
Created September 9, 2021 17:53 — forked from cseas/points.cpp
Simple C++ OpenGL program to draw points on a 2D canvas
#include<GL/glut.h>
void display() {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_POINTS);
glVertex2f(10.0, 10.0);
glVertex2f(150.0, 80.0);
glVertex2f(100.0, 20.0);
@eborghi10
eborghi10 / turbovnc_virtualgl.md
Last active June 14, 2021 23:37
[Nvidia Jetson Nano] TurboVNC + VirtualGL
  • Download and install compiled binaries
wget http://demotomohiro.github.io/hardware/jetson_tk1/pkg/libjpeg-turbo_1.4.0_armhf.deb
wget http://demotomohiro.github.io/hardware/jetson_tk1/pkg/virtualgl_2.4_armhf.deb
wget http://demotomohiro.github.io/hardware/jetson_tk1/pkg/turbovnc_1.2.3_armhf.deb
sudo dpkg -i libjpeg-turbo_1.4.0_armhf.deb
sudo dpkg -i virtualgl_2.4_armhf.deb
sudo dpkg -i turbovnc_1.2.3_armhf.deb
sudo vi /etc/X11/xorg.conf
@eborghi10
eborghi10 / caught_exception.py
Created April 9, 2021 12:56
ROSInterruptException example
#!/usr/bin/env python
import rospy
name = "caught_exception"
rospy.init_node(name)
r = rospy.Rate(1.)
start = rospy.Time.now()
while not rospy.is_shutdown():
rospy.logwarn(name)
@eborghi10
eborghi10 / .tmux.conf
Created March 1, 2021 12:52
Tmux configuration file
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
set -g history-limit 10000
# split panes using | and -
@eborghi10
eborghi10 / .bashrc
Created November 20, 2020 01:38
Nice Git prompt
# Nice git prompt
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '
@eborghi10
eborghi10 / move_square.py
Created June 10, 2020 23:24 — forked from gurbain/move_square.py
This script allows to move and draw a square on the ground with the turtlebot in three different ways
import math
import rospy as ros
import sys
import time
from geometry_msgs.msg import Twist, Pose
from nav_msgs.msg import Odometry
from tf.transformations import euler_from_quaternion, quaternion_from_euler
<launch>
<!-- Spawn Gazebo -->
<include file="$(find ca_gazebo)/launch/create_empty_world.launch"/>
<!-- Change real-time factor of Gazebo to 2x-->
<node pkg="ca_gazebo" type="set_properties" name="gazebo_physics_properties" output="screen">
<param name="real_time_factor" value="2"/>
</node>
<!-- Run the node to move the robot -->
<node pkg="ca_tools" type="kinematics.py" name="kinematics" output="screen"/>
</launch>
@eborghi10
eborghi10 / tf_example.py
Created April 12, 2020 22:54
Tf example with numpy
#!/usr/bin/env python
import numpy as np
# Define the position of the frame B w.r.t. A
a_T_b = np.array([[2, -1, 1]]).transpose()
# Define the orientation of the frame B w.r.t. A
theta = np.radians(-90)
c, s = np.cos(theta), np.sin(theta)
a_R_b = np.array(((c, -s), (s, c), (0, 0)))
# Homogeneous matrix between A and B
@eborghi10
eborghi10 / ejecutable.launch
Last active May 2, 2020 19:06
Nodo de ejemplo para la clase de Robótica del año 2020 (Introducción a ROS)
<launch>
<node name="mi_nodo_utn" pkg="mi_nuevo_paquete" type="mi_nodo.py" />
<include file="$(find ca_gazebo)/launch/create_empty_world.launch"/>
</launch>
@eborghi10
eborghi10 / conversion_node.cpp
Created August 20, 2019 02:37 — forked from marcoarruda/conversion_node.cpp
ROS Quaternion to RPY
#include <tf/tf.h>
#include <nav_msgs/Odometry.h>
#include <geometry_msgs/Pose2D.h>
ros::Publisher pub_pose_;
void odometryCallback_(const nav_msgs::Odometry::ConstPtr msg) {
geometry_msgs::Pose2D pose2d;
pose2d.x = msg->pose.pose.position.x;
pose2d.y = msg->pose.pose.position.y;