Skip to content

Instantly share code, notes, and snippets.

View atotto's full-sized avatar
🌏
Working from home

Ato Araki atotto

🌏
Working from home
View GitHub Profile
@atotto
atotto / digi_lm61ciz.ino
Created December 19, 2016 01:14
Digispark LM61CIZ Temperature Sensor
#include <DigiUSB.h>
void setup()
{
pinMode(2, INPUT); // P2 = anolog input 1
pinMode(1, OUTPUT);
DigiUSB.begin();
}
void loop()
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 1
#define NUMPIXELS 1
Adafruit_NeoPixel RGBLed = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#include <Servo.h>
#include <ros.h>
#include <sensor_msgs/LaserScan.h>
const int TRIG_PIN = 10;
const int ECHO_PIN = 11;
unsigned long duration;
unsigned int distance;
@atotto
atotto / ros_laser_scanner_example.py
Last active February 20, 2023 21:40
Publishing Sensor Streams Over ROS (python)
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import LaserScan
rospy.init_node('laser_scan_publisher')
scan_pub = rospy.Publisher('scan', LaserScan, queue_size=50)
num_readings = 100
@atotto
atotto / ros_odometry_publisher_example.py
Last active November 8, 2023 10:15
Publishing Odometry Information over ROS (python)
#!/usr/bin/env python
import math
from math import sin, cos, pi
import rospy
import tf
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
def callback(message):
rospy.loginfo("message: (%2.2f %2.2f)", message.linear.x, message.angular.z)
def listener():
rospy.init_node('twist_example')
import time
import math
import bluepy
from bluepy.bluepy import sensortag
MAGNETIC_DECLINATION = 7.0 # Tokyo
print "=== init"
tag = sensortag.SensorTag('XX:XX:XX:XX:XX:XX')
@atotto
atotto / sensortag_example.py
Created September 18, 2016 06:48
sensortag example (bluepy)
import bluepy
from bluepy.bluepy import sensortag
import math
def main():
import time
import sys
import argparse
parser = argparse.ArgumentParser()
@atotto
atotto / example_google-cloud-vision_test.go
Created August 13, 2016 07:42
google cloud vision golang example
package gcv_test
import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
@atotto
atotto / object_detect_with_dlib.py
Last active December 18, 2019 19:15
object detector with dlib
import dlib
import cv2
detector = dlib.simple_object_detector("detector.svm")
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()