Skip to content

Latest commit

 

History

History
93 lines (83 loc) · 2.51 KB

README.md

File metadata and controls

93 lines (83 loc) · 2.51 KB

Neuron Library ROS 2 Example

This is a neuron library ROS 2 example for ADLINK's products. You can easily rewrite your program based on these examples.

Environment Requirement

  • ROS version:
    • ROS 2 Foxy
  • Ubuntu version:
    • 18.04
    • 20.04
  • Hardware support list:
    • ROSCube-I
    • ROSCube-X

Setup

Option 1: Install Neuron Library

If you use Neuron SDK, then Neuron Library should be built-in. Otherwise, you can download Neuron Library here

You can use the example directly.

Please contact ADLINK if you have any question about Neuorn Library.

  1. Install ROS 2
  2. Create workspace and git clone this package from github
# You can name your workspace.
mkdir -p neuronlib_example_ws/src
cd neuronlib_example_ws/src
git clone https://github.com/Adlink-ROS/neuron_library_example.git
cd ..
  1. Build this ROS 2 package.
# please source ROS 2 develop env before colcon build
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
  1. Source package
# Source the package everytime you open a new terminal
source install/local_setup.bash

Option 2: Build MRAA by yourself

If you don't have Neuron Library, then git clone MRAA Library and build by yourself. The environmental variables need to be set before building (colcon build) this example.

  1. Install ROS 2
  2. Install and Build the mraa package
mkdir -p ~/mraa_ws/src
cd ~/mraa_ws/src
git clone https://github.com/Adlink-ROS/mraa.git -b roscube_series
cd mraa
mkdir build 
cd build
cmake ..
make 
  1. Set environmental variables of MRAA Library.
# Your library path
export NLIB_MRAA_LIBRARY_PATH=~/mraa_ws/src/mraa/build/src
# Your header path
export NLIB_MRAA_INCLUDE_PATH=~/mraa_ws/src/mraa/api
  1. Create workspace and git clone this package from github
# You can name your workspace.
mkdir -p ~/neuronlib_example_ws/src
cd ~/neuronlib_example_ws/src
git clone https://github.com/Adlink-ROS/neuron_library_example.git
cd ..
  1. Build this ROS 2 package.
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
  1. Source package
# Source the package everytime you open a new terminal
source install/local_setup.bash

Examples

To view the usage of examples more detailed, pleace click the links below.