Skip to content

Tag: c++

Undefined reference to `main` error when embedding Python in C++

I’m trying to embed Python in C++. This is my Python file (with the name EmbedTest.py): This is my C++ file (with the name EmbedTest.cpp and located in the same folder as EmbedTest.py) Compiling is fine. I use the flags suggested by python3.6-config –cflags. Hence gcc -c -I/home/MyFolder/anaconda3…

CUDA(GPU) as OpenCV backend

Am trying to use CUDA as backend for dnn module provided in opencv-4.1.1 , I have build opencv with CUDA enabled, nvidia drivers and CUDA is properly placed on system, here am using manjaro as development platform. am trying to load pre-trained YOLOv3 weights using cv2.dnn module, But it uses CPU as defualt i…

Logging with Python, ROS, and C++

I have a codebase of Python and C++ code, including heavy use of ROS. Logging is done throughout the Python code with both system logger and rospy logging — contrived example: As for C++ code we need to add logging, probably with glog but I’m open to other options. Is there a way to integrate the …

Reading a C-struct via sockets into python

On an embedded device running a C application, I have defined this struct: On request, I send this struct via sockets: and read it from a Python script on my desktop: This is the data printed to console on my desktop: How can i reassemble the data into a YourStruct? Note that the embedded device uses little e…