This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def open_bagfile(bagfile: Path): | |
reader = rosbag2_py.SequentialReader() | |
storage_options = rosbag2_py.StorageOptions(bagfile.as_posix()) | |
converter_options = rosbag2_py.ConverterOptions("cdr", "cdr") | |
reader.open(storage_options, converter_options) | |
topic_types = reader.get_all_topics_and_types() | |
# Create a map for quicker lookup | |
type_map = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from distutils.core import setup | |
setup(name='yolo', | |
version='1.0', | |
description='yolo v7', | |
author='', | |
author_email='', | |
url='', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: if using this outside ec2, you will need to copy your ~/.aws/credentials into the computer first | |
sudo apt update | |
sudo apt install -y g++ build-essential cmake git htop tree tmux curl openssh-server imagemagick maim vim-gtk3 i3 python3-pip python3-virtualenv libappindicator3-dev castxml qt5-style-plugins trash-cli checkinstall gparted net-tools rename libreadline-dev imagemagick policykit-1-gnome | |
sudo apt upgrade | |
git config --global user.email "peter@`echo $HOSTNAME`" | |
git config --global user.name "peter" | |
sudo apt-get install ubuntu-drivers-common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ros/ros.h> | |
#include <moveit/kinematic_constraints/utils.h> | |
#include <moveit/planning_interface/planning_interface.h> | |
#include <moveit/planning_pipeline/planning_pipeline.h> | |
#include <moveit/planning_scene_monitor/planning_scene_monitor.h> | |
#include <moveit/robot_model_loader/robot_model_loader.h> | |
#include <moveit/robot_state/conversions.h> | |
#include <moveit_msgs/DisplayTrajectory.h> | |
#include <moveit_visual_tools/moveit_visual_tools.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PS3='Choose a workspace type: ' | |
options=("default" "debug") | |
select opt in "${options[@]}" | |
do | |
case $opt in | |
"default") | |
source /home/peter/catkin_ws/devel/setup.bash | |
cd /home/peter/catkin_ws/ | |
catkin profile set default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /opt/ros/noetic/setup.bash | |
mkdir catkin_ws | |
cd catkin_ws | |
mkdir src | |
cd src | |
sudo apt install python3-wstool python3-osrf-pycommon python3-catkin-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import partial | |
from math import sin, cos | |
import numpy as np | |
from ompl import base as ob | |
from ompl import control as oc | |
class MySampleableGoalRegion(ob.GoalSampleableRegion): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from io import BytesIO | |
from geometry_msgs.msg import Point | |
p = Point(x=2, y=4) | |
print(p) | |
buff = BytesIO() | |
p.serialize(buff) | |
serialized_bytes = buff.getvalue() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
import numpy as np | |
from matplotlib.animation import FuncAnimation | |
N = 100 | |
a_max = 0.1 | |
s = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import threading | |
import time | |
import weakref | |
class BadRobot: | |
def __init__(self): | |
self.should_disconnect = False |
NewerOlder