Skip to content

Instantly share code, notes, and snippets.

@linknum23
Created June 21, 2017 17:42
Show Gist options
  • Save linknum23/153c508f2610f4b4fd4fae39aa8f862b to your computer and use it in GitHub Desktop.
Save linknum23/153c508f2610f4b4fd4fae39aa8f862b to your computer and use it in GitHub Desktop.
CMakeList configuration for compiling ROS and Driveworks on a Tegra (Drive PX2)
cmake_minimum_required(VERSION 3.1)
project(dw_wrapper)
set (CMAKE_CXX_STANDARD 11)
# FindDriveworks.cmake, ArchConfiguration.cmake, and LibFindMacros.cmake were needed for my setup they are taken from driveworks/samples/cmake/
# ArchConfiguration.cmake was the only file that needed small changes, remove the fatal error on line 17 and add the following lines in its place
# set(VIBRANTE TRUE)
# add_definitions(-DVIBRANTE)
# this is the path I placed the driveworks cmake files in
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/dw_ros/cmake/Modules/")
find_package(CUDA REQUIRED)
find_package(Threads REQUIRED)
find_package(GLEW REQUIRED)
find_package(Driveworks REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
geometry_msgs
)
catkin_package(
LIBRARIES ${PROJECT_NAME}
)
include_directories(
${catkin_INCLUDE_DIRS}
${Driveworks_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)
# TODO: add a FindNvmedia.cmake file for this? Why does it not exist?
include_directories(/usr/share/visionworks/sources/3rdparty/nvmedia/)
add_library(${PROJECT_NAME}
src/DWLanesNode.cpp
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${Driveworks_LIBRARIES}
)
# ros node name template
set(NODE_NAME ${PROJECT_NAME}_node)
add_executable(${NODE_NAME} src/${NODE_NAME}.cpp)
target_link_libraries(${NODE_NAME}
${PROJECT_NAME}
)
<?xml version="1.0"?>
<package format="2">
<name>dw_wrapper</name>
<version>1.0.0</version>
<description>
Wrapper for Nvidia Driveworks
</description>
<buildtool_depend>catkin</buildtool_depend>
<depend>roscpp</depend>
<depend>libglew-dev</depend><!--TODO: Figure out what actually needs this library-->
</package>
@harderthan
Copy link

Hello, Thank you for your code.

I am trying your code on my module.
But, I can't build the moduls.

$ catkin_make
...
/usr/local/driveworks/include/dw/image/Image.h:73:27: fatal error: nvmedia_image.h: No such file or directory
...

I don't know what you mean on this line.

# TODO: add a FindNvmedia.cmake file for this? Why does it not exist?
include_directories(/usr/share/visionworks/sources/3rdparty/nvmedia/)

I know that the library and header files of nvmedia are at host pc which was install ros and driveworks.
But I don't have this directory and files.

How can I build it?

@kerimyener
Copy link

Hello
I am Kerim. I am working at Deutsches Forschungszentrum für Künstliche Intelligenz DFKI as a student and my task is to combine lane detection with ros. I am new in Nvidia drivepx2.
I would like to ask you that how did you manage to run lane detection sample in ros? Do we have any source code that comes along DrivePx2? Thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment