Last active
June 5, 2017 22:11
-
-
Save youtalk/1757ebfcd252d22fbe511104ee5a6967 to your computer and use it in GitHub Desktop.
two_node_pipeline.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char * argv[]) | |
{ | |
setvbuf(stdout, NULL, _IONBF, BUFSIZ); | |
rclcpp::init(argc, argv); | |
// 複数のノードを単一スレッドで実行させる実行器 | |
rclcpp::executors::SingleThreadedExecutor executor; | |
auto producer = std::make_shared<Producer>("producer", "number"); | |
auto consumer = std::make_shared<Consumer>("consumer", "number"); | |
// Pub/Subノードの登録 | |
executor.add_node(producer); | |
executor.add_node(consumer); | |
// 実行器の実行開始 | |
executor.spin(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment