{"id":24091787,"url":"https://github.com/wuhanstudio/rt-rosserial","last_synced_at":"2025-12-27T04:56:06.439Z","repository":{"id":46193630,"uuid":"179793356","full_name":"wuhanstudio/rt-rosserial","owner":"wuhanstudio","description":"rosserial on RT-Thread (ROS1).","archived":false,"fork":false,"pushed_at":"2021-11-08T11:24:13.000Z","size":3291,"stargazers_count":20,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-05T04:54:18.342Z","etag":null,"topics":["ros","rosserial","rt-thread","tcp","uart"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wuhanstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-06T05:37:24.000Z","updated_at":"2022-10-05T18:09:39.000Z","dependencies_parsed_at":"2022-09-25T06:21:43.585Z","dependency_job_id":null,"html_url":"https://github.com/wuhanstudio/rt-rosserial","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhanstudio%2Frt-rosserial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhanstudio%2Frt-rosserial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhanstudio%2Frt-rosserial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuhanstudio%2Frt-rosserial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuhanstudio","download_url":"https://codeload.github.com/wuhanstudio/rt-rosserial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233312720,"owners_count":18657093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ros","rosserial","rt-thread","tcp","uart"],"created_at":"2025-01-10T07:44:43.056Z","updated_at":"2025-09-17T01:32:08.088Z","avatar_url":"https://github.com/wuhanstudio.png","language":"C++","funding_links":[],"categories":["Packages"],"sub_categories":["Peripherals"],"readme":"![](doc/rosorg.png)\n\n\u003e 这个分支是 Noetic，其他分支可以查看这里 [Kinetic](https://github.com/wuhanstudio/rt-rosserial/tree/kinetic)/[Melodic](https://github.com/wuhanstudio/rt-rosserial/tree/melodic)\n\n### 1. ROS 介绍\n**机器人操作系统 ROS** (Robots Operating System) 最早是斯坦福大学的一个软件框架，现在不管是工业机器人，还是娱乐用的机器人都运行着 ROS。\n\n![robots](doc/ros.png)\n\n一个机器人通常有很多个部件、传感器，为了保证机器人不会因为某一个传感器故障，导致整个系统瘫痪，所以采用了分布式的节点，利用不同节点之间的通讯收集传感器数据和控制指令，这篇文档后面会使用到的通讯协议就是 **rosserial**。\n\n**rosserial** 可以很方便地让自己的 MCU 用 **USART 有线** 或者 **TCP 无线**  和 ROS 连接，发布传感器信息到 ROS 节点，或者从 ROS 节点订阅传感器信息，例如下面和 ROS 连接后，可以用电脑控制的摄像头小车：\n\n![ros car](doc/ros.gif)\n\n现在可以选择下面2中通信方式中的一种：\n\n- UART\n- TCP \n\n如果使用 TCP 当然要先确保 rt-thread 有网卡设备，并获取到 IP 地址，例如：\n\n- enc28j60 (SPI) + lwip。\n\n\n### 2. 使用说明\n\n#### 2.1 安装 ROS\n\n首先需要一个比较强劲的CPU用来运行 ROS 的主节点，例如 PC 或者 ARM ，安装过程可以参照 ROS 的[官网](http://wiki.ros.org/ROS/Installation)，现在官方支持最好的还是 Debian 系列。\n\n下面以 Ubuntu 安装 **ROS Melodic** 为例：\n\n依赖：\n\n\tsudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential\n\n安装：  \n\n\tsudo sh -c 'echo \"deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main\" \u003e /etc/apt/sources.list.d/ros-latest.list'\n\tsudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116\n\tsudo apt update\n\tsudo apt install ros-melodic-desktop-full\n\n初始化： \n\n\tsudo rosdep init\n\trosdep update\n\techo \"source /opt/ros/melodic/setup.bash\" \u003e\u003e ~/.bashrc\n\tsource ~/.bashrc\n\n#### 2.2 启动 ROS\n\n首先启动一个主节点：\n\n\troscore\n\n#### 2.3 建立连接\n\n如果使用的串口：\n\n\trosrun rosserial_python serial_node.py /dev/ttyUSB0\n\n如果使用的 TCP：\n\n\trosrun rosserial_python serial_node.py tcp\n\n#### 2.4 订阅话题\n\n以 hello world 为例：\n\n\trostopic echo /chatter\n\n\n### 3. 感谢\n\n- rosserial: https://github.com/ros-drivers/rosserial\n\n### 4. 联系方式\n\n* 维护：Wu Han\n* 主页：http://wuhanstudio.cc\n* 联系：https://github.com/wuhanstudio/rt-rosserial/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuhanstudio%2Frt-rosserial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuhanstudio%2Frt-rosserial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuhanstudio%2Frt-rosserial/lists"}