Problems using coppeliasim + pytorch in c ++

Typically: "How do I... ", "How can I... " questions
Post Reply
CarlosToro
Posts: 2
Joined: 31 May 2019, 07:32

Problems using coppeliasim + pytorch in c ++

Post by CarlosToro »

Good Morning,

I am trying to use the coppeliasim simulator from c ++ for which I make use of Opencv, Visp and Pytorch c ++. In an independent file where I have opencv, visp and pytorch everything is going well, at the moment of integrating it with coppeliasim it starts to report errors in pytorch that I did not have before, I am using cmake, has someone been successful in using pytorch c ++ in coppeliasim?

CMakeLists.txt:

Code: Select all

# cmake
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(example-app)
set(CMAKE_CXX_STANDARD 14)
list(APPEND CMAKE_PREFIX_PATH "/home/carlos/pytorch1/libtorch-cxx11-abi-shared-with-deps-1.7.1+cpu/libtorch")
find_package(Torch REQUIRED)  
find_package(OpenCV REQUIRED)
find_package(VISP REQUIRED)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lm -ldl")

# vrep
include_directories(example-app remoteApi)
include_directories(example-app include)

add_definitions (-DNON_MATLAB_PARSING)
add_definitions (-DMAX_EXT_API_CONNECTIONS=255)
add_definitions (-DDO_NOT_USE_SHARED_MEMORY)


add_executable(example-app main.cpp remoteApi/extApi.c remoteApi/extApiPlatform.c)
target_link_libraries(example-app ${TORCH_LIBRARIES} ${OpenCV_LIBS})
set_property(TARGET example-app PROPERTY CXX_STANDARD 14)
One of the errors is error: expected identifier before ‘int’ AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTS(DEFINE_ENUM).

Thank you very much .

Regards.

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Problems using coppeliasim + pytorch in c ++

Post by coppelia »

Hello,

The error does not seem to be directly related to CoppeliaSim... can you remove CoppeliaSim items one-by-one and see when the error doesn't show anymore?

oh and in which file and what error is the very first one that appears?

Cheers

CarlosToro
Posts: 2
Joined: 31 May 2019, 07:32

Re: Problems using coppeliasim + pytorch in c ++

Post by CarlosToro »

Good Morning,

I already found the problem, the error appears when I include the header visp3/gui/vpDisplayX.h, apparently a problem of incompatibility with the X11 library arises, thank you very much for your answer.

regards,
Carlos.

Post Reply