You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have use the C++ thread with the LCM::subscribe in main function.The thread run well.But subscribe doesn't call the call back method.Does the subscribe can't use when I use a C++ thread.
Here is my code:
int main(int argc,char **argv){
Camera zed;
InitParameters init_params;
init_params.camera_resolution = RESOLUTION_HD1080;
init_params.depth_mode = DEPTH_MODE_PERFORMANCE;
init_params.coordinate_units = UNIT_METER;
if (argc > 1) init_params.svo_input_filename.set(argv[1]);
ERROR_CODE err = zed.open(init_params);
if (err != SUCCESS) {
printf("%s\n", toString(err).c_str());
zed.close();
return 1; // Quit if an error occurred
}
//LCM
lcm::LCM lcm;
if (!lcm.good())
return 1;
Handler handlerObject;
lcm.subscribe("InsData",&Handler::Callback_RTK,&handlerObject);//The Callback_RTK can't cout anything.
thread t1 (savepic,ref(zed));
thread t2 (saveIMU,ref(zed));
thread t3 (saveRTK);//file out the Rtk data. RTK vector is a global variable.
//thread t4 (lcm.subscribe,ref("InsData"),ref(Handler::Callback_RTK),ref(handlerObject));
//t4.join();
t3.join();
t2.join();
t1.join();
while(0==lcm.handle());
return 0;
}
The text was updated successfully, but these errors were encountered:
I have use the C++ thread with the LCM::subscribe in main function.The thread run well.But subscribe doesn't call the call back method.Does the subscribe can't use when I use a C++ thread.
Here is my code:
int main(int argc,char **argv){
Camera zed;
InitParameters init_params;
init_params.camera_resolution = RESOLUTION_HD1080;
init_params.depth_mode = DEPTH_MODE_PERFORMANCE;
init_params.coordinate_units = UNIT_METER;
if (argc > 1) init_params.svo_input_filename.set(argv[1]);
}
The text was updated successfully, but these errors were encountered: