Skip to content

pylipp/ros_temp_laser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

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

Releases

No releases published

Packages

No packages published

Languages