Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pylipp/ros_temp_laser

Small hobby Arduino/ROS project
https://github.com/pylipp/ros_temp_laser

arduino command-line linux platformio ros vim

Last synced: about 20 hours ago
JSON representation

Small hobby Arduino/ROS project

Awesome Lists containing this project

README

        

Small hobby Arduino/ROS project. Mainly for keeping references of how to setup the development environment (terminal-based: vim, platformio command line tool, ROS)

## Hardware

- Arduino Nano Atmega 328
- laser module
- digital temperature module

## General references

- [platformio docs](http://docs.platformio.org/en/latest/installation.html)

## Installing platformio and project

Obviously, get latest source from git (was more up-to-date than PyPI)

mkvirtualenv --python=$(which python2) platformio
pip install -e "git+https://github.com/platformio/platformio-core#egg=platformio-core"

Prepare serial port reading

sudo usermod -a -G dialout $(echo $USER)

Install udev rules file

wget -qO- https://raw.githubusercontent.com/platformio/platformio-core/develop/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules > /dev/null

Create empty project dir or clone

platformio init -b nanoatmega328 --ide vim

## Vim-related setup procedure

Download `.ycm_extra_conf.py`, see [the docs](http://docs.platformio.org/en/latest/ide/vim.html)

## Workflow

Hack Arduino code and compile

platformio run

Search libraries (example: ROS)

platformio lib search ros

Install desired package

platformio lib install 345

Upload to board

platformio run -t upload #or: make upload

## Installing ROS environment

sudo apt-get install ros-kinetic-desktop-full ros-kinetic-rosserial ros-kinetic-rosserial-arduino

Don't forget to

source /opt/ros/kinetic/setup.zsh

## Run stuff

Plug board to USB port and run serial connection node (OUTSIDE virtualenv)

roslaunch serial.launch --screen

Toggle laser by

rostopic pub /switch_laser std_msgs/Empty "{}" --once

Read temperature by

rostopic echo /temperature