All Projects β†’ mcgill-robotics β†’ Ros Teensy

mcgill-robotics / Ros Teensy

🚧 Extension to build code for the teensy boards from catkin

Projects that are alternatives of or similar to Ros Teensy

Vector ros
ROS package for Anki Vector home robot
Stars: ✭ 55 (+243.75%)
Mutual labels:  ros, cmake
Pepper plymouth ros
A set of launch files and configuration files for Plymouth University's Pepper robot
Stars: ✭ 22 (+37.5%)
Mutual labels:  ros, cmake
Ros Academy For Beginners
中国倧学MOOCγ€ŠζœΊε™¨δΊΊζ“δ½œη³»η»Ÿε…₯门》代码瀺例 ROS tutorial
Stars: ✭ 861 (+5281.25%)
Mutual labels:  ros, cmake
Didi challenge ros
Roslaunch to visualize a rosbag file from Udacity (DiDi Challenge)
Stars: ✭ 69 (+331.25%)
Mutual labels:  ros, cmake
Aws Robomaker Small Warehouse World
This Gazebo world is well suited for organizations who are building and testing robot applications for warehouse and logistics use cases.
Stars: ✭ 85 (+431.25%)
Mutual labels:  ros, cmake
Cherry Autonomous Racecar
Implementation of the CNN from End to End Learning for Self-Driving Cars on a Nvidia Jetson TX1 using Tensorflow and ROS
Stars: ✭ 294 (+1737.5%)
Mutual labels:  ros, teensy
Ros Travis Integration
ROS package continuous integration using travis-CI
Stars: ✭ 125 (+681.25%)
Mutual labels:  ros, cmake
Ifopt
An Eigen-based, light-weight C++ Interface to Nonlinear Programming Solvers (Ipopt, Snopt)
Stars: ✭ 372 (+2225%)
Mutual labels:  ros, cmake
Lidar camera calibration
ROS package to find a rigid-body transformation between a LiDAR and a camera for "LiDAR-Camera Calibration using 3D-3D Point correspondences"
Stars: ✭ 734 (+4487.5%)
Mutual labels:  ros
Ros best practices
Best practices, conventions, and tricks for ROS. Do you want to become a robotics master? Then consider graduating or working at the Robotics Systems Lab at ETH in ZΓΌrich!
Stars: ✭ 799 (+4893.75%)
Mutual labels:  ros
Gerbera
UPnP Media Server for 2021: Stream your digital media through your home network and consume it on all kinds of UPnP supporting devices πŸ“±πŸ’»πŸ“Ί
Stars: ✭ 710 (+4337.5%)
Mutual labels:  cmake
Cmake Modules
My collection of CMake modules
Stars: ✭ 740 (+4525%)
Mutual labels:  cmake
Pri
Collect pri files of qmake
Stars: ✭ 5 (-68.75%)
Mutual labels:  cmake
Raftlib
The RaftLib C++ library, streaming/dataflow concurrency via C++ iostream-like operators
Stars: ✭ 717 (+4381.25%)
Mutual labels:  cmake
Gd23zu
Library for STM32F1x, F4x, F7x and Teensy 3.5/6 based on library Gameduino 3. Playback videos support, for FTDI screens FT81x.
Stars: ✭ 7 (-56.25%)
Mutual labels:  teensy
Vscode Cmake Tools
CMake integration in Visual Studio Code
Stars: ✭ 702 (+4287.5%)
Mutual labels:  cmake
Cpm
C++ Package Manager
Stars: ✭ 697 (+4256.25%)
Mutual labels:  cmake
Fourth robot pkg
4号機(KIT-C4)用γƒͺγƒγ‚Έγƒˆγƒͺ
Stars: ✭ 7 (-56.25%)
Mutual labels:  ros
Ogreoculussample
A (small) sample of how to render to the Oculus Rift in OGRE 3D. This does not use the direct mode, instead, the rift must be set to extended mode.
Stars: ✭ 6 (-62.5%)
Mutual labels:  cmake
Assimp
The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.
Stars: ✭ 7,309 (+45581.25%)
Mutual labels:  cmake

