Static tf broadcaster declaration seems to cause nodehandle to be created.
My code is something like this-
#include <ros/ros.h>
tf2_ros::StaticTransformBroadcaster static_broadcaster;
ros::Subscriber fiducial_transform;
int main(int argc, char **argv)
{
ros::init(argc, argv, "calibrate");
ros::NodeHandle n;
...
....
...
...
return 0;
}
I am getting the following error.
You must call ros::init() before creating the first NodeHandle
Pretty sure it is happening because of declaring the static_broadcaster. Why is this happening? How do I get around this if I have to declare the staticbroadcaster globally?