considering:
- https://github.com/whoever/whatever.git is the address of original repo
- https://github.com/youraccount/whatever.git is the address of fork repo
clone your fork if you haven't cloned already
| #!/bin/bash | |
| ################################################################################################### | |
| # Bash script to import CMake project from Github and create local Eclipse CDT compatible project # | |
| # # | |
| # The CMake Eclipse CDT strategy was taken from here: https://stackoverflow.com/a/9663686/3055724 # | |
| # After run this script you need to import the project in eclipse: # | |
| # File->Import->C/C++->Existing code as Makefile Project->Next # | |
| # Tested in Eclise Oxygen and Luna # | |
| ################################################################################################### |
| void setup() { | |
| Serial.begin(9600); | |
| } | |
| void loop() { | |
| byte close[] = {0xA0, 0x01, 0x01, 0xA2}; | |
| Serial.write(close, sizeof(close)); | |
| delay(2000); | |
| byte open[] = {0xA0, 0x01, 0x00, 0xA1}; |
| // inverse kinematics | |
| // helper functions, calculates angle theta1 (for YZ-pane) | |
| int delta_calcAngleYZ(float x0, float y0, float z0, float &theta) { | |
| float y1 = -0.5 * 0.57735 * f; // f/2 * tg 30 | |
| y0 -= 0.5 * 0.57735 * e; // shift center to edge | |
| // z = a + b*y | |
| float a = (x0*x0 + y0*y0 + z0*z0 +rf*rf - re*re - y1*y1)/(2*z0); | |
| float b = (y1-y0)/z0; | |
| // discriminant | |
| float d = -(a+b*y1)*(a+b*y1)+rf*(b*b*rf+rf); |
considering:
clone your fork if you haven't cloned already
This instructions are intended to run on any linux debian, using Ubuntu 20.04 here.
The ECLiPSe prolog website is https://eclipseclp.org/index.html
Disclaimer: ECLiPSe prolog is not Eclipse IDE !
as usual, update the machine
| import cv2 | |
| net = cv2.dnn.readNet('yolov5s.onnx') |
| #include <opencv2/opencv.hpp> | |
| int main(int, char **) | |
| { | |
| auto net = cv::dnn::readNet("yolov5s.onnx"); | |
| return 0; | |
| } |
| def format_yolov5(source): | |
| # put the image in square big enough | |
| col, row, _ = source.shape | |
| _max = max(col, row) | |
| resized = np.zeros((_max, _max, 3), np.uint8) | |
| resized[0:col, 0:row] = source | |
| # resize to 640x640, normalize to [0,1[ and swap Red and Blue channels | |
| result = cv2.dnn.blobFromImage(resized, 1/255.0, (640, 640), swapRB=True) |
| cv::Mat format_yolov5(const cv::Mat &source) { | |
| // put the image in a square big enough | |
| int col = source.cols; | |
| int row = source.rows; | |
| int _max = MAX(col, row); | |
| cv::Mat resized = cv::Mat::zeros(_max, _max, CV_8UC3); | |
| source.copyTo(resized(cv::Rect(0, 0, col, row))); | |
| // resize to 640x640, normalize to [0,1[ and swap Red and Blue channels |
| predictions = net.forward() | |
| output = predictions[0] |