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/python3 | |
import tkinter as tk; | |
import datetime | |
competitionDay = datetime.date(year = 2016, month = 3, day = 11) | |
competitionTimes = [ | |
datetime.time(hour = 9, minute = 00, second = 0), | |
datetime.time(hour = 10, minute = 51, second = 0), | |
datetime.time(hour = 11, minute = 50, second = 0), |
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
struct pidControlState { | |
/* Controller parameters */ | |
float kp; | |
float ti; | |
float td; | |
/* Loop parameter */ | |
float setpoint; | |
float output; |
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
var canvas_actual = document.getElementById('canvas_actual'); | |
var canvas_occ = document.getElementById('canvas_occupancy'); | |
var ctx_actual = canvas_actual.getContext('2d'); | |
var ctx_occ = canvas_occ.getContext('2d'); | |
var map_scale = 10; // cm per grid square side | |
var beam_dist_grid = 400; // 400 grid squares long | |
var beam_dist_actual = beam_dist_grid * map_scale; // ... in cm | |
var base_point = {x:300, y:300} |
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
struct controlState { | |
signed char leftDrive; /* Raw Ch3 from stick */ | |
signed char rightDrive; /* Raw Ch2 from stick */ | |
bool linSysUp; /* Button 7U */ | |
bool linSysDown; /* Button 7D */ | |
bool armUp; /* Button 6U */ | |
bool armDown; /* Button 6D */ |
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 math | |
import numpy as np | |
import tensorflow as tf | |
import keras | |
import keras.backend as K | |
from keras.models import Sequential | |
from keras.initializers import lecun_normal | |
from keras.layers import Dense, AlphaDropout | |
import gym |
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 math | |
def print_response_data(data): | |
for frame in range(0, len(data), 8): | |
s = '' | |
for b in data[frame:frame+8]: | |
s += '{:02x} '.format(b) | |
print('{:02x}: {}'.format(frame, s)) | |
# Commands that can be sent to RPLIDARs. |
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
#pragma config(Sensor, dgtl1, quad1, sensorQuadEncoder) | |
#pragma config(Sensor, dgtl3, quad2, sensorQuadEncoder) | |
#pragma config(Motor, port2, m1, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port3, m2, tmotorVex393_MC29, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
signed char readUART(TUARTs port) { | |
signed char val; | |
while((val = getChar(port)) == -1) { | |
sleep(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
import pygame | |
import numpy as np | |
import math | |
import sys | |
import random | |
pygame.init() | |
bullets = pygame.sprite.Group() | |
player_group = pygame.sprite.Group() |
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
#pragma config(UART_Usage, UART1, uartUserControl, baudRate9600, IOPins, None, None) | |
#pragma config(UART_Usage, UART2, uartUserControl, baudRate9600, IOPins, None, None) | |
#pragma config(I2C_Usage, I2C1, i2cSensors) | |
#pragma config(Sensor, I2C_1, enc1, sensorQuadEncoderOnI2CPort, , AutoAssign ) | |
#pragma config(Sensor, I2C_2, enc2, sensorQuadEncoderOnI2CPort, , AutoAssign ) | |
#pragma config(Motor, port1, motor2, tmotorVex393_HBridge, openLoop) | |
#pragma config(Motor, port10, motor1, tmotorVex393_HBridge, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
short waitForChar(short port) { |
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
For future reference, this is how I updated KKL using the previous KKL version (v68) and the latest Kisekae from online: | |
- Grab k_kisekae2.swf and all of the other swfs loaded by it first. Each file you'll need to grab corresponds to an entry in Main.loadName or Main.loadItemName within k_kisekae2.swf. | |
(All of the subordinate swf files can be found under http://pochi.lix.jp/k_kisekae2_swf/ -- you can simply wget them or similar. They'll go into a local k_kisekae2_swf directory.) | |
- Take a copy of the previous KKL version and replace its version of k_kisekae2.swf with the latest version, then open it and kkl.swf up in JPEXS. | |
- Start by updating Main.version, Main.loadName, and Main.loadItemName in kkl.swf to match k_kisekae2.swf. | |
(This should just involve simple copy-pasting of P-code from k_kisekae2.swf to kkl.swf.) | |
- From there, it's a cycle of: attempt to run KKL > see what causes errors > fix said errors > repeat | |
- The AIRSDK includes a tool called `adl`. It'll allow you to run KKL in debugging |
OlderNewer