Skip to content

Commit

Permalink
Merge pull request ros-industrial-attic#11 from schornakj/feature/add…
Browse files Browse the repository at this point in the history
…-ros1-demo-node

Add a standalone ROS1 demo application
  • Loading branch information
schornakj authored Nov 20, 2019
2 parents f9411ab + c29c63f commit 3e7cf8a
Show file tree
Hide file tree
Showing 6 changed files with 278,068 additions and 3 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# yak_ros

Example ROS frontend node for [the Yak TSDF package](https://github.com/ros-industrial/yak).

## Demo

This package contains a simulated image generator node and a launch file to provide a self-contained demonstration of TSDF reconstruction from streaming depth images. Currently the demo is only supported for ROS1.

The demo depends on [the gl_depth_sim package](https://github.com/Jmeyer1292/gl_depth_sim) to provide simulated depth images.

The demo node depends on external packages that aren't required by the core `yak_ros` node, so compilationo of the demo node is skipped by default. To build the demo, pass the `BUILD_DEMO` flag to catkin as `True`:

```
catkin build --cmake-args -DBUILD_DEMO=True
```

After re-sourcing the workspace, start the demo from the provided launch file:

```
roslaunch yak_ros demo.launch
```
42 changes: 39 additions & 3 deletions yak_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ find_package(yak REQUIRED)
find_package(std_srvs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(tf2 REQUIRED)
#find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_eigen REQUIRED)
find_package(cv_bridge REQUIRED)
Expand All @@ -28,6 +28,7 @@ if ($ENV{ROS_VERSION} VERSION_EQUAL "1")
find_package(catkin REQUIRED COMPONENTS
roscpp
tf2
tf2_ros
tf2_eigen
cv_bridge
yak_ros_msgs)
Expand Down Expand Up @@ -73,6 +74,30 @@ if ($ENV{ROS_VERSION} VERSION_EQUAL "1")
${catkin_INCLUDE_DIRS}
${gl_depth_sim_INCLUDE_DIRS})



if(DEFINED BUILD_DEMO)
find_package(gl_depth_sim REQUIRED)
find_package(image_transport REQUIRED)
add_executable(${PROJECT_NAME}_image_simulator
src/demo/sim_depth_image_pub_ros1.cpp)
target_link_libraries(${PROJECT_NAME}_image_simulator
${CATKIN_LIBRARIES}
${OpenCV_LIBS}
${sensor_msgs_LIBRARIES}
${cv_bridge_LIBRARIES}
${gl_depth_sim_LIBRARIES}
${image_transport_LIBRARIES}
Eigen3::Eigen)
target_include_directories(${PROJECT_NAME}_image_simulator PUBLIC
${catkin_INCLUDE_DIRS}
${gl_depth_sim_INCLUDE_DIRS}
${image_transport_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS}
)
endif()


else()
# Build as an Ament package for ROS2
find_package(ament_cmake REQUIRED)
Expand Down Expand Up @@ -116,10 +141,21 @@ endif()

if ($ENV{ROS_VERSION} VERSION_EQUAL "1")
set(ROS_LIB_DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
set(ROS_SHARE_DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
else()
set(ROS_LIB_DESTINATION lib/${PROJECT_NAME})
set(ROS_SHARE_DESTINATION share/${PROJECT_NAME})
endif()

install(TARGETS ${PROJECT_NAME}_node
RUNTIME DESTINATION ${ROS_LIB_DESTINATION}
)
RUNTIME DESTINATION ${ROS_LIB_DESTINATION})

install(DIRECTORY launch config demo
DESTINATION ${ROS_SHARE_DESTINATION})

if (DEFINED BUILD_DEMO)
install(TARGETS ${PROJECT_NAME}_image_simulator
RUNTIME DESTINATION ${ROS_LIB_DESTINATION})
endif()


Loading

0 comments on commit 3e7cf8a

Please sign in to comment.