[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}
uuid
import re
string = "Hello.mp4"
re.sub(r"(.*?)\.", "\g<1> - YouTube.", string)
# 'Hello - YouTube.mp4'
import logging | |
# 创建一个输出到本地的 Handler | |
# 首先通过 basicConfig 赋予 rootLogger 一个 StreamHandler | |
# 然后自定义一个 FileHandler 赋予 rootLogger | |
# 为什么不自定义一个 StreamHandler 再赋予 rotLogger 是因为感觉这样省事 | |
logging.basicConfig(level=logging.DEBUG, | |
format='%(asctime)s - %(levelname)s: %(message)s') | |
handler = logging.FileHandler("logname.log") | |
handler.setLevel(logging.INFO) |
import os | |
from launch import LaunchDescription | |
from launch.actions import DeclareLaunchArgument, OpaqueFunction | |
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | |
from launch.conditions import IfCondition, UnlessCondition | |
from launch_ros.actions import Node | |
from launch_ros.substitutions import FindPackageShare | |
from launch.actions import ExecuteProcess | |
from ament_index_python.packages import get_package_share_directory | |
from moveit_configs_utils import MoveItConfigsBuilder |
from moveit_configs_utils import MoveItConfigsBuilder | |
from moveit_configs_utils.launches import generate_demo_launch | |
def generate_launch_description(): | |
moveit_config = MoveItConfigsBuilder( | |
"ec66", package_name="elite_moveit_config" | |
).to_moveit_configs() | |
"""" | |
What does `generate_demo_launch` do: |
cmake_minimum_required(VERSION 3.8) | |
project(moverobot) | |
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | |
add_compile_options(-Wall -Wextra -Wpedantic) | |
endif() | |
# find dependencies | |
find_package(ament_cmake REQUIRED) | |
find_package(rclcpp REQUIRED) |
Mean-Difference plot, or Bland–Altman plot can be used to compare the prediction accuracy.
Bland and Altman drive the point that any two methods that are designed to measure the same parameter (or property) should have good correlation when a set of samples are chosen such that the property to be determined varies considerably.
This is how they looks:
""" | |
Basic operations based on sensor SDK tutorial | |
https://learn.microsoft.com/zh-cn/azure/kinect-dk/about-sensor-sdk | |
Note some code utilize pykinect_azure's wrapper instead of low level SDK | |
""" | |
import cv2 | |
import matplotlib.pyplot as plt | |
import pykinect_azure as pykinect | |
from pykinect_azure.k4a import _k4a |
import matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.optimize import curve_fit | |
X0 = 1 # 传感器摆放间距 | |
def illuminate(idx, x, y, intensity): | |
"""模拟光敏传感器阵列的输出""" | |
theta = np.arctan2(idx * X0 - x, y) # incoming angle |
#include <stdexcept> | |
#include <cmath> | |
namespace complex_numbers | |
{ | |
class Complex | |
{ | |
private: | |
double _real; | |
double _imag; | |
public: |
import matplotlib.pyplot as plt | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from sklearn.datasets import load_iris | |
from sklearn.model_selection import train_test_split | |
iris = load_iris() | |
X = iris["data"] | |
y = iris["target"] |