系统,工具,源码,语言组成的数字世界-2021-

举报
zhangrelay 发表于 2021/07/15 01:55:35 2021/07/15
【摘要】 最近一些时间,主要阅读代码,包括题中所涉及的,常常思考“0”和“1”的奇妙之处,但无奈过于愚钝,未能开悟。 几乎所有现实中的人,沉溺于数字产品的时间越来越久,无论游戏,还是娱乐,或者购物,还有读书。 手机比电脑方便许多,闲暇时很少再看到发呆的现象,而多是被这屏幕勾去了魂魄,渐渐被数字产品所“奴役”。 系统:无非Computer和Phone,最近看Linux,工具:机器人...

最近一些时间,主要阅读代码,包括题中所涉及的,常常思考“0”和“1”的奇妙之处,但无奈过于愚钝,未能开悟。

几乎所有现实中的人,沉溺于数字产品的时间越来越久,无论游戏,还是娱乐,或者购物,还有读书。

手机比电脑方便许多,闲暇时很少再看到发呆的现象,而多是被这屏幕勾去了魂魄,渐渐被数字产品所“奴役”。

系统:无非Computer和Phone,最近看Linux,工具:机器人类ROS2,源码:Github,语言:C/C++

Linux内核:github.com/torvalds/linux

发现led是所有系统必备的部分呢。以Linux为例:

github.com/torvalds/linux/blob/master/drivers/leds/leds.h


  
  1. #ifndef __LEDS_H_INCLUDED
  2. #define __LEDS_H_INCLUDED
  3. #include <linux/rwsem.h>
  4. #include <linux/leds.h>
  5. static inline int led_get_brightness(struct led_classdev *led_cdev)
  6. {
  7. return led_cdev->brightness;
  8. }
  9. void led_init_core(struct led_classdev *led_cdev);
  10. void led_stop_software_blink(struct led_classdev *led_cdev);
  11. void led_set_brightness_nopm(struct led_classdev *led_cdev,
  12. enum led_brightness value);
  13. void led_set_brightness_nosleep(struct led_classdev *led_cdev,
  14. enum led_brightness value);
  15. ssize_t led_trigger_read(struct file *filp, struct kobject *kobj,
  16. struct bin_attribute *attr, char *buf,
  17. loff_t pos, size_t count);
  18. ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
  19. struct bin_attribute *bin_attr, char *buf,
  20. loff_t pos, size_t count);
  21. extern struct rw_semaphore leds_list_lock;
  22. extern struct list_head leds_list;
  23. extern struct list_head trigger_list;
  24. extern const char * const led_colors[LED_COLOR_ID_MAX];
  25. #endif /* __LEDS_H_INCLUDED */

包含初始化核心,闪烁,亮度等一些功能。

当然在设备中还可看到看门狗,USB,I2C等。

工具中可以看到一些常用监测tools/leds/uledmon.c:


  
  1. #include <fcntl.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <time.h>
  5. #include <unistd.h>
  6. #include <linux/uleds.h>
  7. int main(int argc, char const *argv[])
  8. {
  9. struct uleds_user_dev uleds_dev;
  10. int fd, ret;
  11. int brightness;
  12. struct timespec ts;
  13. if (argc != 2) {
  14. fprintf(stderr, "Requires <device-name> argument\n");
  15. return 1;
  16. }
  17. strncpy(uleds_dev.name, argv[1], LED_MAX_NAME_SIZE);
  18. uleds_dev.max_brightness = 100;
  19. fd = open("/dev/uleds", O_RDWR);
  20. if (fd == -1) {
  21. perror("Failed to open /dev/uleds");
  22. return 1;
  23. }
  24. ret = write(fd, &uleds_dev, sizeof(uleds_dev));
  25. if (ret == -1) {
  26. perror("Failed to write to /dev/uleds");
  27. close(fd);
  28. return 1;
  29. }
  30. while (1) {
  31. ret = read(fd, &brightness, sizeof(brightness));
  32. if (ret == -1) {
  33. perror("Failed to read from /dev/uleds");
  34. close(fd);
  35. return 1;
  36. }
  37. clock_gettime(CLOCK_MONOTONIC, &ts);
  38. printf("[%ld.%09ld] %u\n", ts.tv_sec, ts.tv_nsec, brightness);
  39. }
  40. close(fd);
  41. return 0;
  42. }

