Skip to content

Instantly share code, notes, and snippets.

View rpapallas's full-sized avatar

Rafael Papallas rpapallas

View GitHub Profile
@rpapallas
rpapallas / README.md
Created December 8, 2023 12:56
turtlebot 3 networking debugging

Both on Wifi:

PING kaylah.local (192.168.0.102) 56(84) bytes of data.
64 bytes from 192.168.0.102: icmp_seq=1 ttl=64 time=1.88 ms
64 bytes from 192.168.0.102: icmp_seq=2 ttl=64 time=3.01 ms
64 bytes from 192.168.0.102: icmp_seq=3 ttl=64 time=1.52 ms
64 bytes from 192.168.0.102: icmp_seq=4 ttl=64 time=1.63 ms
64 bytes from 192.168.0.102: icmp_seq=5 ttl=64 time=4.73 ms
64 bytes from 192.168.0.102: icmp_seq=6 ttl=64 time=1.71 ms
@rpapallas
rpapallas / README.md
Created May 11, 2023 14:18
Running real-robot commands in singularity
  1. Download this zip file from the link provided.
  2. Unzip the file.
  3. cd into the new folder (realrobot).
  4. Run ./enable_usb_rules.sh on your machine (not in the container). Will ask you for root password, will copy some USB rules under /etc/udev/rules.d to allow the laptop to recognise the robot and the camera when connected through USB.
  5. Then run ./run_singularity.sh you are now in the container.
  6. If not in your .bashrc, you need to run: source /opt/ros/noetic/setup.bash
  7. Within the unzipped folder, there is a new catkin_ws (different from your ~/catkin_ws, feel free to merge if you want). Go there: cd catkin_ws (not ~/catkin_ws but probably ~/Downloads/realrobot/catkin_ws) and run catkin_make. Now run source devel/setup.bash You should be able to run the commands on the real robot. You can open multiple terminal windows using: terminator & from that main singularity window. You will need to run source devel/setup.bash in every terminator window.
@rpapallas
rpapallas / main.py
Last active March 23, 2023 12:52
Importing scripts
# ...
# ** Don't change this path **
PROJECT_DIR = os.path.expanduser('~/catkin_ws/src/group_project')
import sys
sys.path.insert(0, f'{PROJECT_DIR}/scripts')
# **Import files in scripts from here ...**
# for example a class called CluedoDetector in scripts/cluedo_detector.py can be imported like so:
@rpapallas
rpapallas / installation.sh
Created February 1, 2023 17:39
ROS Noetic for Turtlebot
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
apt update
apt install -y \
ros-noetic-desktop-full \
ros-noetic-catkin \
ros-noetic-rqt-* \
ros-noetic-gazebo-*
. /opt/ros/noetic/setup.sh
@rpapallas
rpapallas / multiprocessing.py
Last active August 8, 2022 08:59
Multiprocessing in Python example
import time
import multiprocessing
num_of_particles = 50
def main_non_parellised():
results = []
@rpapallas
rpapallas / instructions.md
Last active April 20, 2025 02:06
Open file into NeoVim on macOS from Finder

Create a script that will allow macOS to open a source code file in iTerm2/Terminal and Vim/NeoVim

  • Open Automator and create a new application. You can name it "TerminalVim"
  • Works with any command basically, just change the following line set q to "nvim " & quote & myPath & quote to match what you want in the code below. For example: set q to "vim " & quote & myPath & quote to use Vim instead of NeoVim.
  • Paste the following code:
on appIsRunning(appName)
    tell application "System Events" to (name of processes) contains appName
end appIsRunning
@rpapallas
rpapallas / openrave_or_urdf.md
Created June 22, 2020 09:33
Installing or_urdf plugin for OpenRAVE 0.9

Installation

  • First, run the following to install libtinyxml2-dev on your system.
sudo apt-get install libtinyxml2-dev
  • I assume you have already configured your catkin_ws workspace, if not Google how to configure your catkin workspace.
  • Go to catkin_ws/src and clone the or_urdf repository from here. Note that this is a forked version because I changed something to the build destination of the plugin. I have created a pull request but as of now has not yet been approved. Have a look here and if the
@rpapallas
rpapallas / rosrun.sh
Created May 12, 2020 15:28
rosrun with GDB or Valgrind
rosrun --prefix 'gdb -ex run --args' catkin_package_name [arguments...]
rosrun --prefix 'valgrind --leak-check=full' catkin_package_name [arguments...]
@rpapallas
rpapallas / two_column.tex
Created February 5, 2020 14:35
LaTeX two-column figure bottom of the first-page.
% The trick is with the following package. You **need** to use the following package.
\usepackage{nidanfloat}
% ....
% Put your figure near the first page content.
\begin{figure*}[b]
\centering
\def\svgwidth{\textwidth}
\import{sections/images/}{some_figure.pdf_tex}
@rpapallas
rpapallas / demo.cpp
Created July 5, 2019 17:51
C++ thread of a class overloaded method
class MyClass {
.
.
bool desiredOverloadedMethod() {
return true;
}
bool desiredOverloadedMethod(int a) {
if(a == 1)
return false;