How to use spin_once for ROS2 foxy rclcpp?
Hi,
System used: ROS2 foxy on Ubuntu 20.04 on amd64 architecture.
I use VS Code. In python, I have easily used rospy.spin_once
as VS Code provides me the suggestions as soon as I type dot.
In python, I see rclpy.spin
, rclpy.spin_once
, and rclpy.spin_until_future_complete
But when I try to do the same for a C++ code, I don't find rclcpp::spin_once
. Instead, I see rclcpp::spin
, rclcpp::spin_some
, and rclcpp::spin_until_future_complete
only. So, this makes me think that spin_some
is absent in rclpy
and spin_once
is absent in rclcpp
.
I found one example on the internet which used spin_once with rclcpp here but don't understand it.
Any idea how to use the functionality provided by rclpy.spin_once
in rclcpp
?
Thanks in advance!