getting_started:write_app:use_on_host
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
getting_started:write_app:use_on_host [2021/03/24 19:01] – ursgraf | getting_started:write_app:use_on_host [2023/04/13 09:03] (current) – [Use Existing Project] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Writing EEROS Applications for the Host ====== | ====== Writing EEROS Applications for the Host ====== | ||
Back to [[getting_started: | Back to [[getting_started: | ||
+ | |||
+ | You will use C++ to develop your EEROS applications. For this you need at least some knowledge of the basic language features. A good starting point might be [[https:// | ||
What do you want to do next? | What do you want to do next? | ||
Line 7: | Line 9: | ||
* [[getting_started: | * [[getting_started: | ||
+ | ===== Say Hello with EEROS ===== | ||
- | This will build EEROS without the ROS examples. If you have ROS installed | + | - Create a project directory within your EEROS project directory and change into it with < |
- | <code> | + | $ mkdir hello |
- | use_simulator=true | + | $ cd hello |
- | use_comedi=false | + | </ |
- | use_ros=true | + | - Create a text file "main.cpp" |
- | use_ros_setup_script=true | + | #include < |
+ | #include < | ||
+ | # | ||
+ | |||
+ | int main() { | ||
+ | using namespace eeros:: | ||
+ | |||
+ | Logger:: | ||
+ | Logger log = Logger:: | ||
+ | |||
+ | log.info() << " | ||
- | ros_setup_script=/ | + | return 0; |
+ | } | ||
</ | </ | ||
- | The last line must point to your ROS installation path. In general this will be ''/ | + | - Create a text file " |
+ | cmake_minimum_required(VERSION 3.10) | ||
+ | project(helloworld) | ||
- | Now you can run the '' | + | find_package(EEROS REQUIRED) |
- | < | + | |
- | $ ./clone.sh | + | add_executable(helloworld main.cpp) |
+ | target_link_libraries(helloworld PRIVATE eeros) | ||
+ | </ | ||
+ | - Create a build directory for your new project and change into it with < | ||
+ | $ mkdir build-x86 | ||
+ | $ cd build-x86 | ||
</ | </ | ||
- | After this you can continue | + | - Build the project with < |
+ | $ cmake -DCMAKE_INSTALL_PREFIX=../ | ||
+ | $ make | ||
+ | </ | ||
+ | - Make changes to " | ||
+ | $ make | ||
+ | </ | ||
+ | |||
+ | |||
+ | Continue | ||
+ | |||
+ | ===== Use Existing Project ===== | ||
+ | As an example we use the [[getting_started: | ||
+ | |||
+ | - Fetch the code of the application from within your EEROS project directory with < | ||
+ | $ git clone https:// | ||
+ | $ cd simple-motor-control | ||
+ | </ | ||
+ | - Create a build directory for your new project and change into it with < | ||
+ | $ mkdir build-x86 | ||
+ | $ cd build-x86 | ||
+ | </ | ||
+ | - Build the project with < | ||
+ | $ cmake -DCMAKE_INSTALL_PREFIX=../ | ||
+ | $ make | ||
+ | </ | ||
+ | |||
+ | Continue with [[getting_started: | ||
getting_started/write_app/use_on_host.txt · Last modified: 2023/04/13 09:03 by ursgraf