This file contains hidden or 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 sys | |
import rospy | |
import rosbag | |
import cv2 | |
from sensor_msgs.msg import Image | |
from cv_bridge import CvBridge, CvBridgeError | |
def save_images_from_rosbag(rosbag_file, topic_name, output_file): |
This file contains hidden or 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 cv2 | |
#assert cv2.__version__[0] == '3', 'The fisheye module requires opencv version >= 3.0.0' | |
import numpy as np | |
import os | |
import glob | |
CHECKERBOARD = (7,10) | |
subpix_criteria = (cv2.TERM_CRITERIA_EPS+cv2.TERM_CRITERIA_MAX_ITER, 30, 0.1) | |
calibration_flags = cv2.fisheye.CALIB_RECOMPUTE_EXTRINSIC+cv2.fisheye.CALIB_CHECK_COND+cv2.fisheye.CALIB_FIX_SKEW | |
# calibration_flags = cv2.fisheye.CALIB_RECOMPUTE_EXTRINSIC+cv2.fisheye.CALIB_FIX_SKEW | |
objp = np.zeros((1, CHECKERBOARD[0]*CHECKERBOARD[1], 3), np.float32) |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# Copyright 2016 Massachusetts Institute of Technology | |
"""Extract images from a rosbag. | |
""" | |
import os | |
import argparse |
This file contains hidden or 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
/** | |
* | |
*/ | |
const int dirPin = 8; | |
const int stepPin = 9; | |
const int enablePin = 7; | |
const int sw = 6; | |
const int delayMicros = 500; //Delay between each step | |
const int maximumSteps = 230; |
This file contains hidden or 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 <AccelStepper.h> | |
const int StepPin = 9; | |
const int DirPin = 8; | |
const int EnablePin = 7; | |
AccelStepper stepper(AccelStepper::DRIVER, StepPin, DirPin, 0, 0, true); |
This file contains hidden or 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
const int dirPin = 8; | |
const int stepPin = 9; | |
const int enablePin = 7; | |
void setup() { | |
pinMode(enablePin, OUTPUT); | |
pinMode(stepPin, OUTPUT); | |
pinMode(dirPin, OUTPUT); | |
digitalWrite(enablePin, LOW); |
This file contains hidden or 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
/** | |
ตัวอย่างการใช้ PS2 Wireless กับ Arduino | |
PS2X_lib | |
ในการอ่านค่า joy PS2 ของร้าน Modulemore | |
โดยต่อ | |
UNO R3 --- > PS2 adapter | |
GND - GND | |
5v - VCC | |
D3 - DAT | |
D4 - CMD |
This file contains hidden or 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
/** | |
* Smart farm simple version | |
* Control 2 motor with RC remote | |
* Right horizontal stick control throttle | |
* Left vertical stick control steering | |
* Created by : ModuleMore.com | |
*/ | |
#include <Arduino.h> | |
This file contains hidden or 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
/* -------------------------------------------------------------------------- */ | |
/* ModuleMore AM2306 (Modbus) Example code */ | |
/* -------------------------------------------------------------------------- */ | |
/* ------------------------------- วิธีการต่อ ------------------------------- */ | |
/** | |
* ESP8266 ---> MAX485 ---> AM2306 | |
* 5V 5V RED | |
* GND GND BLACK | |
* - RE (ต่อกับDE) |
This file contains hidden or 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
/* -------------------------------------------------------------------------- */ | |
/* ModuleMore AM2306 (Modbus) Example code */ | |
/* -------------------------------------------------------------------------- */ | |
/* ------------------------------- วิธีการต่อ ------------------------------- */ | |
/** | |
* ESP8266 ---> MAX485 ---> AM2306 | |
* 5V 5V RED | |
* GND GND BLACK | |
* - RE (ต่อกับDE) |