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
Servo | Min Actuator | Max Actuator | Min Joint | Max Joint | |
---|---|---|---|---|---|
Base | 128 | 33 | -pi/4 (-45°) | pi/4 (+45°) | |
Shoulder | 135 | 35 | pi/4 (+45°) | 3*pi/4 (+135°) | |
Elbow | 135 | 45 | pi/4 (+45°) | -pi/4 (-45°) | |
Claw | 14 | 41 | pi/2 (+90°) | 0 (0°) |
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
Servo | Min Actuator | Max Actuator | Min Joint | Max Joint | |
---|---|---|---|---|---|
Base | 145 | 49 | -pi/4 (-45°) | pi/4 (+45°) | |
Shoulder | 118 | 22 | pi/4 (+45°) | 3*pi/4 (+135°) | |
Elbow | 144 | 36 | pi/4 (+45°) | -pi/4 (-45°) | |
Claw | 75 | 115 | pi/2 (+90°) | 0 (0°) |
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
/** | |
* @see https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html | |
*/ | |
const generatePolicy = (principalId, effect, resource, context) => ({ | |
context, | |
policyDocument: { | |
Version: '2012-10-17', | |
Statement: [ | |
{ | |
Action: 'execute-api:Invoke', |
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 jwkToPem from 'jwk-to-pem'; | |
// Simple in-memory cache, optional. In this Lambda it will always have a single promise stored because Region and User | |
// Pool ID are taken from the environment variables and remain unchanged within the life cycle of the Lambda, but I | |
// still kept this flexible in case someone will copy the code. Subject for improvement. | |
const getPemEncodedPublicKeysPromisesCache = new Map(); | |
const getPemEncodedPublicKeysImplementation = async (jwksUrl) => { | |
console.log('jwksUrl', jwksUrl); |
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 { decode, verify } from 'jsonwebtoken'; | |
export const verifyToken = async (region, userPoolId, token) => { | |
var decodedJwt = decode(token, { complete: true }); | |
if (!decodedJwt || !decodedJwt.header || !decodedJwt.header.kid) { | |
return null; | |
} | |
const pemEncodedPublicKeys = await getPemEncodedPublicKeys(region, userPoolId); |
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 { defaultProvider } from '@aws-sdk/credential-provider-node'; | |
import { Hash } from '@aws-sdk/hash-node'; | |
import { HttpRequest } from '@aws-sdk/protocol-http'; | |
import { SignatureV4 } from '@aws-sdk/signature-v4'; | |
import { URL } from 'url'; | |
export const sign = async (region, url, query = {}, headers = {}) => { | |
const urlObject = new URL(url); | |
// Add query parameters passed as argument, if any. |
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
[env:nodemcuv2] | |
platform = espressif8266 | |
board = nodemcuv2 | |
framework = arduino | |
monitor_filters = esp8266_exception_decoder | |
upload_protocol = espota | |
upload_port = connected-espresso-machine.local | |
lib_deps = |
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 "ArduinoOTA.h" | |
#include "EspressoMachine.h" | |
#include "WiFiManager.h" | |
#define SERIAL_BAUDRATE 9600 | |
#define WIFI_HOSTNAME "Connected-Espresso-Machine" | |
#define WIFI_ACCESS_POINT_SSID "Connected-Espresso-Machine" | |
#define OTA_UPDATES_HOSTNAME "connected-espresso-machine" |
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 "ArduinoOTA.h" | |
// ... | |
#define OTA_UPDATES_HOSTNAME "connected-espresso-machine" | |
// ... | |
/** | |
* @see https://github.com/esp8266/Arduino/blob/master/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino |
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 "WiFiManager.h" | |
// ... | |
#define WIFI_HOSTNAME "Connected-Espresso-Machine" | |
#define WIFI_ACCESS_POINT_SSID "Connected-Espresso-Machine" | |
// ... | |
/** |
NewerOlder