Archives
All the articles I've archived.
Install ROS2 and depthai_ros_driver_v3 on Ubuntu24
Install ROS 2 Set locale locale # check for UTF-8 sudo apt update && sudo apt install locales sudo locale-gen en_US en_US.UTF-8 sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 export LANG=en_US.UTF-8 locale # verify settings Enable required repositories sudo apt install -y software-properties-common sudo add-apt-repository universe sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \ -o /usr/share/keyrings/ros-archive-keyring.
Install ros2-jazzy and depthai_ros_driver on Debian 12 Bookworm Arm64
This guide explains how to install ROS 2 Jazzy and depthai_ros_driver on Debian 12 Bookworm ARM64 (Raspberry Pi 4 / 5). System Requirements Required: Debian 12 Bookworm (64-bit) ARM64 ( aarch64 ) At least 20GB free disk space OAK camera device Check architecture: uname -m Expected: aarch64 Install ROS2 1.
将 RoadRunner 地图导入 CARLA
前提条件 已经在本地通过源码编译好了 CARLA,参考: Building CARLA in Windows with UE4 已经在本地安装 RoadRunner 并创建好了地图 导出地图 使用 CARLA 选项导出场景: 在主工具栏中,选择 File -> Export -> CARLA Filmbox (.fbx, .xodr, .rrdata.xml) 选择要导出文件的目录,然后单击 Export 。这将生成 <mapName>.fbx 包括 <mapName>.xodr 文件在内的各种文件。 生成 CARLA 地图 进入 D:\CarlaUE4\Import 目录,创建文件夹,例如: Map01 进入 D:\CarlaUE4\Import\Map01 目录,创建存放地图资源的文件夹,例如:
Updated:Building CARLA in Windows with UE4
构建流程 1. 获取访问权限 将 GitHub 账号 关联到Epic Games ,并接受来自Epic组织的邀请。 2. 下载 Carla 专用 UE4 引擎 git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git CarlaUE4_Engine 执行 Setup.bat 执行 GenerateProjectFiles.bat 注意: 必须要先进行第一步,否则无权限访问该仓库 必须要使用 Carla 专用的引擎版本,否则编译会失败 3. 编译 CarlaUE4_Engine 在 CarlaUE4_Engine 目录下找到 UE4.sln ,
Updated:Building CARLA in Windows with Unreal Engine 5.5
构建过程 1. 获取访问权限 将 GitHub 账号 关联到Epic Games ,并接受来自Epic组织的邀请。 2. 下载 Carla 专用 UE5 引擎 git clone -b ue5-dev-carla https://github.com/CarlaUnreal/UnrealEngine.git CarlaUE5_Engine 执行 Setup.bat 执行 GenerateProjectFiles.bat 注意: 必须要先进行第一步,否则无权限访问该仓库 必须要使用 Carla 专用的引擎版本,否则编译会失败 3. 编译 CarlaUE5_Engine 在 CarlaUE5_Engine 目录下找到 UE5.sln ,
Updated:
Potree - Get all points in pointcloud
Background When using potree( potree-core ) to load a large point cloud dataset, it involves the scenario of obtaining all point cloud data for processing, so this method is in place. Core Code function getPoints () { const position = new Float32Array ( MAX_POINTS * 3 ); const intensity = new Float32Array ( MAX_POINTS ); const matrixCache = new Map < PointCloudOctree , THREE . Matrix4 >(); this . pointClouds . forEach (( pointCloud ) => { matrixCache . set ( pointCloud , pointCloud .
记录一次微前端实践
技术选型 微前端框架:qiankun、single-spa-angular 主应用:angular 16 子应用:angular 16 项目搭建 主应用配置 安装 qiankun 增加子应用加载入口组件 micro-app.component.ts import { Component , ElementRef , OnInit } from '@angular/core' ; import { ActivatedRoute } from '@angular/router' ; import { MicroApp , loadMicroApp } from 'qiankun' ; @ Component ({ selector : 'micro-app' , template : ` <div id="haydnSccMicroApp"></div> ` , })
git submodule
添加 git submodule add <url> <path> url:子模块仓库地址 path:本地存放路径 初始化 git submodule update --init --recursive 或者 git submodule init git submodule update 更新 cd <path> git pull origin <branch> 删除 删除submodule缓存 git rm --cached <path> 删除submodule目录 rm -rf <path> 删除文件 .gitmodules 中对应子模块内容 删除 .git/modules 对应子模块目录 rm -rf .git/modules/<path> 删除 .
Updated:
Angular Custom Slots
Option One (Directive) item.directive.ts import { Input , Directive , TemplateRef , EmbeddedViewRef , ViewContainerRef , } from '@angular/core' ; @ Directive ({ selector : '[ListItem]' , }) export class ListItem { private _context : any ; private _viewRef : EmbeddedViewRef < any >; constructor ( private viewContainer : ViewContainerRef , public templateRef : TemplateRef < any > ) { this . _viewRef = this . viewContainer . createEmbeddedView ( templateRef ); } @ Input ()
Updated:
前端安全
XSS XSS(Cross-site scripting) 是一种网站应用程式的安全漏洞攻击,是代码注入的一种。它允许恶意使用者将程式代码注入到网页上,其他使用者在观看网页时就受到影响。这类攻击通常包含了 HTML 以及使用者端脚本语言 XSS 攻击分为三种:反射型,存储型,DOM-based 攻击方式 XSS 通过修改 HTML 节点或者执行 JS 代码来攻击网站 <!-- http://wwww.xxx.com?name=<script>alert(1)</script> --> < div >{{ name }}</ div > 上述 URL 输入可能会将 HTML 改为 <div><script>alert(1)
Updated:浏览器渲染机制
渲染流程 浏览器的渲染机制一般分为以下几个步骤: 处理 HTML 并构建 DOM 树 处理 CSS 构建 CSSOM 树 将 DOM 树与 CSSOM 树合并成一个渲染树 根据渲染树来布局,计算每个节点的位置 调用 GPU 绘制,合成图层,显示在屏幕上 在构建 CSSOM 树时,会阻塞渲染,直到 CSSOM 树构建完成。并且构建 CSSOM 树是一个十分消耗性能的过程,所以应该尽量保证层级扁平,减少过度层叠,越是具体的 CSS 选择器,执行速度越慢 当 HTML 解析到 script 标签时,会暂停构建 DOM,完成后才会从暂停的地方重新开始。也就是说,如果你想首屏渲染的越快,
Updated: