Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
P = 10
R = 28
B = 8.0/3
<?xml version="1.0"?>
<launch>
<arg name="name" default="scout_1"/>
<arg name="geotiff_map_file_path" default="$(find hector_geotiff)/maps"/>
<param name="/use_sim_time" value="true"/>
<node pkg="rviz" type="rviz" name="rviz"
#!/usr/bin/env python
"""
This Python code is based on Java code by Lee Jacobson found in an article
entitled "Applying a genetic algorithm to the travelling salesman problem"
that can be found at: http://goo.gl/cJEY1
"""
import math
import random
#!/usr/bin/env python
import rospy
import time
import argparse
from mavros_msgs.srv import SetMode
from mavros_msgs.srv import CommandBool
from mavros_msgs.srv import CommandTOL
def takeoff(id):
<launch>
<param name="tf_prefix" value="$(arg name)" />
<node name="$(arg name)_BEHAVIOR" pkg="behaviors" type="waypoint_node" args="$
(arg name)" output="screen"/>
</launch>
2019-12-20 21:53:23.549521 co2: 'data: "M 54938 50694 727.30 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0821036 -106.6254606 1560.87855556
2019-12-20 21:53:24.558887 co2: 'data: "M 54938 50695 726.95 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0821038 -106.6254599 1560.89855734
2019-12-20 21:53:25.567436 co2: 'data: "M 54938 50695 727.35 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0821031 -106.6254589 1560.90855842
2019-12-20 21:53:26.576696 co2: 'data: "M 54938 50685 730.24 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0821021 -106.6254579 1560.91855904
2019-12-20 21:53:27.585385 co2: 'data: "M 54938 50669 733.56 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0821007 -106.6254585 1560.90855568
2019-12-20 21:53:28.594775 co2: 'data: "M 54938 50658 735.85 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0820996 -106.6254589 1560.91855318
2019-12-20 21:53:29.603657 co2: 'data: "M 54938 50653 736.69 55.0 0.0 0.0 853 55.0 55.0\r\n"' @ 35.0820988 -106.6254579 1560.91855411
2019-12-20 21:53:30.611912 co2: 'data: "M 54938 50654 736.34 55.0 0.0 0.0 853 55.0 55.
@johncarl81
johncarl81 / CSVMarshaller.java
Last active November 9, 2018 21:59
Simple CSV writer and reader
package test;
import java.io.*;
import java.util.*;
/**
* @author John Ericksen
*/
public class CSVMarshaller {
@johncarl81
johncarl81 / backup.sh
Last active October 10, 2020 00:15
rotating backups in python
#!/usr/bin/python
import subprocess
import pipes
import time
ssh_host = 'john@john-nas'
backup_dest = '/media/raid/backup'
backup_source = '/'
backup_exclude = "backupExclude.txt"
@johncarl81
johncarl81 / Factorial.java
Last active May 10, 2018 21:17
Java factorial tail-call elimination
import java.math.BigInteger;
import static java.math.BigInteger.ONE;
// Factorial care of functional Programming in Java - Venkat Subramaniam
class Factorial {
static TailCall<BigInteger> factorial(long n) {
return factorialRec(ONE, BigInteger.valueOf(n));
}
static TailCall<BigInteger> factorialRec(BigInteger factorial, BigInteger number) {
if(number.equals(ONE)) {
@johncarl81
johncarl81 / .bashrc
Created February 27, 2018 21:59
pretty git log
alias gl='git log --oneline --graph --decorate --all'
alias gd='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'