Skip to content

Instantly share code, notes, and snippets.

View felixvd's full-sized avatar

Felix von Drigalski felixvd

  • Mujin Inc.
  • Tokyo, Japan
View GitHub Profile
@felixvd
felixvd / matecat_hotkey.js
Last active November 10, 2020 13:33 — forked from hsperr/matecat_hotkey.js
Greasemonkey/Tampermonkey script to add hotkeys to the Review mode of Matecat.
//Author: Henning Sperr <henning.sperr@gmail.com>
// License: BSD 3 clause
// ==UserScript==
// @name Matecat Review Hotkeys
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author Henning Sperr
@felixvd
felixvd / SeriesVONA_translationcheck.py
Last active February 3, 2016 11:52
Excel checker
import pandas as pd
import re
indf = pd.read_excel("inputfile.xlsx")
# Build a data frame with source and target segments
df = pd.concat([indf.Japanese, indf.German], axis = 1)
df.columns = ["Source", "Target"]
# Check if model numbers in source are also in target and vice versa
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "iiwa_msgs/JointPosition.h"
#include "iiwa_msgs/JointQuantity.h"
#include "conversions.h"
#include "iiwa_ros.h"
/**
* This is copied from the tutorial
*/
@felixvd
felixvd / gist:9b79be2bd10cc615e980f389bab2096d
Created September 11, 2018 03:32
Testing stubs for named frames in MoveIt planning scene
bool moveToCartPose(geometry_msgs::PoseStamped pose, std::string robot_name, bool wait, std::string end_effector_link, double velocity_scaling_factor)
{
moveit::planning_interface::MoveGroupInterface::Plan myplan;
moveit::planning_interface::MoveItErrorCode
success_plan = moveit_msgs::MoveItErrorCodes::FAILURE,
motion_done = moveit_msgs::MoveItErrorCodes::FAILURE;
moveit::planning_interface::MoveGroupInterface* group_pointer;
group_pointer = robotNameToMoveGroup(robot_name);
@felixvd
felixvd / wait_for_program.h
Last active November 14, 2019 17:38
A header file to wait for UR robots to complete a UR script program sent via ROS.
#pragma once
// This header file can be copied into the folder ur_modern_driver/include/ur_modern_driver
// of the ur_modern_driver ROS package and included in your program for convenience.
// It waits for a program to be completed on the UR controller.
// Note that this is useful mostly for custom scripts. A move command sent through
// ur_modern_driver/MoveIt will stay active on the UR controller, and the wait will time out.
#include "ros/ros.h"
#include "ur_msgs/RobotModeDataMsg.h"
@felixvd
felixvd / subframes_tutorial.cpp
Last active January 24, 2020 20:30
Sandbox for testing subframes and attached objects
/*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2019, Felix von Drigalski
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@felixvd
felixvd / connect_to_robots.launch
Created January 25, 2020 14:21
Extract from the launch file starting up ur_robot_driver nodes
<!-- Robot parameters that are separate for a_bot and b_bot -->
<arg name="robot_ip_a" default="192.168.0.41"/>
<arg name="robot_ip_b" default="192.168.0.42"/>
<arg name="reverse_port_a" default="50001" />
<arg name="script_sender_port_a" default="50002" />
<arg name="reverse_port_b" default="50003" doc="Port that will be opened by the driver to allow direct communication between the driver and the robot controller."/>
<arg name="script_sender_port_b" default="50004" doc="The driver will offer an interface to receive the program's URScript on this port. If the robot cannot connect to this port, `External Control` will stop immediately."/>
<arg name="use_tool_communication_a" default="false"/>
<arg name="use_tool_communication_b" default="false" doc="On e-Series robots tool communication can be enabled with this argument"/>
<arg name="tool_device_name_a" default="/tmp/ttyUR_a"/>
root@f092958e2d44:~/ws_moveit/src/moveit_tutorials# ./build_locally.sh
Documenting a catkin package
Documenting moveit_tutorials located here: /root/ws_moveit/src/moveit_tutorials
{'sphinx': {'builder': 'sphinx', 'sphinx_root_dir': '.'}}
Catkin package, no need to generate python paths
Sphinx python path is: /root/ws_moveit/install/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-packages
sphinx-building moveit_tutorials [sphinx-build -a -E -b html . /root/ws_moveit/src/moveit_tutorials/build/html/.]
cwd is /root/ws_moveit/src/moveit_tutorials
stdout:
Running Sphinx v1.6.7
@felixvd
felixvd / gist:993620d534898b1f159014451c97a7a7
Created May 24, 2020 17:31
Debugging code & Error output
Lines 1714-1735:
if (object.operation == moveit_msgs::CollisionObject::ADD && world_->hasObject(object.id))
world_->removeObject(object.id);
ROS_WARN_STREAM("Received collision object with id: " << object.id);
ROS_WARN_STREAM("header.frame_id: " << object.header.frame_id);
const Eigen::Isometry3d& world_to_object_header_transform = getTransforms().getTransform(object.header.frame_id);
ROS_WARN_STREAM("world_to_object_header_transform: ");
@felixvd
felixvd / pointer_reference_example.cpp
Last active June 19, 2020 10:32
Pointer and reference example (C++)
void add_one_to_int(int& number)
{
// This increases the value of the parameter.
// The value will persist outside of the function, because the reference is passed,
// so the memory address is used.
number++;
}
void add_one_to_int_using_pointer(int* number_pointer)
{