Problem with using subscriber from initialize method.
Hi. Sorry for all mistakes, English is not my native language. I am porting my project from Noetic to Foxy and I have flowing code:
bool STMRobotHW::initialize(ros::NodeHandle nh)
{
...
hw_feedback_sub = nh.subscribe("hw_feedback", 1000, &STMRobotHW::feedbackCallback, this);
}
void STMRobotHW::feedbackCallback(const minicar_control::Feedback &fb_msg)
{
....
}
I have hard time understanding how this subscribe should look in Foxy if there are no obj parameter parameter for create_subscribe in ROS 2, or at least I couldn't find any. Appreciate any help.
Please look at Writing a simple publisher and subscriber (C++) tutorial suggested by @thejeeb. Furthermore, you can look at ros2/examples and ros2/demos
Thank you for help