Skip to content

Instantly share code, notes, and snippets.

@xeonqq
xeonqq / bicycle_model.py
Created November 11, 2020 16:40
Simple demo of bicycle model
import matplotlib.pyplot as plt
from math import *
import numpy as np
import matplotlib.patches as patches
# reference https://dingyan89.medium.com/simple-understanding-of-kinematic-bicycle-model-81cac6420357
class Bicycle(object):
def __init__(self):
self._length =0.1 # m
self._width = 0.01

enter in a Docker container already running with a new TTY

docker exec -it [container-id] bash

Docker: Copying files from Docker container to host

docker cp :/file/path/within/container /host/path/target

How to stop a docker container which started with --restart=always

sudo docker update --restart=no <container_id> to update --restart flag of the container.

@xeonqq
xeonqq / fsm_one_hot.v
Created June 12, 2023 07:46
fsm 4 locations, move left and right, one hot encoding
/*
* Do not change Module name
*/
module FSM(input clk, input [1:0] w, output [3:0] z);
localparam A=4'b0001, B=4'b0010, C=4'b0100, D=4'b1000;
reg [3:0] state, next_state;
initial state = A;
always @(posedge clk)