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 <krpc/communication.h> | |
#include <krpc/error.h> | |
#if defined(KRPC_COMMUNICATION_POSIX) | |
#include <fcntl.h> | |
#include <stdint.h> | |
#include <unistd.h> |
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 <krpc.h> | |
#include <krpc/services/krpc.h> | |
#include <krpc/services/space_center.h> | |
const int BUTTON = 2; | |
const int LED = 13; | |
HardwareSerial * conn; | |
#ifdef KRPC_ERROR_CHECK_FN |
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 socket | |
from time import sleep | |
from google.protobuf.internal.encoder import _VarintEncoder | |
from google.protobuf.internal.decoder import _DecodeVarint | |
from krpc.schema import KRPC_pb2 as KRPC | |
# ---------------------- | |
""" | |
support functions (e.g. send_message()) omitted for clarity -- see kRPC documents for examples. | |
""" |
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
Download and install MSYS2 64bit (http://www.msys2.org/), follow the installation instructions and update it (say yes if asked to remove conflicting packages) | |
Open MSYS2 and run the following command to install required packages: | |
pacman -S base-devel unzip mingw-w64-x86_64-gcc mingw-w64-x86_64-binutils | |
Download the following files to C:/msys64/home/<your username> | |
* protobuf-cpp-3.4.1.zip from https://github.com/google/protobuf/releases | |
* asio-1.10.6.zip from https://sourceforge.net/projects/asio/files/asio/1.10.6%20%28Stable%29/ | |
* krpc-cpp-0.4.4.post1.zip from https://github.com/krpc/krpc/releases/tag/v0.4.4.post1.cpp |
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
1. Install CodeBlocks (without MinGW if possible, as we will need to use a separate installation of MinGW anyway) | |
2. Download mingw-get-setup.exe from https://sourceforge.net/projects/mingw/files/Installer | |
Run mingw-get-setup.exe and install MinGW to C:\MinGW | |
(Note: It is essential that this path does not contain any spaces.) | |
When the installation manager window appears, mark the following for installation: | |
mingw32-base | |
mingw32-gcc-g++ | |
msys-base | |
msys-autoconf (class bin) | |
msys-libtool (class bin) |
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
diff --git a/tools/build/python.bzl b/tools/build/python.bzl | |
index 1fabdf4..dbcf603 100644 | |
--- a/tools/build/python.bzl | |
+++ b/tools/build/python.bzl | |
@@ -14,10 +14,10 @@ def _create_py_env(out, install): | |
tmp = out+'.tmp-create-py-env.$$' | |
cmds = [ | |
'rm -rf %s' % tmp, | |
- 'virtualenv %s --quiet --never-download --no-site-packages' % tmp | |
+ 'virtualenv %s --never-download --no-site-packages' % tmp |
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 krpc | |
import time | |
import math | |
conn = krpc.connect() | |
vessel = conn.space_center.active_vessel | |
orbit = vessel.orbit | |
ut = conn.add_stream(getattr, conn.space_center, 'ut') | |
def rad_to_deg(rad): |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Fruits — Tabs Examples 0.2 documentation</title> | |
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
'use strict' | |
var websocket = require('ws'); | |
var protobufjs = require('protobufjs') | |
var proto = protobufjs.loadProtoFile('krpc.proto').build(); | |
console.log('Connecting to RPC server') | |
let rpcConn = new websocket('ws://127.0.0.1:50000') | |
rpcConn.binaryType = 'arraybuffer' |
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
'use strict'; | |
var WebSocket = require('ws'); | |
var ProtoBuf = require('protobufjs') | |
var builder = ProtoBuf.loadProtoFile('krpc.proto'), | |
proto = builder.build(); | |
function decodeBytes(buffer) { | |
return buffer.slice(5) |
NewerOlder