Unable to run camera_gmsl

I have been trying to compile and build the driveworks samples camera_gmsl in PX2.

I have installed glfw 3.2.1 because the system cannot find glfw3 libraries

The CMakeList is

set (CMAKE_CXX_STANDARD 11)
set(VIBRANTE TRUE)
add_definitions(-DVIBRANTE)

find_package(CUDA REQUIRED)
find_package(Threads REQUIRED)
find_package(GLEW REQUIRED)
#find_package(Driveworks REQUIRED)	#cmake could not find driveworks
#find_package(OpenCV REQUIRED)

# SET THESE VARIABLES TO YOUR DRIVEWORKS LOCATIONS
set(Driveworks_INCLUDE_DIR /usr/local/driveworks/include/)
set(Driveworks_LIBRARY /usr/local/driveworks/lib/)


link_directories(/usr/lib)
link_directories(${Driveworks_LIBRARY})

include_directories(include)
include_directories(common)
include_directories(
  ${Driveworks_INCLUDE_DIR}
  ${Driveworks_COMMON_DIR}
  ${CUDA_INCLUDE_DIRS}
  ${GLEW_INCLUDE_DIR}    
# ${OpenCV_INCLUDE_DIR}
)

include_directories(/usr/share/visionworks/sources/3rdparty/nvmedia/
					/usr/share/visionworks/VisionWorks-1.6-Samples/3rdparty/glfw3/include/
					/usr/share/visionworks/VisionWorks-1.6-Samples/3rdparty/opengl/
					/usr/share/visionworks/VisionWorks-1.6-Samples/3rdparty/eigen
)


add_executable(gmsl
 	src/main.cpp
	common/ProgramArguments.cpp
	common/ConsoleColor.cpp
	common/WindowEGL.cpp
	common/WindowGLFW.cpp
)

target_link_libraries(gmsl
  nvmedia
  driveworks
  ${GLEW_LIBRARY}  
  GLESv2
  EGL
  drm
  glfw3 pthread dl GLU GL rt Xrandr Xxf86vm Xi Xinerama X11 Xcursor
  ${CUDA_LIBRARY}  
)

It compiled successfully, but it gave the following error during execution. I have one AR0231 camera attached to port A0.

Driveworks exception thrown: DW_NOT_AVAILABLE: VertexArrayObject: No OpenGL context exists
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot init renderer: DW_NOT_AVAILABLE
Aborted (core dumped)

The driveworks version is driveworks-0.2.1

What could be the problem?

Dear chee0007,
Are you referring to sample_camera_gsml in driveWorks sample?
After flashing the drive, are you able to run other driveWorks samples?
Can you tell the DriveInstall version?

Thanks
Sivaramakrishna

Hi Sivaramakrishna,

Thanks for the prompt reply.
The PX2 comes preloaded with driveworks-0.2.1, so I did not re-flash it.
I am able to run the binaries of all the driveworks samples.

What I am trying to do now is to gather all the necessary files to run the camera_gmsl in a folder and try to compile it in PX2.

Hi,

I am getting the same problem initializing the renderer. Did you manage to solve this problem?

Regards,
Linn

Hi chee0007,

Using GLFW versions later than 3.2, setting the window hint GLFW_CONTEXT_CREATION_API to GLFW_EGL_CONTEXT_API in the WindowGLFW class constructor seemed to have solved the issue for me.

Regards,
Linn