比单片机程序的确复杂了许多。

工具:ros2-foxy

学习源码,才能真正掌握ros2,在此处不过多说明了。


  
  1. repositories:
  2. ament/ament_cmake:
  3. type: git
  4. url: https://github.com/ament/ament_cmake.git
  5. version: 0.9.8
  6. ament/ament_index:
  7. type: git
  8. url: https://github.com/ament/ament_index.git
  9. version: 1.0.1
  10. ament/ament_lint:
  11. type: git
  12. url: https://github.com/ament/ament_lint.git
  13. version: 0.9.6
  14. ament/ament_package:
  15. type: git
  16. url: https://github.com/ament/ament_package.git
  17. version: 0.9.3
  18. ament/google_benchmark_vendor:
  19. type: git
  20. url: https://github.com/ament/google_benchmark_vendor.git
  21. version: 0.0.3
  22. ament/googletest:
  23. type: git
  24. url: https://github.com/ament/googletest.git
  25. version: 1.8.9000
  26. ament/uncrustify_vendor:
  27. type: git
  28. url: https://github.com/ament/uncrustify_vendor.git
  29. version: 1.4.0
  30. eProsima/Fast-CDR:
  31. type: git
  32. url: https://github.com/eProsima/Fast-CDR.git
  33. version: v1.0.13
  34. eProsima/Fast-DDS:
  35. type: git
  36. url: https://github.com/eProsima/Fast-DDS.git
  37. version: v2.0.2
  38. eProsima/foonathan_memory_vendor:
  39. type: git
  40. url: https://github.com/eProsima/foonathan_memory_vendor.git
  41. version: v1.0.0
  42. eclipse-cyclonedds/cyclonedds:
  43. type: git
  44. url: https://github.com/eclipse-cyclonedds/cyclonedds.git
  45. version: 0.7.0
  46. osrf/osrf_pycommon:
  47. type: git
  48. url: https://github.com/osrf/osrf_pycommon.git
  49. version: 0.1.10
  50. osrf/osrf_testing_tools_cpp:
  51. type: git
  52. url: https://github.com/osrf/osrf_testing_tools_cpp.git
  53. version: 1.3.2
  54. ros-perception/laser_geometry:
  55. type: git
  56. url: https://github.com/ros-perception/laser_geometry.git
  57. version: 2.2.0
  58. ros-planning/navigation_msgs:
  59. type: git
  60. url: https://github.com/ros-planning/navigation_msgs.git
  61. version: 2.0.2
  62. ros-tooling/libstatistics_collector:
  63. type: git
  64. url: https://github.com/ros-tooling/libstatistics_collector.git
  65. version: 1.0.1
  66. ros-tracing/ros2_tracing:
  67. type: git
  68. url: https://gitlab.com/ros-tracing/ros2_tracing.git
  69. version: 1.0.4
  70. ros-visualization/interactive_markers:
  71. type: git
  72. url: https://github.com/ros-visualization/interactive_markers.git
  73. version: 2.1.3
  74. ros-visualization/python_qt_binding:
  75. type: git
  76. url: https://github.com/ros-visualization/python_qt_binding.git
  77. version: 1.0.5
  78. ros-visualization/qt_gui_core:
  79. type: git
  80. url: https://github.com/ros-visualization/qt_gui_core.git
  81. version: 1.1.2
  82. ros-visualization/rqt:
  83. type: git
  84. url: https://github.com/ros-visualization/rqt.git
  85. version: 1.0.6
  86. ros-visualization/rqt_action:
  87. type: git
  88. url: https://github.com/ros-visualization/rqt_action.git
  89. version: 1.0.1
  90. ros-visualization/rqt_console:
  91. type: git
  92. url: https://github.com/ros-visualization/rqt_console.git
  93. version: 1.1.1
  94. ros-visualization/rqt_graph:
  95. type: git
  96. url: https://github.com/ros-visualization/rqt_graph.git
  97. version: 1.1.0
  98. ros-visualization/rqt_msg:
  99. type: git
  100. url: https://github.com/ros-visualization/rqt_msg.git
  101. version: 1.0.2
  102. ros-visualization/rqt_plot:
  103. type: git
  104. url: https://github.com/ros-visualization/rqt_plot.git
  105. version: 1.0.8
  106. ros-visualization/rqt_publisher:
  107. type: git
  108. url: https://github.com/ros-visualization/rqt_publisher.git
  109. version: 1.1.0
  110. ros-visualization/rqt_py_console:
  111. type: git
  112. url: https://github.com/ros-visualization/rqt_py_console.git
  113. version: 1.0.0
  114. ros-visualization/rqt_reconfigure:
  115. type: git
  116. url: https://github.com/ros-visualization/rqt_reconfigure.git
  117. version: 1.0.6
  118. ros-visualization/rqt_service_caller:
  119. type: git
  120. url: https://github.com/ros-visualization/rqt_service_caller.git
  121. version: 1.0.3
  122. ros-visualization/rqt_shell:
  123. type: git
  124. url: https://github.com/ros-visualization/rqt_shell.git
  125. version: 1.0.0
  126. ros-visualization/rqt_srv:
  127. type: git
  128. url: https://github.com/ros-visualization/rqt_srv.git
  129. version: 1.0.1
  130. ros-visualization/rqt_top:
  131. type: git
  132. url: https://github.com/ros-visualization/rqt_top.git
  133. version: 1.0.0
  134. ros-visualization/rqt_topic:
  135. type: git
  136. url: https://github.com/ros-visualization/rqt_topic.git
  137. version: 1.1.0
  138. ros-visualization/tango_icons_vendor:
  139. type: git
  140. url: https://github.com/ros-visualization/tango_icons_vendor.git
  141. version: 0.0.1
  142. ros/class_loader:
  143. type: git
  144. url: https://github.com/ros/class_loader.git
  145. version: 2.0.1
  146. ros/kdl_parser:
  147. type: git
  148. url: https://github.com/ros/kdl_parser.git
  149. version: 2.4.1
  150. ros/pluginlib:
  151. type: git
  152. url: https://github.com/ros/pluginlib.git
  153. version: 2.5.3
  154. ros/resource_retriever:
  155. type: git
  156. url: https://github.com/ros/resource_retriever.git
  157. version: 2.3.4
  158. ros/robot_state_publisher:
  159. type: git
  160. url: https://github.com/ros/robot_state_publisher.git
  161. version: 2.4.1
  162. ros/ros_environment:
  163. type: git
  164. url: https://github.com/ros/ros_environment.git
  165. version: 2.5.0
  166. ros/ros_tutorials:
  167. type: git
  168. url: https://github.com/ros/ros_tutorials.git
  169. version: 1.2.5
  170. ros/urdfdom:
  171. type: git
  172. url: https://github.com/ros/urdfdom.git
  173. version: 2.3.3
  174. ros/urdfdom_headers:
  175. type: git
  176. url: https://github.com/ros/urdfdom_headers.git
  177. version: 1.0.5
  178. ros2/ament_cmake_ros:
  179. type: git
  180. url: https://github.com/ros2/ament_cmake_ros.git
  181. version: 0.9.0
  182. ros2/common_interfaces:
  183. type: git
  184. url: https://github.com/ros2/common_interfaces.git
  185. version: 2.0.3
  186. ros2/console_bridge_vendor:
  187. type: git
  188. url: https://github.com/ros2/console_bridge_vendor.git
  189. version: 1.2.3
  190. ros2/demos:
  191. type: git
  192. url: https://github.com/ros2/demos.git
  193. version: 0.9.3
  194. ros2/eigen3_cmake_module:
  195. type: git
  196. url: https://github.com/ros2/eigen3_cmake_module.git
  197. version: 0.1.1
  198. ros2/example_interfaces:
  199. type: git
  200. url: https://github.com/ros2/example_interfaces.git
  201. version: 0.9.0
  202. ros2/examples:
  203. type: git
  204. url: https://github.com/ros2/examples.git
  205. version: 0.9.4
  206. ros2/geometry2:
  207. type: git
  208. url: https://github.com/ros2/geometry2.git
  209. version: 0.13.9
  210. ros2/launch:
  211. type: git
  212. url: https://github.com/ros2/launch.git
  213. version: 0.10.4
  214. ros2/launch_ros:
  215. type: git
  216. url: https://github.com/ros2/launch_ros.git
  217. version: 0.11.1
  218. ros2/libyaml_vendor:
  219. type: git
  220. url: https://github.com/ros2/libyaml_vendor.git
  221. version: 1.0.2
  222. ros2/message_filters:
  223. type: git
  224. url: https://github.com/ros2/message_filters.git
  225. version: 3.2.4
  226. ros2/mimick_vendor:
  227. type: git
  228. url: https://github.com/ros2/mimick_vendor.git
  229. version: 0.2.3
  230. ros2/orocos_kinematics_dynamics:
  231. type: git
  232. url: https://github.com/ros2/orocos_kinematics_dynamics.git
  233. version: 3.3.1
  234. ros2/performance_test_fixture:
  235. type: git
  236. url: https://github.com/ros2/performance_test_fixture.git
  237. version: 0.0.6
  238. ros2/python_cmake_module:
  239. type: git
  240. url: https://github.com/ros2/python_cmake_module.git
  241. version: 0.8.0
  242. ros2/rcl:
  243. type: git
  244. url: https://github.com/ros2/rcl.git
  245. version: 1.1.10
  246. ros2/rcl_interfaces:
  247. type: git
  248. url: https://github.com/ros2/rcl_interfaces.git
  249. version: 1.0.0
  250. ros2/rcl_logging:
  251. type: git
  252. url: https://github.com/ros2/rcl_logging.git
  253. version: 1.0.1
  254. ros2/rclcpp:
  255. type: git
  256. url: https://github.com/ros2/rclcpp.git
  257. version: 2.3.0
  258. ros2/rclpy:
  259. type: git
  260. url: https://github.com/ros2/rclpy.git
  261. version: 1.0.4
  262. ros2/rcpputils:
  263. type: git
  264. url: https://github.com/ros2/rcpputils.git
  265. version: 1.3.1
  266. ros2/rcutils:
  267. type: git
  268. url: https://github.com/ros2/rcutils.git
  269. version: 1.1.2
  270. ros2/realtime_support:
  271. type: git
  272. url: https://github.com/ros2/realtime_support.git
  273. version: 0.9.0
  274. ros2/rmw:
  275. type: git
  276. url: https://github.com/ros2/rmw.git
  277. version: 1.0.2
  278. ros2/rmw_connext:
  279. type: git
  280. url: https://github.com/ros2/rmw_connext.git
  281. version: 1.0.3
  282. ros2/rmw_cyclonedds:
  283. type: git
  284. url: https://github.com/ros2/rmw_cyclonedds.git
  285. version: 0.7.6
  286. ros2/rmw_dds_common:
  287. type: git
  288. url: https://github.com/ros2/rmw_dds_common.git
  289. version: 1.0.2
  290. ros2/rmw_fastrtps:
  291. type: git
  292. url: https://github.com/ros2/rmw_fastrtps.git
  293. version: 1.2.4
  294. ros2/rmw_implementation:
  295. type: git
  296. url: https://github.com/ros2/rmw_implementation.git
  297. version: 1.0.1
  298. ros2/ros1_bridge:
  299. type: git
  300. url: https://github.com/ros2/ros1_bridge.git
  301. version: 0.9.6
  302. ros2/ros2cli:
  303. type: git
  304. url: https://github.com/ros2/ros2cli.git
  305. version: 0.9.8
  306. ros2/ros2cli_common_extensions:
  307. type: git
  308. url: https://github.com/ros2/ros2cli_common_extensions.git
  309. version: 0.1.0
  310. ros2/ros_testing:
  311. type: git
  312. url: https://github.com/ros2/ros_testing.git
  313. version: 0.2.1
  314. ros2/rosbag2:
  315. type: git
  316. url: https://github.com/ros2/rosbag2.git
  317. version: 0.3.5
  318. ros2/rosidl:
  319. type: git
  320. url: https://github.com/ros2/rosidl.git
  321. version: 1.2.0
  322. ros2/rosidl_dds:
  323. type: git
  324. url: https://github.com/ros2/rosidl_dds.git
  325. version: 0.7.1
  326. ros2/rosidl_defaults:
  327. type: git
  328. url: https://github.com/ros2/rosidl_defaults.git
  329. version: 1.0.0
  330. ros2/rosidl_python:
  331. type: git
  332. url: https://github.com/ros2/rosidl_python.git
  333. version: 0.9.4
  334. ros2/rosidl_runtime_py:
  335. type: git
  336. url: https://github.com/ros2/rosidl_runtime_py.git
  337. version: 0.9.0
  338. ros2/rosidl_typesupport:
  339. type: git
  340. url: https://github.com/ros2/rosidl_typesupport.git
  341. version: 1.0.1
  342. ros2/rosidl_typesupport_connext:
  343. type: git
  344. url: https://github.com/ros2/rosidl_typesupport_connext.git
  345. version: 1.0.2
  346. ros2/rosidl_typesupport_fastrtps:
  347. type: git
  348. url: https://github.com/ros2/rosidl_typesupport_fastrtps.git
  349. version: 1.0.2
  350. ros2/rpyutils:
  351. type: git
  352. url: https://github.com/ros2/rpyutils.git
  353. version: 0.2.0
  354. ros2/rviz:
  355. type: git
  356. url: https://github.com/ros2/rviz.git
  357. version: 8.2.1
  358. ros2/spdlog_vendor:
  359. type: git
  360. url: https://github.com/ros2/spdlog_vendor.git
  361. version: 1.1.2
  362. ros2/sros2:
  363. type: git
  364. url: https://github.com/ros2/sros2.git
  365. version: 0.9.4
  366. ros2/system_tests:
  367. type: git
  368. url: https://github.com/ros2/system_tests.git
  369. version: 0.9.1
  370. ros2/test_interface_files:
  371. type: git
  372. url: https://github.com/ros2/test_interface_files.git
  373. version: 0.8.0
  374. ros2/tinyxml2_vendor:
  375. type: git
  376. url: https://github.com/ros2/tinyxml2_vendor.git
  377. version: 0.7.3
  378. ros2/tinyxml_vendor:
  379. type: git
  380. url: https://github.com/ros2/tinyxml_vendor.git
  381. version: 0.8.0
  382. ros2/tlsf:
  383. type: git
  384. url: https://github.com/ros2/tlsf.git
  385. version: 0.5.0
  386. ros2/unique_identifier_msgs:
  387. type: git
  388. url: https://github.com/ros2/unique_identifier_msgs.git
  389. version: 2.1.2
  390. ros2/urdf:
  391. type: git
  392. url: https://github.com/ros2/urdf.git
  393. version: 2.4.0
  394. ros2/yaml_cpp_vendor:
  395. type: git
  396. url: https://github.com/ros2/yaml_cpp_vendor.git
  397. version: 7.0.2

系统内核还是C为主,工具以C++和Python等为主。

当然上述系统只涉及信息处理,如果需要和现实交互,需要再装备传感器和执行器{物联网机器人操作系统}。

  • 现实-传感器-{数字世界-处理-数字世界}-执行器-现实

如何以此为基础构建“自动驾驶系统”,持续学习中{Apex.Autonomy}

 


 

文章来源: zhangrelay.blog.csdn.net,作者:zhangrelay,版权归原作者所有,如需转载,请联系作者。

原文链接:zhangrelay.blog.csdn.net/article/details/113358571

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。