Skip to content

Raspberry Pi Code

Arthur Guy edited this page Sep 28, 2018 · 37 revisions

apt-get

ros-kinetic-imu-filter-madgwick
ros-kinetic-robot-localization
ros-kinetic-robot-state-publisher
ros-kinetic-joint-state-publisher
ros-kinetic-rosserial-arduino
ros-kinetic-rosserial
ros-kinetic-robot-upstart
supervisor
libqt4-dev

pip

sudo pip install adafruit-ads1x15
sudo pip install smbus2

Manual libraries

IMU Library

https://github.com/RPi-Distro/RTIMULib/tree/master/Linux

  • Build and install library and run calibration
  • Build and install python library

VL53L0X library

https://github.com/johnbryanmoore/VL53L0X_rasp_python

  • Code in the codebase, navigate to the right directory and make

Setup

Download Ubuntu Mate 16.04

https://ubuntu-mate.org/download/

ROS Setup process

http://wiki.ros.org/kinetic/Installation/Ubuntu

RTC

sudo nano /etc/modules Ensure the following are listed

i2c-bcm2708
i2c-dev

Download and install the PiFace RTC code.

https://github.com/piface/PiFace-Real-Time-Clock

Custom messages

catkin_make needs to be run to build the custom messages

Shutdown button

This library is used but with a modified pin of 26 and a shutdown timeout of 2 seconds https://github.com/scruss/shutdown_button

Motor USB Serial connection

Map the teensy to a consistent name through a udev rule

SUBSYSTEM=="tty", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0483", SYMLINK+="rosSerial"

Startup environment

Ensure ~./bashrc contains

export ROS_IP=192.168.1.60
source /opt/ros/kinetic/setup.bash
#source ~/ros_catkin_ws/devel/setup.bash

Autostart

Supervisor is used to manage the execution of the script by the root user on startup

cp /home/holly/catkin_ws/src/Holly/holly-ros.conf /etc/supervisor/conf.d/holly-ros.conf`

sudo supervisorctl reread
sudo supervisorctl update
sudo service supervisor restart

Clone this wiki locally