Skip to content

Instantly share code, notes, and snippets.

View zepinto's full-sized avatar

Jose Pinto zepinto

View GitHub Profile
@zepinto
zepinto / Replay LSF to network
Last active August 29, 2015 14:09
Replaying of LSF data to network
package pt.lsts.util;
import java.io.File;
import java.util.Date;
import pt.lsts.imc.IMCMessage;
import pt.lsts.imc.lsf.LsfIndex;
import pt.lsts.imc.net.UDPTransport;
public class ReplayToNetwork {
@zepinto
zepinto / imc1.groovy
Last active November 23, 2016 14:19
IMC Groovy Example
import pt.lsts.imc.*
import pt.lsts.imc.net.*
import pt.lsts.neptus.messages.listener.*
// store handle to IMCProtocol globally
class Globals {
static proto = new IMCProtocol();
}
// This method will be called every 5 seconds
@zepinto
zepinto / imcplan.groovy
Created January 17, 2015 14:59
IMC Groovy example to command a plan
import pt.lsts.imc.*
import pt.lsts.imc.net.*
// Create a quick plan
desired_lat = Math.toRadians(41)
desired_lon = Math.toRadians(-8)
desired_speed = 1.2
desired_depth = 3
pc = new PlanControl(
@zepinto
zepinto / lsf1.groovy
Created January 17, 2015 16:58
Parsing LSF files in Groovy
import pt.lsts.imc.EstimatedState
import pt.lsts.imc.lsf.LsfIndex
import pt.lsts.util.WGS84Utilities;
// Create an LSF index object
idx = new LsfIndex(new File("/path/to/Data.lsf"))
// Get all recorded states with minimum separation of 1000 milliseconds
idx.getIterator(EstimatedState.class, (long)1000).each {
// Print to the screen the location parsed from the state
@zepinto
zepinto / lsf2.groovy
Created January 17, 2015 17:17
Groovy script that extracts CTD data from LSF and prints out the result as CSV
import pt.lsts.imc.*
import pt.lsts.imc.lsf.*
import pt.lsts.util.WGS84Utilities
// Obtain an LSF index object
idx = new LsfIndex(new File("/path/to/Data.lsf"))
// Create a scanner
scanner = new IndexScanner(idx);
@zepinto
zepinto / KmlImporter.java
Created April 20, 2015 13:54
Translating KML placemarks into Neptus plans
/*
* This class uses KML loading code available from
* http://labs.micromata.de/projects/jak/download.html
*/
package pt.lsts.neptus.plugins.kml;
import java.io.File;
import java.util.List;
import pt.lsts.neptus.mp.ManeuverLocation;
@zepinto
zepinto / convert360.bash
Last active April 2, 2019 16:06
Bash script for depolarizing video for AMKOV AMK100s 360 camera
#!/bin/bash
if [ $# -le 0 ]
then
echo "Usage: ./script.bash <video_file>"
exit 1
fi
echo "Extracting matadata"
ffmpeg32 -i "$1" -f ffmetadata metadata.txt
@zepinto
zepinto / ManeuverTimes.java
Created February 21, 2017 14:00
Print starting times of maneuvers inside plans.
package pt.lsts.imc.lsf.batch;
import pt.lsts.imc.IMCDefinition;
import pt.lsts.imc.PlanControlState;
import pt.lsts.imc.PlanControlState.STATE;
import pt.lsts.imc.lsf.UnserializedMessage;
public class ManeuverTimes {
public static void main(String[] args) throws Exception {
@zepinto
zepinto / endurance.bash
Last active May 12, 2022 09:39
Start Endurance Simulation
#!/bin/bash
WORKSPACE_DIR=~/workspace
DUNE_DIR=$WORKSPACE_DIR/dune/build
IMC4J_DIR=$WORKSPACE_DIR/imc4j
NEPTUS_DIR=$WORKSPACE_DIR/neptus
# Stop DUNE if already running
while pgrep -x "dune" > /dev/null; do
killall dune
@zepinto
zepinto / mingw-w64-x86_64.cmake
Last active May 21, 2020 15:35 — forked from peterspackman/mingw-w64-x86_64.cmake
cmake toolchain file for mingw-w64 x86_64 builds on Ubuntu
# Sample toolchain file for creating Windows installer.
#
# Typical usage:
# 1) install cross compiler and packager: `sudo apt-get install mingw-w64 nsis`
# 2) cd <path/to/build/folder>
# 3) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake <path/to/source/folder>
# 4) make -j<cores>
# 5) make package
set(CMAKE_SYSTEM_NAME Windows)