Skip to content

Instantly share code, notes, and snippets.

View bmagyar's full-sized avatar

Bence Magyar bmagyar

View GitHub Profile
@bmagyar
bmagyar / bashrc_update.md
Created December 18, 2020 09:02
Alias to source ROS ROS2 workspace

Internally, it really just tries to source the devel space and failing that it tries install space. Works well for me

Add this to your .bashrc file

alias s='if [ -f "devel/setup.bash" ]; then source devel/setup.bash; else source install/setup.bash; fi'
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017, Bence Magyar
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
#include <memory>
template <typename T>
class Fancy
{};
template <typename T>
using FancySharedPtr = std::shared_ptr<Fancy<T> >;
int main(int argc, char** argv)
- git: {local-name: tiago_moveit_config, uri: 'https://github.com/bmagyar/tiago_moveit_config', version: 'kinetic-devel'}
- git: {local-name: tiago_robot, uri: 'https://github.com/bmagyar/tiago_robot', version: 'kinetic-devel'}
- git: {local-name: pmb2_robot, uri: 'https://github.com/bmagyar/pmb2_robot', version: 'kinetic-devel'}
- git: {local-name: pal_gripper, uri: 'https://github.com/bmagyar/pal_gripper', version: 'kinetic-devel'}
- git: {local-name: tiago_simulation, uri: 'https://github.com/bmagyar/tiago_simulation', version: 'kinetic-devel'}
- git: {local-name: head_action, uri: 'https://github.com/pal-robotics/head_action', version: 'indigo-devel'}
@bmagyar
bmagyar / button.py
Created November 17, 2017 15:05
PyQt5 Button example for Python2
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
class App(QWidget):
def __init__(self):
super(App, self).__init__()
self.title = 'PyQt5 button - pythonspot.com'
#ifndef ROSCONSOLECOLOURS_H
#define ROSCONSOLECOLOURS_H
#include <vector>
#include <deque>
#include <ros/console.h>
#include <iostream>
#include <Eigen/Eigen>
#define ROS_RED_STREAM(SSS) ROS_INFO_STREAM("\033[31;1m" << SSS << "\033[0m\n")
/*
* rosserial Servo Control Example
*
* This sketch demonstrates the control of hobby R/C servos
* using ROS and the arduiono
*
* For the full tutorial write up, visit
* www.ros.org/wiki/rosserial_arduino_demos
*
* For more information on the Arduino Servo Library
#ifndef ROSCONSOLECOLOURS_H
#define ROSCONSOLECOLOURS_H
#include <ros/console.h>
#include <iostream>
#define ROS_RED_STREAM(SSS) ROS_INFO_STREAM("\033[31;1m" << SSS << "\033[0m\n")
#define ROS_GREEN_STREAM(SSS) ROS_INFO_STREAM("\033[32;1m" << SSS << "\033[0m\n")
#define ROS_YELLOW_STREAM(SSS) ROS_INFO_STREAM("\033[33;1m" << SSS << "\033[0m\n")
#define ROS_BLUE_STREAM(SSS) ROS_INFO_STREAM("\033[34;1m" << SSS << "\033[0m\n")
@bmagyar
bmagyar / ROS_print_in_color.h
Created January 25, 2016 17:31 — forked from artivis/ROS_print_in_color.h
Defining your own ROS stream color
// Defining your own ROS stream color
namespace pc
{
enum PRINT_COLOR
{
BLACK,
RED,
GREEN,
YELLOW,
@bmagyar
bmagyar / generate_collisions.py
Created December 20, 2015 11:57 — forked from awesomebytes/generate_collisions.py
Generate all disable collision lines for moveit srdf model in between a list of links
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 11/16/15
@author: sampfeiffer
generate_collisions.py link_1 link_2 link_3
Generates the lines to add to the moveit config <robot>.srdf in