Skip to content

Instantly share code, notes, and snippets.

@clalancette
clalancette / delete-lunar
Created July 10, 2019 14:14
groovy script to delete lunar
import hudson.model.Cause
count = 0
for (p in Jenkins.instance.allItems) {
if (
(
p.name.startsWith("lunar_") ||
p.name.startsWith("Lsrc_") ||
p.name.startsWith("Lbin_") ||
@clalancette
clalancette / disable-lunar
Created July 10, 2019 14:17
groovy script to disable lunar jobs
import hudson.model.Cause
count = 0
for (p in Jenkins.instance.allItems) {
if (
(
p.name.startsWith("lunar_") ||
p.name.startsWith("Lsrc_") ||
p.name.startsWith("Lbin_") ||
@clalancette
clalancette / disable-indigo
Last active July 10, 2019 16:01
groovy script to disable indigo jobs
import hudson.model.Cause
count = 0
for (p in Jenkins.instance.allItems) {
if (
(
p.name.startsWith("indigo_") ||
p.name.startsWith("Isrc_") ||
p.name.startsWith("Ibin_") ||
@clalancette
clalancette / delete-indigo
Last active July 10, 2019 16:01
groovy script to delete indigo
import hudson.model.Cause
count = 0
for (p in Jenkins.instance.allItems) {
if (
(
p.name.startsWith("indigo_") ||
p.name.startsWith("Isrc_") ||
p.name.startsWith("Ibin_") ||
@clalancette
clalancette / ros-sync-remove-dbgsym.py
Created September 11, 2019 13:37
Python script to remove dbgsym packages from ROS sync notices and recalculate package numbers
#!/usr/bin/python3
import sys
if len(sys.argv) != 3:
print("Usage: %s <input> <distro>" % (sys.argv[0]))
sys.exit(1)
infile = sys.argv[1]
distro = sys.argv[2]
@clalancette
clalancette / get_unique_node_name
Created December 5, 2019 19:49
Alternative implementation of get_unique_node_name for https://github.com/ros2/geometry2/pull/182
std::string get_unique_node_name()
{
const static std::string chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
static std::random_device rd;
static std::minstd_rand g{rd()};
// The uniform_int_distribution takes a closed interval of [a, b]; since that
// would include the \0, we remove one from our string length.
static std::uniform_int_distribution<std::string::size_type> pick(0, chars.length() - 1);
@clalancette
clalancette / clang-tidy.bash
Created January 6, 2020 16:04
clang-tidy bash script to check ROS 2 packages
#!/bin/bash -xe
# FIXME: arguments to ignore certain files
usage() {
echo "Usage: $0 [OPTIONS]"
echo " OPTIONS:"
echo " -a <arg> Add any additional arguments to the clang-tidy command-line"
echo " -c <arg> Skip additional checks"
echo " -h Show this help message"
@clalancette
clalancette / end_to_enu
Last active January 28, 2020 15:58
NED to ENU
#include <cmath>
#include <cstdio>
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2/LinearMath/Quaternion.h>
void print_quat(double x, double y, double z, double w)
{
tf2::Quaternion quat(x, y, z, w);
fprintf(stderr, "Quaternion:\n");
@clalancette
clalancette / ned-to-emu
Created January 28, 2020 20:12
ned-to-emu
#include <cmath>
#include <cstdio>
#include <tf2/LinearMath/Matrix3x3.h>
#include <tf2/LinearMath/Quaternion.h>
void print_quat(double x, double y, double z, double w)
{
tf2::Quaternion quat(x, y, z, w);
fprintf(stderr, "Quaternion:\n");
@clalancette
clalancette / pc_pipe_full.repos
Last active April 1, 2020 18:05
A full repos file for reproducing lost messages in the ROS 2 pipeline
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint: