Closed sagunms closed 3 months ago
FYI, when using GenericSubscription
on later versions than ros-galactic, handle_serialized_message method should be used instead of handle_message.
On ros-galactic
auto void_serialized_msg = std::static_pointer_cast<void>(serialised_msg);
subscriptions.at(i)->handle_message(void_serialized_msg, msg_info);
On ros-humble, iron, rolling
subscriptions.at(i)->handle_serialized_message(serialized_msg, msg_info);
I am trying to migrate my working ROS2 Galactic code since it is now EOL. I tested this on Rolling/Humble/Iron but non of them work. The API for using
rclcpp::WaitSet
withrclcpp::GenericSubscription
seems to have changed.Bug report
Required Info:
Steps to reproduce issue
Setup
Terminal 1: Publish String message at 2 Hz
Terminal 2: Publish IMU message at 1 Hz
Terminal 3: Run built executable
Running the following creates two subscribers:
/topic/string
(std_msgs/msg/String
) and/topic/imu
(sensor_msgs/msg/Imu
).Expected behavior
/topic/string
(2 Hz) and/topic/imu
(1 Hz) respectively.Actual behavior
handle_message is not implemented for GenericSubscription
.