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
# Simple traffic simulator on a circular road. Cars have two | |
# control objectives: | |
# - Maintain a consistent distance between cars. | |
# - Maintain a consistent car speed. | |
import argparse | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.animation import FuncAnimation | |
from geometry import SO2 | |
from pysignals import ( |
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 argparse | |
def main(): | |
argparser = argparse.ArgumentParser( | |
description = "Generate a nix-shell file (shell.nix) for Python 3.9 development.", | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter | |
) | |
argparser.add_argument("--nix-path", type=str, default="nixpkgs", help="Nix source path.") | |
argparser.add_argument("--modules", nargs="+", default=[], help="Python modules for development.") | |
args = argparser.parse_args() |
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 numpy as np | |
from typing import Callable, Tuple | |
import functools | |
class EulerAnglesOrder: | |
NONE = 0 | |
@staticmethod | |
def toStr(v): | |
if v != EulerAnglesOrder.NONE: | |
return f"R = R({v[0]})R({v[1]})R({v[2]})" |