# Revision history [back]

### Using Arduino libraries with rosserial_arduino

I'm trying to create a ROS package for a node that will run on an Arduino, and interface some sensors with corresponding Arduino libraries. One of the sensors is a BNO055, and I'm trying to use the Adafruit_BNO055 (and Adafruit_Sensor) library.

What I'm doing now, which seems to work (as in it builds), is to paste the contents of each library right into the firmware folder, so that the package contents look like this:

├── CMakeLists.txt
├── firmware
│   ├── CMakeLists.txt
│   ├── sensor_node.cpp
│   └── utility
│       ├── imumaths.h
│       ├── matrix.h
│       ├── quaternion.h
│       └── vector.h
└── package.xml


The utility folder is part of one of the libraries. This is clearly very messy, as libraries are not separated in any way from the code under development, and they cannot even be organized in subfolders without requiring #include "subfolder/LibraryFile.h in sensor_node.cpp.

How can I put the libraries somewhere else, yet still have them recognized by sensor_node.cpp?

I've tried to do this:

├── CMakeLists.txt
├── firmware
│   ├── CMakeLists.txt
│   └── sensor_node.cpp
├── libraries

Which is a much nicer structure, but I cannot figure out the necessary CMakeLists settings to make it work.