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
# pip3 install pyserial | |
import time | |
import serial | |
import rclpy | |
import threading | |
from rclpy.node import Node | |
from std_msgs.msg import Int32 | |
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
# Quick start | |
# Install dependencies: pip3 install rosinstall_generator vcstool colcon-common-extensions; sudo -H pip3 install rosdep | |
# Install the script: curl https://gist.githubusercontent.com/lukicdarkoo/d03196b15367b804b27c142dad8644e9/raw/503201cc3b2a86c61dfb4f3cf1cc761cbc096bff/rospm.sh >> $HOME/.bashrc; exec bash | |
rospm-install() { | |
# This tool combines `rosinstall_generator`, `vcs` and `colcon` to | |
# easily install package in a custom ROS workspace | |
# Set default parameters | |
PACKAGE_NAME=$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
#include <inttypes.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <string.h> | |
const char PROPRIETARY = 'P'; | |
const char MANUFACTURER_IDENTIFIER[] = "UWV"; | |
#define NMEA0183_OUT_OF_RANGE -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
// Reference: https://www.geeksforgeeks.org/hamming-code-in-computer-network/ | |
#include <inttypes.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#define PRINT_BITS(x) \ | |
for (int i = sizeof(x) << 3; i; i--) \ | |
putchar('0' + (((x) >> (i - 1)) & 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
#include "circbuff.h" | |
void circbuff_init(circbuff_t *circbuff) { | |
circbuff->end_bit = 0; | |
circbuff->end_byte = 0; | |
circbuff->start_bit = 0; | |
circbuff->start_byte = 0; | |
} | |
uint8_t circbuff_size(circbuff_t *circbuff) { |
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 sys | |
import time | |
import smtplib | |
import logging | |
from pyquery import PyQuery | |
from requests_html import HTMLSession | |
logging.basicConfig(filename='isa.log', format='[%(asctime)s] %(message)s', filemode='w', level=logging.INFO) | |
logger = logging.getLogger('isa') |
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 re | |
from functools import reduce | |
def nmea0183_create(arguments, proprietary='P', manufacturer_identifier='UWV'): | |
""" | |
Create NMEА0183 sentence | |
Parameters | |
---------- |
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
sudo su | |
echo 'g_serial' >> etc/modules | |
echo 'ttyGS0' >> etc/securetty | |
echo 'echo 2 > /sys/bus/platform/devices/sunxi_usb_udc/otg_role' > etc/init.d/otg_config.sh | |
chmod +x etc/init.d/otg_config.sh |
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
#include <math.h> | |
#include <stdio.h> | |
typedef struct _complex { | |
double imag; | |
double real; | |
} complex_t; | |
const int SAMPLE_RATE = 160E3; | |
const float FREQUENCY = 40E3; |
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
#include "stdio.h" | |
#include "sonar.h" | |
int main() { | |
float symbol[] = { 0.13545444218373617, 0.06881865114264074, 0.1435361586761664, 0.1748921999328592, 0.021482698616699204, 0.05181458327897204, 0.19727342985895033, 0.07068028111428455, 0.10442642349850652, 0.07397413931047846, 0.050278495886241045, 0.06736349405231731, 3.8110146724237617, 2.1771302499993337, -1.830551718201271, -1.619008391744408, 0.5797330871737123, 0.46868678568291017, -0.2979215770842604, 0.6410885473557744 }; | |
int xclass = eml_net_predict(&sonar, symbol, 20); | |
printf("Predicted class: %d\n", xclass); | |
} |