ros_teensy

master

This ROS package ports the rosserial-arduino communication package for the Teensy MCUs. It uses the same ros-lib generated by the rosserial-arduino package for the higher level and compiles the Teensy core Arduino library implementation to provide the interface to serial.write() and serial.print().

Requirements

There are several requirements for this package, first is the arm compiler toolchain from the GNU tools:

sudo apt-get install gcc-arm-none-eabi

Then you will obviously need the Arduino and Teensyduino libraries. You can find the Arduino library on arduino.cc/en/Main/Software where you will find your latest version. Unfortunately Arduino does not provide a static URL with the latest version of the library, so this URL might change with time. At the time this was written, the latest version was 1.6.7 so:

curl -O https://downloads.arduino.cc/arduino-1.6.7-linux64.tar.xz
tar -xvf arduino-1.6.7-linux64.tar.xz

For Teensyduino, the URL is also not static and will change. At this time you can get it with

curl -O https://www.pjrc.com/teensy/td_127/teensyduino.64bit
chmod +x teensyduino.64bit
./teensyduino.64bit

Finally, you will need to set an environment variable to point to the where you installed the libraries. So add a line like the following to your .bashrc file or any other file you source in every terminal

export arduino_location=<the_location>

Usage

To properly use the ros_teensy package, your package containing your MCU code to be compiled should follow this structure:

package
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ package.xml
β”œβ”€β”€ arch1
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   └── main.cpp
└── arch2
    β”œβ”€β”€ CMakeLists.txt
    └── main.cpp

Note that the toolchain file used to compile the sources will be determined at a folder level, hence the reason for the arch1 and arch2 folders. These two folders could (or not) be compiled using the same cross-compiling toolchain.

To compile using the ros_teensy toolchain you must include the following commands in your different CMakeLists.txt.

At the package level:

cmake_minimum_required(VERSION 2.8)
project(<package_name>)

find_package(catkin REQUIRED COMPONENTS
    ros_teensy
    rosserial_client
    rosserial_arduino
)

rosserial_generate_ros_lib(
    PACKAGE rosserial_arduino
    SCRIPT make_libraries.py
)

rosserial_configure_client(
    DIRECTORY architecture1
    TOOLCHAIN_FILE ${ROS_TEENSY_TOOLCHAIN}
)

rosserial_configure_client(
    DIRECTORY architecture2
    TOOLCHAIN_FILE ${ROS_TEENSY_TOOLCHAIN}
)

rosserial_add_client_target(architecture1 target1_Firmware ALL)
rosserial_add_client_target(architecture2 target2_Firmware ALL)

Then inside each architecture folder, the CMakeLists.txt should contain the following:

include_directories(${ROS_LIB_DIR})

FILE(GLOB_RECURSE ros_src
    "${ROS_LIB_DIR}/*.cpp"
    "${ROS_LIB_DIR}/*.h")
add_library(ros_lib ${ros_src})

add_teensy_executable(target1 main.cpp)
target_link_libraries(target1 ros_lib)

You will need to explicitly build and link to the ros_lib target for each different architecture. Additionally, each target needs to be linked to those libraries as well.

Note that it is the same principle for any other external libraries.

Additionnally, if your MCU code uses some of the Arduino/Teensy external libraries such as Servo, SPI, PID, etc. You will need to add them to the compilation process by adding this line before you create the executable.

include_directories(${ROS_LIB_DIR})

import_arduino_library(Servo)
...
add_teensy_executable(...)

We use the import_arduino_library() command regardless of if the library is an Arduino or a Teensyduino library.

After the build completes, three files should be created for each Teensy target you added: target.elf, target.elf.eep and target.elf.hex. They should be located in the build folder of the catkin workspace: catkin_ws/src/<package_name>/architecture/bin. Out of those files, the *.hex file is the one that will get flashed to the micro-controller using your favorite utility.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].