Skip to content

Instantly share code, notes, and snippets.

View justagist's full-sized avatar
⚠️
raise CoffeeNotFoundError

Saif Sidhik justagist

⚠️
raise CoffeeNotFoundError
View GitHub Profile
@justagist
justagist / bash_extras.sh
Last active March 12, 2024 08:41
personal bash shortcuts
#!/bin/bash
function newdockterm() {
if [ $# -eq 0 ]; then
out=$(docker ps --format "{{.Names}}" | grep "my_workspace")
else
out=$(docker ps --format "{{.Names}}" | grep "$1")
fi
docker exec -it "$out" bash
@justagist
justagist / bash_completion
Last active March 22, 2019 15:02
Bash completion script
# -*- shell-script -*-
#
# bash_completion - programmable completion functions for bash 4.1+
#
# Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
# © 2009-2013, Bash Completion Maintainers
# <bash-completion-devel@lists.alioth.debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@justagist
justagist / proxy_setup.md
Last active January 16, 2023 22:11
Proxy Setup - Ubuntu 18.04 (apt, docker, curl)

Environment proxy variables:

Replace your proxy hostname and port number instead of webcache.cs.bham.ac.uk:3128 below.

Set the following in your .bashrc file:

export HTTP_PROXY=http://webcache.cs.bham.ac.uk:3128
export HTTPS_PROXY=http://webcache.cs.bham.ac.uk:3128
export FTP_PROXY=http://webcache.cs.bham.ac.uk:3128
@justagist
justagist / edit_git_tag
Created May 13, 2020 16:40 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@justagist
justagist / todo_pub.md
Last active June 3, 2021 12:44
Planned updates to public packages
  • Change all sudo pip to pip --user
  • Python 2 + 3 compatibility. Current issue: shebangs for node scripts.
  • Disable switching to default controller if current controller is position controller. (maybe?)
  • GrippperInterface->close() method bug: if gripper is already closed, the method causes the gripper to open instead.
  • Rename set_joint_positions_velocities to set_joint_positions_impedance_ctrl or something more meaningful. Leave old method for backward compatibility.
backburner
@justagist
justagist / base_to_cam_transform.py
Created October 2, 2020 10:05
Utility to compute the transformation matrix between two frames given 4 corresponding points from the two frames. Can be used to get the T matrix defined from the robot base to the camera frame (or vice versa).
import numpy as np
def get_transformation(points1, points2):
"""
Get the transformation matrix that would define
frame 2 wrt frame 1, given 4 points from coordinate
frame 1 and corresponding 4 points from coordinate
frame 2. Can be used to find the camera frame wrt
robot base frame when the end-effector positions are
collected from the robot as well as the camera
@justagist
justagist / railpro_download.py
Last active February 11, 2021 12:24
Download and create a csv or xlsx file containing all the listed companies from railpro.co.uk
"""
Download all listed companies from raipro.co.uk.
Saves to a single csv/xlsx file with columns
"Company Name", "Address", "Phone", "Website"
"""
import re
import urllib.request
import pandas as pd
import html

Keybase proof

I hereby claim:

  • I am justagist on github.
  • I am justagist (https://keybase.io/justagist) on keybase.
  • I have a public key whose fingerprint is 1663 461F FB34 C742 63E7 9880 7464 276E CBA4 DF8E

To claim this, I am signing this object:

@justagist
justagist / hybrid_force_motion_control.py
Last active July 27, 2021 08:58
sample simplified hybrid force-motion code
# feedback control loop for hybrid force motion control (simplified)
def compute_cmd(self, time_elapsed=None):
robot_state = robot.state() # from FRI
# calculate the jacobian of the end effector
jac_ee = robot_state['jacobian']
# get position of the end-effector
curr_pos = robot_state['ee_point']
@justagist
justagist / clear_rosparams.py
Last active December 24, 2021 11:25
Delete ros parameters from server containing strings provided as arguments
#!/usr/bin/env python
import rospy
from argparse import ArgumentParser
COMMON_PARAMS = ["franka", "panda", "controller", "control", "camera", "gazebo", "state", "arm", "robot", "dynamic_reconfigure", "interactive_marker", "sim_time"]
def delete_params_containing(string_list, verbose=False):
"""
Delete ros parameters from server containing strings listed in 'string_list'.