Skip to content

Commit

Permalink
compilation fix for CPU-only machines
Browse files Browse the repository at this point in the history
  • Loading branch information
amock committed Oct 9, 2023
1 parent 979cbb0 commit f6e08dc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 21 deletions.
28 changes: 21 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@ include_directories(
${catkin_INCLUDE_DIRS}
)

find_package(rmagine REQUIRED)
find_package(rmagine 2.2.1...
COMPONENTS
core
OPTIONAL_COMPONENTS
embree
cuda
optix
)

include_directories(${rmagine_INCLUDE_DIRS})

set(RADARAYS_ROS_LIBRARIES radarays)
set(RADARAYS_ROS_DEFINITIONS)

if(${rmagine_cuda_FOUND} AND ${rmagine_optix_FOUND})
if(TARGET rmagine::optix)
list(APPEND RADARAYS_ROS_LIBRARIES radarays_gpu)
set(RADARAYS_WITH_GPU True)
list(APPEND RADARAYS_ROS_DEFINITIONS -DRADARAYS_WITH_GPU)
Expand Down Expand Up @@ -75,7 +83,7 @@ catkin_package(
tf2_ros
actionlib_msgs
DEPENDS
rmagine
rmagine::core
LIBRARIES
${RADARAYS_ROS_LIBRARIES}
)
Expand Down Expand Up @@ -103,9 +111,9 @@ add_dependencies(radarays
)

target_link_libraries(radarays
${rmagine_LIBRARIES}
rmagine::core
rmagine::embree
${catkin_LIBRARIES}
${rmagine_LIBRARIES}
${OpenCV_LIBS}
)

Expand All @@ -129,6 +137,7 @@ if(RADARAYS_WITH_GPU)
target_link_libraries(radarays_gpu
${CUDA_LIBRARIES}
radarays
rmagine::optix
)
install(TARGETS radarays_gpu
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
Expand All @@ -150,11 +159,15 @@ add_dependencies(radar_simulator
## Specify libraries to link a library or executable target against
target_link_libraries(radar_simulator
${catkin_LIBRARIES}
${rmagine_LIBRARIES}
rmagine::core
rmagine::embree
${OpenCV_LIBS}
radarays
)

target_compile_definitions(radar_simulator
PUBLIC ${RADARAYS_ROS_DEFINITIONS}
)

if(RADARAYS_WITH_GPU)
target_compile_definitions(radar_simulator PUBLIC RADARAYS_WITH_GPU)
Expand All @@ -174,7 +187,8 @@ add_dependencies(ray_reflection_test
## Specify libraries to link a library or executable target against
target_link_libraries(ray_reflection_test
${catkin_LIBRARIES}
${rmagine_LIBRARIES}
rmagine::core
rmagine::embree
${OpenCV_LIBS}
radarays
)
30 changes: 16 additions & 14 deletions src/radar_simulator.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <rmagine/simulation/OnDnSimulatorEmbree.hpp>
#include <rmagine/simulation/OnDnSimulatorOptix.hpp>







#include <rmagine/util/prints.h>
#include <rmagine/util/StopWatch.hpp>
#include <random>
Expand All @@ -15,33 +20,30 @@
#include <sensor_msgs/PointCloud.h>

#include <radarays_ros/radar_types.h>

#include <radarays_ros/radar_math.h>
#include <radarays_ros/image_algorithms.h>
#include <radarays_ros/radar_algorithms.h>
#include <radarays_ros/image_algorithms.cuh>
#include <radarays_ros/radar_algorithms.cuh>


#include <radarays_ros/RadarParams.h>

#include <actionlib/server/simple_action_server.h>
#include <radarays_ros/GenRadarImageAction.h>


#include <radarays_ros/GetRadarParams.h>



#include <opencv2/highgui.hpp>

#include <omp.h>

#include <radarays_ros/ros_helper.h>

#include <rmagine/simulation/OnDnSimulatorEmbree.hpp>
#include <radarays_ros/image_algorithms.h>
#include <radarays_ros/radar_algorithms.h>
#include <radarays_ros/RadarCPU.hpp>
#include <radarays_ros/RadarGPU.hpp>

#if defined RADARAYS_WITH_GPU
#include <rmagine/simulation/OnDnSimulatorOptix.hpp>
#include <radarays_ros/image_algorithms.cuh>
#include <radarays_ros/radar_algorithms.cuh>
#include <radarays_ros/RadarGPU.hpp>
#endif // defined RADARAYS_WITH_GPU


using namespace radarays_ros;
Expand Down

0 comments on commit f6e08dc

Please sign in to comment.