Skip to content

Instantly share code, notes, and snippets.

💭
Doing DevOps stuff for Gentoo Prefix + ROS

Sam Pfeiffer awesomebytes

💭
Doing DevOps stuff for Gentoo Prefix + ROS
Block or report user

Report or block awesomebytes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View visualize_locations.py
#!/usr/bin/env python
import rospy
from visualization_msgs.msg import Marker, MarkerArray
from geometry_msgs.msg import Pose, PoseArray, PoseStamped, Point, Quaternion
from tf.transformations import quaternion_from_euler
from std_msgs.msg import ColorRGBA
View launcher_config.yaml
apps:
- name: X
type: special
- name: Stand
type: special
- name: Rest
type: special
- name: Rosbag map
type: script
script: cd /home/nao; rosbag record /pepper/camera/front/image_raw /pepper/camera/front/camera_info /pepper/camera/depth/image_raw /pepper/camera/depth/camera_info /pepper/camera/depth_scaled/image_raw /pepper/camera/depth_scaled/camera_info /tf /pepper_odom /pepper/laser_scan /pepper/imu/base -o robocup2019_preliminar
@awesomebytes
awesomebytes / radial_search_in_matrix.py
Created Jun 23, 2019
Search in a grid in a radial fashion, making circles around the central point going out once cell further on every iteration on a numpy matrix
View radial_search_in_matrix.py
from itertools import product
# Author: Sammy Pfeiffer <Sammy.Pfeiffer at student.uts.edu.au>
# Note:
# the coords could be created taking into account the matrix
# bounds and stop exploring a direction when the bounds are hit
# but it is not implemented here as this good enough for now
@awesomebytes
awesomebytes / svg_image_app.py
Created Jun 21, 2019
POC of loading an image into a Svg canvas in REMI
View svg_image_app.py
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
View test_svg_img.py
#!/usr/bin/env python
import remi.gui as gui
from remi import start, App
img_b64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAroAAAA8CAYAAACJixn1AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACW9GRnMAAAAJAAAACgAHyg+MAAAACXZwQWcAAALiAAAARwBm+c9rAAAoqklEQVR42u2deXwV5dX4v0NiNnKD7CQkLMEkBgTc2DdBQFFAEQHrVvdaRG1d3letdXnbV1ul+mutu1XQYn1bQQEXAggJiAKyixLZg2xJWJJKNhIyvz8mSW+Su8xy5t65uff7+aDJned55jyTc2fOnOc85yhY5PzsaycBixS3zxTV7WfURu0Vjz+rjT5vOKYaG8PjMfU/xxWfY6jVwD7gEwVeyt25aL/Va+OJ8edcOVSBKcAwIFOBs4EoNzl8z1NVvR/Te620MaoUOAEcAzYqkAcsXLA356TEPGf0HBujwDJgpJfrTf3/vM3F19+s0VzNjXFam796HNgC5Coqi988kFcoMX893Js2fCgwBdRhCmRSpwuNvz9u1wqD8/TyPfTwXatCuxbHFNhInS784dA6EV1oypPJF6cBMxQYC5wHdABi3eeq937gsZ3Be0Hzts3G/9dDhVun+5vXi536bQQu1CcjoPrU75dnFW+fZfYav96h93nAt7qulYqe6/H3W4//cJNROd5rlzkD1A90XW+fcuj/m3m/Hxi4dzYf49+gbgLeU+DdSaUFNUavhZPIS0xOA64CLlGgD9AVSFQapu3hWjV6tPh9nja5dmwHFirw5sCyIlvuK+5sjW/fToFBoGYAbYAoz/cDfzrRbC7uP58BSlDVE8BuBTZlVpVW2zGf/TGJLyrwK58yqt6O1dPsb3YS6JBcX
@awesomebytes
awesomebytes / ssh_thru_machine.md
Created Jun 21, 2019
How to ssh into machine hopping thru another one (and send X forwarded too)
View ssh_thru_machine.md

How to ssh into machine hopping thru another one (and send X forwarded too)

Using -v to see what is going on, -Y to forward X and -J to do the hop (needs OpenSSH 7.3+).

ssh -v -Y -J user@intermediatemachine user@finalmachine
@awesomebytes
awesomebytes / camera_republisher.py
Created Jun 7, 2019
A node with Dynamic Reconfigure to re-publish an image topic with CameraInfo and with a custom TF transform (useful to quick-test calibrations by hand)
View camera_republisher.py
#!/usr/bin/env python
from copy import deepcopy
import sys
import math
import rospy
from sensor_msgs.msg import Image, CameraInfo
from tf.transformations import quaternion_from_euler
from ddynamic_reconfigure_python.ddynamic_reconfigure import DDynamicReconfigure
from tf import TransformBroadcaster
@awesomebytes
awesomebytes / update_ws_repos.py
Created May 30, 2019
Update the repos in the workspace. Place this script in the workspace that contains Git repos and execute it.
View update_ws_repos.py
#!/usr/bin/env python
import os
for directory in os.listdir("."):
if os.path.isdir(directory):
print("Git pull-ing in: " + str(directory))
os.system("cd " + str(directory) + "; git pull")
print("Done.")
@awesomebytes
awesomebytes / twist_gains.py
Created May 30, 2019
Script to act as a man-in-the-middle for TwistStamped messages to apply gains and max values to linear.x and angular.z (Used for increasing/decreasing values sent to a car for safety and fixing of bugs. Our car needed a 25x gain on angular.z to turn).
View twist_gains.py
#!/usr/bin/env python
import math
import rospy
from geometry_msgs.msg import TwistStamped
# Needs ros-DISTRO-ddynamic-reconfigure-python
from ddynamic_reconfigure_python.ddynamic_reconfigure import DDynamicReconfigure
"""
Class that acts as a man-in-the-middle node
@awesomebytes
awesomebytes / rtabmap_pauser.py
Last active May 16, 2019
Class to pause rtabmap
View rtabmap_pauser.py
#!/usr/bin/env python
import os
from copy import deepcopy
import rospy
from tf2_msgs.msg import TFMessage
"""
Hacky class that pauses RTABMAP nodes
You can’t perform that action at this time.