Skip to content

Commit

Permalink
Update 014_UART_sender and Uart_receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamvu committed Feb 15, 2022
1 parent 2ae8095 commit c1b0974
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
13 changes: 7 additions & 6 deletions UART_Receiver/uart_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct termios tty;
static char read_buf [1];



char read_buf_distance[1] ;
// Get Num of Person
int Receive_Num_of_Person()
{
Expand All @@ -39,7 +39,7 @@ int Receive_Num_of_Person()

}


read_buf_distance[0] = read_buf[0];
return num_of_person;

}
Expand All @@ -55,6 +55,11 @@ void Get_Data_Checksum( float* frame_data)//, int* checksum_host)

int index = 0;

if(read_buf_distance[0] == 'E')
{
printf("\n DISTANCE : NOT AVAILABLE" );
return;
}

while(read(serial_port, &read_buf, sizeof(read_buf)) && read_buf[0] != 'E')
{
Expand All @@ -75,10 +80,6 @@ void Get_Data_Checksum( float* frame_data)//, int* checksum_host)


frame_data[index] = index_data;
//*checksum_host = (*checksum_host + frame_data[index]) * seed;

//if(*checksum_host > limit)
//*checksum_host = *checksum_host % limit;

printf("\n DISTANCE : %d cm", (int)index_data);
index++;
Expand Down
3 changes: 2 additions & 1 deletion code_samples/013_object_tracking_GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This code will grab the 360 rgb data, do object tracking and toggle GPIO pins of
>>>>>> Compile this code using the following command....
g++ 013_object_tracking_GPIO.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.so ../lib/libPAL_CAMERA.so ../lib/libPAL_DEPTH_HQ.so ../lib/libPAL_DEPTH_128.so ../lib/libPAL_DE.so ../lib/libPAL_EDET.so ../lib/libPAL_Track.so `pkg-config --libs --cflags opencv` -O3 -o 013_object_tracking_GPIO.out -I../include/ -lv4l2 -lcudart -L/usr/local/cuda/lib64 -lnvinfer -lnvvpi -lnvparsers -lnvinfer_plugin -lnvonnxparser -lmyelin -lnvrtc -lcudart -lcublas -lcudnn -lrt -ldl -lJetsonGPIO -lpthread
g++ 013_object_tracking_GPIO.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.so ../lib/libPAL_CAMERA.so ../lib/libPAL_DEPTH_HQ.so ../lib/libPAL_DEPTH_128.so ../lib/libPAL_DE.so ../lib/libPAL_EDET.so ../lib/libPAL_Track.so `pkg-config --libs --cflags opencv` -O3 -o 013_object_tracking_GPIO.out -I../include/ -lv4l2 -lcudart -L/usr/local/cuda/lib64 -lnvinfer -lnvvpi -lnvparsers -lnvinfer_plugin -lnvonnxparser -lmyelin -lnvrtc -lcudart -lcublas -lcudnn -lrt -ldl -lJetsonGPIO -lpthread -w
Expand Down
17 changes: 17 additions & 0 deletions code_samples/014_UART_sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ int main(int argc, char *argv[])
{

signal(SIGINT, signalHandler);

cv::VideoCapture cap;

while(!cap.open("/dev/pal5"))
{
cout << "\n\n[INFO] CAMERA NOT CONNECTED, CONNECT THE CAMERA \n\n" << endl;
system("clear");

}

cap.release();

bool useDepth = false;

Expand Down Expand Up @@ -161,6 +172,12 @@ int main(int argc, char *argv[])
}








int width, height;
if (PAL::Init(width, height, -1) != PAL::SUCCESS) //Connect to the PAL camera
{
Expand Down
2 changes: 1 addition & 1 deletion code_samples/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ g++ 011_object_tracking.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.

g++ 012_people_following.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.so ../lib/libPAL_CAMERA.so ../lib/libPAL_DEPTH_HQ.so ../lib/libPAL_DEPTH_128.so ../lib/libPAL_DE.so ../lib/libPAL_EDET.so ../lib/libPAL_Track.so `pkg-config --libs --cflags opencv` -O3 -o 012_people_following.out -I../include/ -lv4l2 -lcudart -L/usr/local/cuda/lib64 -lnvinfer -lnvvpi -lnvparsers -lnvinfer_plugin -lnvonnxparser -lmyelin -lnvrtc -lcudart -lcublas -lcudnn -lrt -ldl -lpthread

g++ 013_object_tracking_GPIO.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.so ../lib/libPAL_CAMERA.so ../lib/libPAL_DEPTH_HQ.so ../lib/libPAL_DEPTH_128.so ../lib/libPAL_DE.so ../lib/libPAL_EDET.so ../lib/libPAL_Track.so `pkg-config --libs --cflags opencv` -O3 -o 013_object_tracking_GPIO.out -I../include/ -lv4l2 -lcudart -L/usr/local/cuda/lib64 -lnvinfer -lnvvpi -lnvparsers -lnvinfer_plugin -lnvonnxparser -lmyelin -lnvrtc -lcudart -lcublas -lcudnn -lrt -ldl -lJetsonGPIO -lpthread
g++ 013_object_tracking_GPIO.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.so ../lib/libPAL_CAMERA.so ../lib/libPAL_DEPTH_HQ.so ../lib/libPAL_DEPTH_128.so ../lib/libPAL_DE.so ../lib/libPAL_EDET.so ../lib/libPAL_Track.so `pkg-config --libs --cflags opencv` -O3 -o 013_object_tracking_GPIO.out -I../include/ -lv4l2 -lcudart -L/usr/local/cuda/lib64 -lnvinfer -lnvvpi -lnvparsers -lnvinfer_plugin -lnvonnxparser -lmyelin -lnvrtc -lcudart -lcublas -lcudnn -lrt -ldl -lJetsonGPIO -lpthread -w

g++ 014_UART_sender.cpp /usr/src/tensorrt/bin/common/logger.o ../lib/libPAL.so ../lib/libPAL_CAMERA.so ../lib/libPAL_DEPTH_HQ.so ../lib/libPAL_DEPTH_128.so ../lib/libPAL_DE.so ../lib/libPAL_EDET.so ../lib/libPAL_Track.so `pkg-config --libs --cflags opencv` -O3 -o 014_UART_sender.out -I../include/ -lv4l2 -lcudart -L/usr/local/cuda/lib64 -lnvinfer -lnvvpi -lnvparsers -lnvinfer_plugin -lnvonnxparser -lmyelin -lnvrtc -lcudart -lcublas -lcudnn -lrt -ldl -lJetsonGPIO -lpthread -w

0 comments on commit c1b0974

Please sign in to comment.