Skip to content

Instantly share code, notes, and snippets.

View JeroenDM's full-sized avatar

Jeroen JeroenDM

  • KU Leuven
  • Belgium
View GitHub Profile
@JeroenDM
JeroenDM / task.json
Created May 11, 2017 15:50
The task settings I use for cpp programming in vscode. Build with ctrl+shift+b and run with F8. Based on several tutorials out there when googling vscode c++ tasks.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"tasks": [
{
"taskName": "build",
"command": "g++",
"isShellCommand": true,
"isBuildCommand": true,
@JeroenDM
JeroenDM / callback_example.cpp
Created May 17, 2017 18:54
Test Boost.Function to implement a private callback function in a class
#include <iostream>
#include <boost/function.hpp>
#include <vector>
using namespace std;
// Simple Point class
class Point
{
int _value;
% Uses the robotics toolbox from Peter I, Corke
% http://www.petercorke.com
% Robot model from the classic Puma 560
% https://en.wikipedia.org/wiki/Programmable_Universal_Machine_for_Assembly
% video on youtube: https://www.youtube.com/watch?v=uSICxNwDfn0&feature=youtu.be
% Calculate inverse kinematics for a given cartesion path
Ta = transl(-0.2, 0, 0.2) * angvec2tr(pi / 4, [0 1 0]) * transl(0.5, -0.5, 0.5); % define the start point
Tb = angvec2tr(pi / 4, [0 1 0]) * transl(0.5, -0.5, 0.5);
@JeroenDM
JeroenDM / read_file.cpp
Created January 12, 2018 10:08
I always forget how to read files with numbers in c++.
void read_file(std::string filename) {
// open file
std::ifstream infile(filename);
// check if opened succesfull
if (!infile) std::cout << "Failed to open file." << std::endl;
// read line by line and save in temporary string "line"
std::string line;
while(infile) {
~catkin build
---------------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/kinetic
Workspace: /home/jeroen/ros/catkin_ws
---------------------------------------------------------------
Source Space: [exists] /home/jeroen/ros/catkin_ws/src
Log Space: [missing] /home/jeroen/ros/catkin_ws/logs
Build Space: [exists] /home/jeroen/ros/catkin_ws/build
Devel Space: [exists] /home/jeroen/ros/catkin_ws/devel
@JeroenDM
JeroenDM / descartes_build_error_kinetic.md
Last active June 21, 2018 15:48
Complete build error for issue #226
jeroendm@laptop-jeroen:~/ros/ws_descartes$ catkin build
--------------------------------------------------------------------
Profile:                     default
Extending:             [env] /opt/ros/kinetic
Workspace:                   /home/jeroendm/ros/ws_descartes
--------------------------------------------------------------------
Source Space:       [exists] /home/jeroendm/ros/ws_descartes/src
Log Space:         [missing] /home/jeroendm/ros/ws_descartes/logs
Build Space:        [exists] /home/jeroendm/ros/ws_descartes/build
Invocation failed without any known error condition, printing all lines to debug known error detection:
1 'Reading package lists...'
2 'Building dependency tree...'
3 'Reading state information...'
4 'Starting pkgProblemResolver with broken count: 5'
5 'Starting 2 pkgProblemResolver with broken count: 5'
6 'Investigating (0) ros-melodic-catkin:amd64 < none -> 0.7.23-1bionic.20200303.045725 @un puN Ib >'
7 'Broken ros-melodic-catkin:amd64 Depends on python-catkin-pkg:amd64 < none | 0.4.19-100 @un uH > (> 0.4.3)'
8 ' Considering python-catkin-pkg:amd64 1 as a solution to ros-melodic-catkin:amd64 10033'
9 ' Re-Instated tzdata:amd64'
@JeroenDM
JeroenDM / moveit_ik_plugin_comparison
Created July 29, 2020 09:57
Compare the default KDL plugin with the OPW kinematics plugin for the Kuka KR5 using `rosrun moveit_ros_planning moveit_kinematics_speed_and_validity_evaluator manipulator`
~rosrun moveit_ros_planning moveit_kinematics_speed_and_validity_evaluator manipulator
ros.moveit_core.robot_model: Loading robot model 'kuka_kr5_arc'...
ros.moveit_core.robot_model: No root/virtual joint specified in SRDF. Assuming fixed joint
ros.moveit_opw_kinematics_plugin.opw: MoveItOPWKinematicsPlugin initializing
ros.moveit_opw_kinematics_plugin.opw: Dimension planning group 'manipulator': 6. Active Joints Models: 6. Mimic Joint Models: 0
ros.moveit_opw_kinematics_plugin: Getting kinematic parameters from parameter server.
ros.moveit_opw_kinematics_plugin: Loaded parameters for ik solver:
Distances: [0.18 -0.12 0 0.4 0.6 0.62 0.115]
Offsets = [0 -1.5708 0 0 0 0 ]
Sign_corrections = [-1 1 1 -1 1 -1 ]
$ valgrind --leak-check=full ./devel/lib/moveit_planners_ompl/test_state_validity_checker
==8746== Memcheck, a memory error detector
==8746== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==8746== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==8746== Command: ./devel/lib/moveit_planners_ompl/test_state_validity_checker
==8746==
[==========] Running 3 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 3 tests from PandaValidityCheckerTests
[ RUN ] PandaValidityCheckerTests.createStateValidityChecker
In file included from /home/jeroen/ros/moveit_ws/src/moveit/moveit_planners/ompl/ompl_interface/src/detail/state_validity_checker.cpp:37:
/home/jeroen/ros/moveit_ws/src/moveit/moveit_planners/ompl/ompl_interface/include/moveit/ompl_interface/detail/state_validity_checker.h:64:8: warning: 'ompl_interface::StateValidityChecker::isValid' hides overloaded virtual function [-Woverloaded-virtual]
bool isValid(const ompl::base::State* state, bool verbose) const;
^
/home/jeroen/ros/moveit_ws/devel/include/ompl-1.5/ompl/base/StateValidityChecker.h:128:26: note: hidden overloaded virtual function 'ompl::base::StateValidityChecker::isValid' declared here: different number of parameters (4 vs 2)
virtual bool isValid(const State *state, double &dist, State *validState, bool &validStateAvailable) const
^
In file included from /home/jeroen/ros/moveit_ws/src/moveit/moveit_planners/ompl/ompl_interface/src/detail/state_validity_checker.cpp:37:
/home/jeroen/ros/moveit_ws/src/moveit/