ROS1发布5年长支持版本为indigo/kinetic/melodic/noetic。
ROS2将于2022年5月发布第一款5年长支持版本。
这也是ROS2机器人作为开发生态走向成熟的标志之一。
猜测,如果不是5年,那么说明还需要等等。
Humble Hawksbill 预计5年!
May 23rd, 2022 May 2027
Galactic Geochelone (⊙﹏⊙)
May 23rd, 2021 November 2022
Foxy Fitzroy (⊙﹏⊙)
June 5th, 2020 May 2023
Eloquent Elusor End
November 22nd, 2019 November 2020
Dashing Diademata End
May 31st, 2019 May 2021
Crystal Clemmys End
December 14th, 2018 December 2019
Bouncy Bolson End
July 2nd, 2018 July 2019
Ardent Apalone End
December 8th, 2017 December 2018
beta3 End
September 13th, 2017 December 2017
beta2 End
July 5th, 2017 September 2017
beta1 End
December 19th, 2016 Jul 2017
alpha1 - alpha8 End
August 31th, 2015 December 2016
DDS:
默认情况下,ROS 2 使用 DDS 作为其中间件。 它与多个 DDS 或 RTPS(DDS 有线协议)供应商兼容。 目前支持 eProsima 的 Fast DDS、RTI 的 Connext DDS、Eclipse Cyclone DDS 和 GurumNetworks GurumDDS。 请参阅 https://ros.org/reps/rep-2000.html,了解按发行版支持的 DDS 供应商。
Humble:the default DDS vendor is eProsima’s Fast DDS
Galactic:the default DDS vendor is Eclipse’s Cyclone DDS
Foxy:the default DDS vendor is eProsima’s Fast DDS
局域网内无需配置,或简单配置ROS_DOMAIN_ID即可互通。
docs.ros.org/en/humble/Concepts/About-Domain-ID.html
win11 foxy:
ros2 run examples_rclcpp_minimal_publisher publisher_member_function
ubuntu22.04 humble:
ros2 run examples_rclcpp_minimal_subscriber subscriber_member_function
pub:
代码语言:javascript复制#include <chrono>
#include <memory>
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
using namespace std::chrono_literals;
/* This example creates a subclass of Node and uses std::bind() to register a
* member function as a callback from the timer. */
class MinimalPublisher : public rclcpp::Node
{
public:
MinimalPublisher()
: Node("minimal_publisher"), count_(0)
{
publisher_ = this->create_publisher<std_msgs::msg::String>("topic", 10);
timer_ = this->create_wall_timer(
500ms, std::bind(&MinimalPublisher::timer_callback, this));
}
private:
void timer_callback()
{
auto message = std_msgs::msg::String();
message.data = "Hi, From Foxy to Humble! 无比快乐" std::to_string(count_ );
RCLCPP_INFO(this->get_logger(), "Publishing: '%s'", message.data.c_str());
publisher_->publish(message);
}
rclcpp::TimerBase::SharedPtr timer_;
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr publisher_;
size_t count_;
};
int main(int argc, char * argv[])
{
rclcpp::init(argc, argv);
rclcpp::spin(std::make_shared<MinimalPublisher>());
rclcpp::shutdown();
return 0;
}
sub:
代码语言:javascript复制#include <memory>
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
using std::placeholders::_1;
class MinimalSubscriber : public rclcpp::Node
{
public:
MinimalSubscriber()
: Node("minimal_subscriber")
{
subscription_ = this->create_subscription<std_msgs::msg::String>(
"topic", 10, std::bind(&MinimalSubscriber::topic_callback, this, _1));
}
private:
void topic_callback(const std_msgs::msg::String::SharedPtr msg) const
{
RCLCPP_INFO(this->get_logger(), "I heard: '%s'", msg->data.c_str());
}
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription_;
};
int main(int argc, char * argv[])
{
rclcpp::init(argc, argv);
rclcpp::spin(std::make_shared<MinimalSubscriber>());
rclcpp::shutdown();
return 0;
}