摘要: 用模板特化建立“类型到类型的关联”,从而让通用代码能根据“标签类型”自动适配不同的类型组合。 点击查看代码 #include <iostream> class Test1; class Test2; //这是默认映射:对任意类型 T,都映射到 void template <typename T> c 阅读全文
posted @ 2026-02-07 23:21 fangshuo 阅读(4) 评论(0) 推荐(0)
摘要: 右值 int a=10; int b=10; int c=a+b; 左值往往代存储空间 右值: a+b 仅在运行过程中存在 __asm{ mov eax,a mov ebx,b add eax,ebx mov c,eax } 右值a+b 在操作完之后就销毁了,匿名无固定地址。 右值引用 int a 阅读全文
posted @ 2026-02-07 22:06 fangshuo 阅读(2) 评论(0) 推荐(0)
摘要: 先写一个工具 点击查看代码 import subprocess import shlex from mcp.server.fastmcp import FastMCP from typing import Annotated from pydantic import Field, BaseModel 阅读全文
posted @ 2026-01-21 16:38 fangshuo 阅读(2) 评论(0) 推荐(0)
摘要: app->controller->HW interface -> HW driver-> hardware controller 创建一个pkg,在pkg中新建一个controller.yaml。 点击查看代码 controller_manager: ros__parameters: update_ 阅读全文
posted @ 2025-09-25 23:59 fangshuo 阅读(40) 评论(0) 推荐(0)
摘要: Read Copy Update /RCU 可以单个写,多个读,在内核中常用于更新链表。对比顺序锁,只能用指针访问资源,读数据无需加锁,避免多次读数据。 应用场景: 多个读 少量写 写相较于读具有更高优先级 rcu保持数据指针的引用,当资源发生变化时: 创建一份数据的拷贝 进行修改 所有reader 阅读全文
posted @ 2025-09-21 16:55 fangshuo 阅读(8) 评论(0) 推荐(0)
摘要: Per CPU Variables A CPU should not access the elements of the array corresponding to other CPU. 每个CPU拥有该变量的独立副本 无需加锁 - 由于每个CPU只操作自己的副本,因此读写自己的副本时不会产生竞 阅读全文
posted @ 2025-09-20 22:29 fangshuo 阅读(9) 评论(0) 推荐(0)
摘要: cat /proc/cpuinfo check all processors ps -eaF the PSR shows process is runing on processor number preemption user space Under Linux, user-space progr 阅读全文
posted @ 2025-09-20 21:38 fangshuo 阅读(9) 评论(0) 推荐(0)
摘要: he Global Descriptor Table (GDT) is a binary data structure specific to the IA-32 and x86-64 architectures. It contains entries telling the CPU about 阅读全文
posted @ 2025-08-13 19:56 fangshuo 阅读(8) 评论(0) 推荐(0)
摘要: bios looks for a bootloader to boot by search all storage media for the signature "0x55AA" and load the sector into address 0x7C00 and execute it. boo 阅读全文
posted @ 2025-08-13 19:45 fangshuo 阅读(8) 评论(0) 推荐(0)
摘要: ros2 control framework hardware resources包含各种传感器和执行器,can send command or retrieve information, such as position,velocity。 ros2 control 使用 Command inte 阅读全文
posted @ 2025-07-15 23:41 fangshuo 阅读(74) 评论(0) 推荐(0)