实测
文章中拉去github的代码地址已经无效了,应该改成作者新的仓库地址
新仓库地址
https://github.com/ros2/examples/tree/jazzy/rclcpp/topics/minimal_publisher
修改在终端运行的后拉取代码如下
curl -sk https://github.com/ros2/examples/blob/jazzy/rclcpp/topics/minimal_publisher/lambda.cpp -o publisher_lambda_function.cpp