Skip to content

Instantly share code, notes, and snippets.

View awesomebytes's full-sized avatar

Sam Pfeiffer awesomebytes

View GitHub Profile
"""
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.
"""
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.
#!/usr/bin/env python
"""
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,
"""
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.
@awesomebytes
awesomebytes / ring_buffer.py
Last active December 7, 2015 15:42
Python ring buffer
import numpy as np
class RingBuffer():
"A 1D ring buffer using numpy arrays"
def __init__(self, length):
self.data = np.zeros(length, dtype='f')
self.index = 0
def extend(self, x):
"adds array x to ring buffer"
"""
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.
"""
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.
@awesomebytes
awesomebytes / print_weird_laser_readings.py
Last active December 9, 2015 16:13
Print weird laser readings of a LaserScan topic
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
import numpy as np
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
@awesomebytes
awesomebytes / print_weird_laser_readings_with_markers.py
Last active December 14, 2015 15:18
Script that subscribes to a LaserScan topic and shows the problematic readings it may show (NaNs, Infs, closer than range_min, further away than range_max, and others...)
#!/usr/bin/env python
"""
This script subscribes to a LaserScan topic, by default '/scan',
and shows in the terminal statistics of 'weird' laser readings like:
zeros, nans, -inf, +inf, lower than range_min, bigger than range_max
Which are commonly given by different laser manufacturers.
It also publishes a MarkerArray for Rviz at '/scan_problems_marker_array'
which shows the different laser lines that give problems in real time
@awesomebytes
awesomebytes / Install_ubuntu14_dell_xps_13_9350_with_wifi_kernel_4.4.md
Created December 23, 2015 15:40
Install Ubuntu 14.04 on Dell XPS 13 9350 with Broadcom 4350 WIFI working with kernel 4.4-rc6

Install Ubuntu 14.04 on XPS 13 9350 with Broadcom 4350 card

Prepare BIOS

Go to the BIOS (press F12 on boot) > BIOS Setup

On General > Boot Sequence > Boot List Option
I have UEFI

On System Configuration > SATA Operation