Conversation
|
@hardikparwana tested, it works. Ready to merge. |
|
@hardikparwana can you confirm whether this is ready to be merged in? |
|
It takes a few moment for the ROS2 node discovery and connect to the drone node. Therefore I think we can spin it at background and have it setup the connection between each drone and wait for a user input to trigger the estop command. |
chenrc98
left a comment
There was a problem hiding this comment.
Having the node connection setup is more robust in the complex network environment, I would suggest these changes.
|
|
||
| rclcpp::init(argc, argv); | ||
|
|
||
| rclcpp::spin(std::make_shared<Estop>()); |
There was a problem hiding this comment.
change to
auto estop_node = std::make_shared<Estop>();
rclcpp::executors::MultiThreadedExecutor server_exec;
server_exec.add_node(estop_node);
auto server_spin_exec = [&server_exec]() {
server_exec.spin();
};
There was a problem hiding this comment.
ok good idea, ill make these changes, but we should wait only merge them after weve tested to see that it works.
| timer_ = this->create_wall_timer( | ||
| 200ms, std::bind(&Estop::timer_callback, this)); | ||
| } | ||
|
|
| } | ||
|
|
||
| private: | ||
|
|
| rclcpp::init(argc, argv); | ||
|
|
||
| rclcpp::spin(std::make_shared<Estop>()); | ||
|
|
There was a problem hiding this comment.
Block by
int n;
std::cin >> n;
estop_node.estop();
while(rclcpp::ok()) {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
There was a problem hiding this comment.
ok we can do something like this. are you sure the std::cin trick works in multithreaded?
No description provided.