I am working with Teledyne Lumenera USB Camera. I installed lucam-sdk_2.4.3.94
for Linux on my Ubuntu 18.04. It includes these files:
The api
folder contains this files:
One of the folders is example
which contains several examples for working with Teledyne Lumenera USB Camera
. Each example in example
folder, shows one of the aspects of the camera like setting focus, reading camera info, etc. Each example has a folder that contains some .cpp
, .h
and one make
file.
I want to write a C ROS node that uses this SDK.
First, I create a ROS package in my catkin_ws/src
then I copy one of the examples in SDK into the src
package folder.
When I use catkin_make
, it says that it does not recognize lucamapi.h
, which is one of the header files in the SDK.
My question is two parts:
1- the code that I copied from example folders
contains some .cpp
and .h
files. Also, that has a make
file beside themselves. I do not know how to handle the make
file. How can I put parameters of the following MakeFile
into CMakeList.txt
?
2- I do not know how to change CMakeList.txt
in my ROS package in order to have access to SDK headers, lib, etc.
This is make file
for one of of the examples in the SDK:
#
CC = g
LD = $(CC)
ifndef ARCH
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/x86-64/)
endif
LU_LDFLAGS = -lm -lpthread -lstdc
PROG = livePreview
VERSION = 0.1
INCLUDES = $(LUMENERA_SDK)/include
CFLAGS = -DVERSION=\"$(VERSION)\" -I$(INCLUDES) -g
CFLAGS = -DLUMENERA_LINUX_API
OBJS =
ALL_INCLUDES =
all lu: $(PROG)
clean:
rm -f $(PROG) *.o *.core core *.bak *~
livePreview: verify_environment livePreview.o Camera.o
$(LD) livePreview.o Camera.o `pkg-config --libs opencv` -llucamapi $(LU_LDFLAGS) -o $@
verify_environment:
@if test "$(LUMENERA_SDK)" = "" ; then \
echo "LUMENERA_SDK environment variable is not set!"; \
exit 1; \
fi
Camera.o: Camera.cpp $(INCLUDES)/lucamapi.h
$(CC) $(CFLAGS) -c Camera.cpp
livePreview.o: livePreview.cpp $(INCLUDES)/lucamapi.h
$(CC) $(CFLAGS) -c livePreview.cpp
CodePudding user response:
I solved the problem. Working with CMakeList and ROS was confusing.
Go to this repository, and read instalation part, then look at CMakeList.txt: