ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
In both yours:
while (ros::ok()) {
...
}
you must call:
ros::spinOnce();
otherwise callbacks are not called/executed
2 | No.2 Revision |
In both yours:
while (ros::ok()) {
...
}
you must call:
ros::spinOnce();
otherwise callbacks are not called/executed
Furthermore in the first script you call the constructor of the class, but af the end it will automatically call your destructor since you intialize your class, do nothing, and then you go back to main.
3 | No.3 Revision |
In both yours:
while (ros::ok()) {
...
}
you must call:
ros::spinOnce();
otherwise callbacks are not called/executed
Furthermore in the first script you call the constructor of the class, but af the end it will automatically call your destructor since you intialize your class, do nothing, and then you go back to main.
To understand what I mean try something like that:
TeleopAgv::TeleopAgv()
{
...
ROS_INFO("Calling the constructor of class bla bla");
}
TeleopAgv::~TeleopAgv()
{
ROS_INFO("Calling the destructor of class bla bla");
}