getting_started:ros
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
getting_started:ros [2019/10/05 16:06] – [Preparations and Building] graf | getting_started:ros [2021/03/29 15:27] – ursgraf | ||
---|---|---|---|
Line 32: | Line 32: | ||
- | === Building an EEROS application with ROS functionality | + | ===== Example for Making your EEROS Application a ROS Node ===== |
The CMAKE file for the EEROS application using ROS has to be expanded as follows: | The CMAKE file for the EEROS application using ROS has to be expanded as follows: | ||
< | < | ||
- | cmake_minimum_required(VERSION | + | cmake_minimum_required(VERSION |
project(testProject) | project(testProject) | ||
+ | set(CMAKE_CXX_STANDARD 14) | ||
+ | |||
## ROS | ## ROS | ||
message(STATUS " | message(STATUS " | ||
Line 59: | Line 61: | ||
include_directories(${EEROS_INCLUDE_DIR}; | include_directories(${EEROS_INCLUDE_DIR}; | ||
link_directories(${EEROS_LIB_DIR}; | link_directories(${EEROS_LIB_DIR}; | ||
- | |||
- | set(CMAKE_CXX_FLAGS " | ||
add_executable(testProject main.cpp) | add_executable(testProject main.cpp) | ||
Line 66: | Line 66: | ||
</ | </ | ||
- | ===== Make your EEROS Application a ROS Node ===== | + | Your test program might look like |
- | Initialize the ROS node in your main function and give it a name. | + | |
<code cpp> | <code cpp> | ||
- | | + | #include < |
| | ||
- | | + | int main(int argc, char **argv) { |
- | ... | + | ... |
- | rosTools:: | + | rosTools:: |
+ | ros:: | ||
log.trace() << "ROS node initialized."; | log.trace() << "ROS node initialized."; | ||
... | ... |
getting_started/ros.txt · Last modified: 2023/02/09 12:04 by ursgraf