Dead simple serial-over-LoRa pipe using Pycom modules.
Note that this example is only half-duplex. You will need to implement some kind of flow control / media access control to be able to use it like a full duplex pipe.
# Put this file somewhere on your path | |
# run `source ros-mdns {master-hostname}` | |
export ROS_MASTER_URI=http://$1.local:11311 | |
export ROS_HOSTNAME=$(hostname).local |
#! /usr/bin/env python | |
import threading | |
from scapy.all import * | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import matplotlib.style | |
from matplotlib import animation | |
import numpy as np |
Dead simple serial-over-LoRa pipe using Pycom modules.
Note that this example is only half-duplex. You will need to implement some kind of flow control / media access control to be able to use it like a full duplex pipe.
import subprocess | |
from time import sleep | |
from mininet.net import Mininet | |
from mininet.node import Host, Switch | |
from mininet.cli import CLI | |
from mininet.link import TCLink | |
from mininet.log import setLogLevel | |
from mininet.topo import Topo |
This is the lookup table linking the transport block size index (determined by modulation and coding scheme) and the number of resource blocks to an LTE transport block size. It's taken from 3GPP [TS 36.213][36.213] (Table 7.1.7.2.1-1) at version 15.0.0. Multiply a TBS by 1000 to get the max throughput in bps.
FROM ubuntu:16.04 | |
RUN apt-get update && apt-get install -y gnuradio-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN apt-get update && apt-get install -y git cmake \ | |
&& git clone git://github.com/BastilleResearch/gr-lora.git \ | |
&& cd gr-lora \ | |
&& mkdir build \ | |
&& cd build \ |
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
} | |
http { | |
sendfile on; |
ROOT=$(realpath $(dirname $0)) | |
LINARO=$ROOT/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf | |
# Use the toolchain | |
export BIN_PREFIX=$LINARO/bin/arm-linux-gnueabihf- | |
export CC=${BIN_PREFIX}gcc | |
export CXX=${BIN_PREFIX}g++ | |
# Compile like $CXX hello_world.cpp -o hello |
x, y, z, _, _, _ = kin.transform_to_pose(self.robot.transform) | |
# Check translation distance | |
# Ensure numeric stability of angle calculation | |
r_2 = np.linalg.norm((x, y, z)) | |
if r_2 < 1e-5: | |
return | |
# Aim at tip frame with givens rotations | |
# First about z (yaw, azimuth) - eliminate y | |
r_1 = np.hypot(x, y) | |
c_1 = x/r_1 |
#ifndef CONNECTION_H | |
#define CONNECTION_H | |
#include <netdb.h> | |
#include <stdexcept> | |
#include <string> | |
#include <sstream> | |
#include <sys/socket.h> | |
#include <deque> |