@@ -51,7 +51,7 @@ const double elev_angles[32] = {-15, 1, -13, 3, -11, 5, -9, 7, -7, 9, -5,
51
51
using namespace std ;
52
52
53
53
int global_ctr = 0 ; // to print out the packet number
54
- const int cycle_num = 100 ;
54
+ const int cycle_num = 50 ;
55
55
const int delay_us = 50000 ;
56
56
int user_data;
57
57
@@ -80,7 +80,7 @@ void compressFiles(int signum){
80
80
81
81
void deleteFiles (int signum){
82
82
exit_thread = true ;
83
- cout << " deleting pcap and video files" << endl;
83
+ cout << " \n deleting pcap and video files" << endl;
84
84
if ( system (" rm Sample_1.pcap Sample_2.pcap out.avi" ) < 0 ){
85
85
cout << " error in deleting files" << endl;
86
86
}
@@ -96,6 +96,12 @@ void canData(){
96
96
cout << " return from can_main function: " << can_return << endl;
97
97
}
98
98
99
+
100
+ /* -------------------------------------------------------------
101
+ -------------Functions for user UI---------------------------
102
+ -------------------------------------------------------------*/
103
+
104
+
99
105
void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event,
100
106
void * viewer_void)
101
107
{
@@ -112,6 +118,7 @@ void keyboardEventOccurred (const pcl::visualization::KeyboardEvent &event,
112
118
}
113
119
}
114
120
121
+
115
122
void mouseEventOccurred (const pcl::visualization::MouseEvent &event,
116
123
void * viewer_void)
117
124
{
@@ -458,6 +465,7 @@ namespace offline
458
465
{
459
466
void packetHandler_I (u_char *userData, const struct pcap_pkthdr * pkthdr, const u_char * packet)
460
467
{
468
+ while (*pause_sim_kb == 1 ){}
461
469
// assign the packaged ethernet data to the struct
462
470
pcl::visualization::CloudViewer *viewer = (pcl::visualization::CloudViewer *) userData;
463
471
struct data_packet processed_packet;
@@ -482,6 +490,7 @@ namespace offline
482
490
483
491
void packetHandler_II (u_char *userData, const struct pcap_pkthdr * pkthdr, const u_char * packet)
484
492
{
493
+ while (*pause_sim_kb == 1 ){}
485
494
// assign the packaged ethernet data to the struct
486
495
pcl::visualization::CloudViewer *viewer = (pcl::visualization::CloudViewer *) userData;
487
496
struct data_packet processed_packet;
0 commit comments