getting_started:write_app:use_on_cb20
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
getting_started:write_app:use_on_cb20 [2021/03/24 11:51] – created ursgraf | getting_started:write_app:use_on_cb20 [2023/04/12 15:47] – [Say Hello with EEROS] ursgraf | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Writing EEROS Applications for cb20 Board ====== | ====== Writing EEROS Applications for cb20 Board ====== | ||
- | 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) |
- | < | + | |
+ | add_executable(helloworld main.cpp) | ||
+ | target_link_libraries(helloworld PRIVATE eeros) | ||
+ | </code> | ||
+ | - Create | ||
+ | $ mkdir build-armhf | ||
+ | $ cd build-armhf | ||
+ | </ | ||
+ | - Source the script for the SDK which has been installed in [[getting_started:install: | ||
+ | $ . ~/ost-devel/1.0/environment-setup-cortexa8hf-neon-poky-linux-gnueabi | ||
+ | </ | ||
+ | - Build the project with < | ||
+ | $ cmake .. | ||
+ | $ make | ||
+ | </ | ||
+ | - Make changes | ||
+ | $ make | ||
+ | </code> In order to be able to write your own EEROS programs, you could use any text editor. However, we recommend to use an integrated development environment, | ||
+ | |||
+ | Continue with [[getting_started: | ||
+ | |||
+ | ===== Use Existing Project ===== | ||
+ | As an example we use the [[getting_started: | ||
+ | - Edit the file '' | ||
+ | custom_application=simple-motor-control | ||
+ | </ | ||
+ | - Fetch the code of the application with < | ||
$ ./clone.sh | $ ./clone.sh | ||
</ | </ | ||
+ | - Build the project with < | ||
+ | $ ./make.sh | ||
+ | </ | ||
+ | |||
+ | Continue with [[getting_started: | ||
+ | |||
+ | |||
- | After this you can continue with [[getting_started: | ||
Line 43: | Line 80: | ||
There is a test application for the cb20 board in [[https:// | There is a test application for the cb20 board in [[https:// | ||
< | < | ||
- | use_custom_application=true | ||
custom_application_name=cb20test | custom_application_name=cb20test | ||
</ | </ | ||
Line 55: | Line 91: | ||
</ | </ | ||
- | Now you can run the '' | + | After this you continue |
- | < | + | |
- | $ ./ | + | |
- | </ | + | |
- | + | ||
- | After this you can continue | + | |
getting_started/write_app/use_on_cb20.txt · Last modified: 2024/06/13 13:54 by ursgraf