To whoever struggles the same problem as me, for having your callback function for QoS, specify the callback function in rclcpp::SubscriptionOptions.