ROS 1到ROS 2项目移植的一些转换点

这些指南展示了如何将现有的ROS 1软件包转换为ROS 2。如果您是ROS 1和ROS 2之间移植的新手,建议您按顺序阅读指南。[1](#1)

ROS ROS2
ros::Time::now() rclcpp::Clock().now()
ros::Duration() rclcpp::Duration::from_seconds()
ros::Duration(0.250).sleep() rclcpp::sleep_for(std::chrono::seconds(1))
rclcpp::sleep_for(std::chrono::milliseconds(250))
ros::spin()
ros::ok() rclcpp::ok()
ros::Publisher rclcpp::Publisher<std_msgs::msg::String>::SharedPtr
ros::Subscriber rclcpp::Subscriber<std_msgs::msg::String>::SharedPtr
ros::ServiceClient rclcpp::Client<my_interfaces::srv::AddTwoInts>::SharedPtr
ros::ServiceServer rclcpp::Service<my_interfaces::srv::AddTwoInts>::SharedPtr
ROS_INFO/WARN/ERROR("print some msg") RCLCPP_INFO/WARN/ERROR(rclcpp::get_logger(LOGGER_NAME), "print some msg")
#include "ros/ros.h" #include "rclcpp/rclcpp.hpp"

  1. ros.org Migrating from ROS 1 to ROS 2 ↩︎
相关推荐
智慧景区与市集主理人6 分钟前
巨有科技智慧康养|避开康养文旅内卷,做能变现的疗愈数字化
大数据·人工智能·科技
新知图书7 分钟前
文档感知任务定义与分类
人工智能·agent·ai agent·智能体
FriendshipT22 分钟前
Ultralytics:解读SPPF模块
人工智能·pytorch·python·深度学习·目标检测
冷小鱼23 分钟前
AI Agent 核心算法:任务规划(Planning)的深度技术解析
人工智能·算法·planning
木卫二号Coding24 分钟前
Cursor+GitOps:自动化运维新姿势
人工智能
GEO_ai_zhijian25 分钟前
企业AI可见度公益评测正式启动
人工智能
韦胖漫谈IT29 分钟前
Apple M3 Max 与 Apple M5 Max 对比:本地算力的新旧王者之争
网络·人工智能·macos·transformer
武子康29 分钟前
给 Coding Agent 写仓库规则:硬约束、软约束、证据门禁三类拆解 + 6 步可执行闭环
人工智能·aigc·agent
波动几何30 分钟前
人类活动领域穷尽分类体系human-activity-domains
人工智能
MartinYeung531 分钟前
[论文学习]揭示大语言模型智能体记忆模块中的隐私风险
人工智能·学习·语言模型