-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example using spin_some might throw exception #266
Labels
help wanted
Extra attention is needed
Comments
suggest to put spin_some in a try-catch block in example code, i guess. |
are you gonna make a PR on this? |
@hdino friendly ping. |
hidmic
added
enhancement
New feature or request
help wanted
Extra attention is needed
and removed
enhancement
New feature or request
labels
May 7, 2020
fujitatomoya
added a commit
to fujitatomoya/examples
that referenced
this issue
May 14, 2020
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
jacobperron
pushed a commit
that referenced
this issue
May 28, 2020
I also recently have the issue of ros2/rclcpp#1066, and the fix I found out is something similar to luym11@26dfef3. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The examples in this repository are besides the ROS2 tutorials the first place to learn ROS2. Therefore, many public repositories, for instance of universities or research institutes, contain code that uses exactly the same procedures as shown here.
The
minimal_publisher
example shows how to userclcpp::spin_some
. However, as pointed out in ros2/rclcpp#1066,rclcpp::spin_some
will throw an exception if the program received a SIGINT and processed the shutdown after checkingrclcpp::ok()
, but before constructing theSingleThreadedExecutor
inrclcpp::spin_some
. This behaviour can easily be triggered by:@fujitatomoya created a working example.
In ros2/rclcpp#1066 we already discussed some possible solutions, but we thought it's better to discuss this issue here. What are your opinions?
The text was updated successfully, but these errors were encountered: