User Manual

- 29 -
Now CMakeLists.txt configuration is completedsave and quit
2
Create ROS Depth camera client node and server
1 In the src directory of the package directory, create ros_camera_client.cpp and
ros_camera_server.cpp, and enter sudo touch src/ros_camera_client.cpp
src/ros_camera_server.cpp in the terminal of the package directory, as shown below:
(2) Enter sudo gedit CMakeLists.txt in the terminal of the package directory, configure the
CMakeLists.txt file, and add the following code to the CMakeLists.txt file, as shown below:
add_executable(ros_camera_client src/ros_camera_client.cpp)
target_link_libraries(ros_camera_client ${catkinhps_camera_LIBRARIES} hps3d32175)
add_dependencies(ros_camera_client hps_camera_generate_messages_cpp)
add_executable(ros_camera_server src/ros_camera_server.cpp)
target_link_libraries(ros_camera_server ${catkin_LIBRARIES})
add_dependencies(ros_camera_server hps_camera_generate_messages_cpp)
3 Write ROS Depth camera client node and server
1Write server program
Add head file, code as below:
#include
"ros/ros.h"//ros