Skip to content

Instantly share code, notes, and snippets.

How to use this program to estimate relative position between two near GNSS antennas

  1. Install Ruby
    • For Windows users, RubyInstaller is convinient, and please select "WITH DEVKIT" version because of native compilation required by a dependent gem.
  2. Install gps_pvt gem: gem install gps_pvt
  3. Download est_proximity.rb
  4. Type the following on the directory in which est_proximity.rb and observation files are stored: ./est_proximity.rb base_obs_file aux_obs_file1 [aux_obs_file2] ... [options] ...
    • The supported formats of the observation files are u-blox(UBX), RINEX OBS(v2/v3). COM port and Ntrip stream can be used. The details are described in gps_pvt readme.
  • --onl
@fenrir-naru
fenrir-naru / ambiguity_test.rb
Last active October 25, 2022 02:14
Attitude estimation code 2022/10/25
#!/usr/bin/ruby
require 'gps_pvt'
LAMBDA = GPS_PVT::GPS::SpaceNode.L1_WaveLength
Mat = GPS_PVT::SylphideMath::MatrixD
candidates = [-1, 0, 1]
run = proc{
prop = {}
@fenrir-naru
fenrir-naru / Outlook.vbs
Last active May 13, 2021 23:54
Outlook desktop to Google calendar
Public WithEvents myOlFolder As Outlook.Folder
Public WithEvents myOlItems As Outlook.Items
Public Sub Application_Startup()
Set myOlFolder = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar)
Set myOlItems = myOlFolder.Items
End Sub
Private Sub sendREST(ByVal Item As Object, ByVal Mode As String)
Dim params As Object
@fenrir-naru
fenrir-naru / BoostDistributions.i
Last active September 17, 2020 00:00
SWIG for boost::math::distributions
/**
* @file SWIG interface file for boost::math::distributions
*
*/
%module BoostDistributions
%include exception.i
%exception {
try {
@fenrir-naru
fenrir-naru / EFS%nv%item_files%mcfg%mcfg_sel_db.xml
Last active March 13, 2020 00:38
Mi 9 SE with AU(KDDI) CDMA
<?xml version="1.0" encoding="UTF-8"?>
<policy mcfg_db_ver="1.2.3" name="generic">
<initial>
<tristate_define name="iin" value="undef" />
<tristate_define name="3gpp_imsi" value="undef" />
<tristate_define name="3gpp2_imsi" value="undef" />
</initial>
<if>
<any_of evaluate_all="true">
<tristate_reset_all return="false" />
@fenrir-naru
fenrir-naru / R_bootstrap.rb
Last active April 1, 2019 05:08
Windows R deployment script without system wide modification, a.k.a., "portable"
#!/usr/bin/ruby
class R_Bootstrap
class <<self
def registry_check(ver = nil)
[:HKLM, :HKCU].collect{|head|
`reg query "#{head}\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" /f "R for Windows*is1" 2>nul`.scrub.lines
}.flatten.collect{|line|
next unless line.strip =~ /^\s*(.*#{ver}_is1)/
$1
int attribute_hidden
Rstd_ReadConsole(const char *prompt, unsigned char *buf, int len,
int addtohistory)
{
if(!R_Interactive) {
#if 0
size_t ll;
int err = 0;
if (!R_Slave) {
fputs(prompt, stdout);
@fenrir-naru
fenrir-naru / contacts2.db-to-vcf.php
Last active February 20, 2021 23:54 — forked from 1d10t/contacts2.db-to-vcf.php
android contacts2.db to vcard file (vcf) converter
<?php
ini_set('mbstring.language', 'Japanese');
function db(){
static $db = null;
if(!$db){
$db = new SQLite3(__DIR__.'/contacts2.db');
$db->busyTimeout(60*60*1000);
@fenrir-naru
fenrir-naru / SBAS_rectangle.h
Created February 16, 2018 08:56
SBAS interpolation of ionospheric grid points
struct rectangle_t {
/**
* igp[2] -- igp[3] igp[0] -- igp[1]
* | | in north, | | in south
* igp[0] -- igp[1] igp[2] -- igp[3]
*
* assumption
* igp[0].lat = igp[1].lat, igp[2].lat = igp[3].lat
* igp[0].lng < igp[1].lng, igp[2].lng < igp[3].lng
*/
#include <iostream>
using namespace std;
struct MatrixView;
template <class BaseView>
struct MatrixViewTranspose;
template <class BaseView>