惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Lucky帅小武

AI学习入门,超清晰AI知识图谱整理及核心概念解析 基于SSM的在线考试系统毕业设计论文【范文】 基于SSM的仓库进销存系统毕业设计论文【范文】 基于SSM的在线外卖订餐系统毕业设计论文【范文】 基于SSM的酒店管理系统毕业设计论文【范文】 基于SSM的校园论坛网站系统毕业设计论文【范文】 ROS2笔记5--动作通讯 ROS2笔记4--服务通讯 ROS2笔记3--话题通讯 ROS2笔记2--工作空间、功能包、节点 ROS2笔记1--简介及开发环境搭建 基于SSM的网上商城系统毕业设计论文【范文】 软考笔记(1)--操作系统 软考笔记(9)--计算机组成原理4--总线系统 软考笔记(9)--计算机组成原理3--处理器 软考笔记(9)--计算机组成原理2--指令系统 软考笔记(8)--多媒体技术 软考笔记(7)--数据库关系代数 软考笔记(5)--系统安全性与保密性设计
ROS2笔记6--ROS2常用命令工具
Lucky帅小武 · 2024-04-19 · via 博客园 - Lucky帅小武

1、ros2 pkg create

功能:创建功能包,创建时指定包名、编译方式、依赖项等

格式ros2 pkg create --build-type <ament_python> <pkg_name>

ros2 pkg create : 创建包的指令

build-type:功能包编译方式,ament_python表示Python;ament_cmake表示C++或C

pkg_name:包名

rclpy std_msgs:依赖项

2、ros2 pkg list

功能:查看系统中功能包列表

格式ros2 pkg list

0

3、ros2 pkg executeables

功能:查看包内可执行文件列表

格式ros2 pkg executables <pkg_name>

pkg_name表示功能包名称

0

4、ros2 run

功能:运行功能包节点程序

格式ros2 run <pkg_name> <node_name>

pkg_name表示功能包名称

node_name表示节点名称

0

5、ros2 node list

功能:查询当前域内节点列表

格式ros2 node list

0

6、ros2 node info

功能:查看节点详细信息,包括订阅、发布的消息,开启的服务或动作等

格式ros2 node info <node_name>

node_name表示节点名称

0

7、ros2 topic list

功能:查看当前域内的所有话题

格式ros2 topic list

0

8、ros2 topic info

功能:显示话题消息类型,订阅者/发布者数量

格式ros2 topic info <topic_name>

topic_name表示话题名称

0

9、ros2 topic type

功能:查看话题的消息类型

格式ros2 topic type <topic_name>

topic_name表示话题名称

0

10、ros2 topic hz

功能:查看话题平均发布频率

格式ros2 topic hz <topic_name>

 topic_name表示话题名称

0

11、ros2 topic echo

功能:打印话题消息,相当于一个订阅者

格式ros2 topic echo <topic_name>

topic_name表示话题名称

0

12、ros2 topic pub

功能:在终端发布指定话题消息

格式ros2 topic pub <topic_name> <message_type> <message_content>

topic_name表示话题名称

message_type表示话题数据类型

message_content表示话题消息内容

默认是以1Hz的频率循环发布,可以设置以下参数:

参数-1只发送一次 :ros2 topic pub -1 topic_name messge_type message_content

参数-t count循环发送count次: ros2 topic pub -t count topic_name messge_type message_content

参数-r count以count Hz的频率循环发送: ros2 topic pub -r count topic_name messge_type message_content

如下案例循环发送5次到话题 topic_demo中,类型为std_msgs/String,类型为json格式字符串Hello World

0

13、ros2 interface list

功能:查询当前系统的所有接口,包括话题、服务、动作

格式ros2 interface list

0

14、ros2 interface show

功能:查看指定接口的详细信息

格式ros2 interface show <interface_name>

 interface_name表示接口名称

0

15、ros2 service list

功能:查看当前域内所有的服务

格式:ros2 service list

0

16、ros2 service call

功能:调用指定服务

格式ros2 service call <service_name> <service_type>

service_name:调用的服务名

service_type:服务数据类型

arguments:服务传入参数

调用加法服务传入参数a和参数b,得到结果sum

0