getting_started:write_app:use_on_cb20
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_cb20 [2021/03/24 16:02] – ursgraf | getting_started:write_app:use_on_cb20 [2023/04/12 16:05] (current) – [Use Existing Project] ursgraf | ||
---|---|---|---|
Line 2: | Line 2: | ||
Back to [[getting_started: | Back to [[getting_started: | ||
- | Edit the file '' | + | 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:// |
- | < | + | |
- | use_simulator=false | + | |
- | use_flink=true | + | |
- | use_bbblue=false | + | |
- | use_comedi=false | + | |
- | use_ros=false | + | |
- | use_can=false | + | |
- | use_custom_application=true | + | |
- | use_cross_compilation_environment=true | + | |
- | use_ros_setup_script=false | + | |
- | </code> | + | |
- | The entry '' | + | What do you want to do next? |
- | * downloading the SDK from [[https:// | + | |
- | * installing the SDK as described in [[https:// | + | |
- | Edit the file '' | + | * [[getting_started: |
- | < | + | * [[getting_started: |
- | environment_setup_script=/ | + | |
+ | ===== Say Hello with EEROS ===== | ||
+ | |||
+ | - Create a project directory and change into it with < | ||
+ | $ mkdir hello | ||
+ | $ cd hello | ||
</ | </ | ||
- | This will guide your make script to use the SDK. Make sure that the above path matches your installation path. | + | - Create a text file "main.cpp" and copy the following code into it <code cpp> |
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | int main() { | ||
+ | using namespace eeros:: | ||
+ | |||
+ | Logger:: | ||
+ | Logger log = Logger:: | ||
+ | |||
+ | log.info() << " | ||
- | If you want to use CAN, choose | + | return 0; |
- | < | + | } |
- | use_can=true | + | |
</ | </ | ||
+ | - Create a text file " | ||
+ | cmake_minimum_required(VERSION 3.10) | ||
+ | project(helloworld) | ||
- | Setting the entry '' | + | set(CMAKE_CXX_STANDARD 14) |
- | 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 and change into it with < | ||
+ | $ mkdir build-armhf | ||
+ | $ cd build-armhf | ||
</ | </ | ||
+ | - Source the script for the SDK which has been installed in [[getting_started: | ||
+ | $ . ~/ | ||
+ | </ | ||
+ | - Build the project with < | ||
+ | $ cmake .. | ||
+ | $ make | ||
+ | </ | ||
+ | - Make changes to " | ||
+ | $ make | ||
+ | </ | ||
- | After this you can continue | + | Continue |
+ | ===== Use Existing Project ===== | ||
+ | As an example we use the [[getting_started: | ||
+ | - Clone the code for the project and change into the directory < | ||
+ | $ git clone https:// | ||
+ | $ cd simple-motor-control | ||
+ | </ | ||
+ | - Create a build directory and change into it with < | ||
+ | $ mkdir build-armhf | ||
+ | $ cd build-armhf | ||
+ | </ | ||
+ | - Source the script for the SDK which has been installed in [[getting_started: | ||
+ | $ . ~/ | ||
+ | </ | ||
+ | $ cmake -DUSE_FLINK=TRUE .. | ||
+ | $ make | ||
+ | </ | ||
+ | |||
+ | Continue with [[getting_started: | ||
- | ==== Test Application ==== | ||
- | There is a test application for the cb20 board in [[https:// | ||
- | < | ||
- | use_custom_application=true | ||
- | custom_application_name=cb20test | ||
- | </ | ||
- | and further down | ||
- | < | ||
- | custom_application_git_remote_address=https:// | ||
- | custom_application_git_version=master | ||
- | custom_application_source_dir=" | ||
- | custom_application_build_dir=" | ||
- | </ | ||
- | Now you can run the '' | ||
- | < | ||
- | $ ./clone.sh | ||
- | </ | ||
- | After this you can continue with [[getting_started: | ||
getting_started/write_app/use_on_cb20.1616598129.txt.gz · Last modified: 2021/03/24 16:02 by ursgraf