Code Monkey home page Code Monkey logo

dynamic-home-computational-probe's Introduction

Dynamic Home Computational Probe

Foundation Apprenticeship Year Two Project

TO-DO list

  • Relay Triggering
  • GPIO Control
  • IIC Connection
  • IIC Code
  • Glue Down Circuit

Getting Started

Dependencies

All dependencies are in requirements.txt

rpi-gpio==0.6.5 X
Bluetin-Echo==0.2.0 X
python3-smbus X

Installation

The Raspberry Pi is going to need some initial configuration to run the code. Also, to support the SMBus2 Python library, we need to install some dependencies.

Firstly, we configure the Rasberry Pi to enable the I2C interface. So, open a Terminal session on the Raspberry Pi to execute the following command:

sudo raspi-config

The Raspberry Pi Configuration Tool will now open to allow you to select interface options. Then on the next screen, choose I2C to enable the interface.

pi-software-configuration-tool

Secondly, we now install the dependencies required by the SMBus2 library. execute the following in the Pi Terminal:

sudo apt-get install i2c-tools

Lastly, we install SMBus2, which is a drop-in replacement for smbus-cffi/smbus-python in pure Python. Enter the following command in the Terminal:

# Either for Python 2.7
pip install smbus2
# Or, for Python 3
pip3 install smbus2

The Circuit

To run the example code, you will need to connect the I2C interface between the Raspberry Pi and Arduino. The Raspberry Pi will have the USB power, while the Arduino has power from the computer USB serial connection. The Arduino is a 3.3v Pro Mini compatible running at 8MHz. And due to the separate power supplies, we need to connect the grounds between the Arduino and Raspberry Pi.

However, this circuit will not be compatible with 5v Arduino board versions. While it is possible to disable the Arduino pull-up resistors, a 5v spike on the I2C is still possible during the pull-up transition.

So, to check the correct installation of the software packages, run the following command at the Terminal Prompt. However, you will need the code uploaded and running on the Arduino. This example code will set the slave address of the Arduino board, and hopefully, this test will detect that address.

sudo i2cdetect -y 1

i2cdetect-serial-bus-check

ROS Setup

Configure your Ubuntu repositories

Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.

Setup your sources.list

Setup your computer to accept software from packages.ros.org.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Set up your keys

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

If you experience issues connecting to the keyserver, you can try substituting hkp://pgp.mit.edu:80 or hkp://keyserver.ubuntu.com:80 in the previous command.

Alternatively, you can use curl instead of the apt-key command, which can be helpful if you are behind a proxy server:

curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

Installation

First, make sure your Debian package index is up-to-date:

sudo apt update

There are many different libraries and tools in ROS. We provided four default configurations to get you started. You can also install ROS packages individually.

In case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed

Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

sudo apt install ros-melodic-desktop-full

Desktop Install: ROS, rqt, rviz, and robot-generic libraries

sudo apt install ros-melodic-desktop

ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

sudo apt install ros-melodic-ros-base

Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):

sudo apt install ros-melodic-PACKAGE

e.g.

sudo apt install ros-melodic-slam-gmapping

To find available packages, use:

apt search ros-melodic

Initialize rosdep

Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

sudo rosdep init
rosdep update

Environment setup

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

If you just want to change the environment of your current shell, instead of the above you can type:

source /opt/ros/melodic/setup.bash

If you use zsh instead of bash you need to run the following commands to set up your shell:

echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc
source ~/.zshrc

Dependencies for building packages

Up to now you have installed what you need to run the core ROS packages. To create and manage your own ROS workspaces, there are various tools and requirements that are distributed separately. For example, rosinstall is a frequently used command-line tool that enables you to easily download many source trees for ROS packages with one command.

To install this tool and other dependencies for building ROS packages, run:

sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

Built With

  • Direwolf - The Packet radio system implemented

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Logan Tarvit - Packet radio system implementation, Sensor platform creation and data transportation across the device, General hardware construction, Webserver Implementation. - Axiom

  • Rory Cormack - AI construction and maintenence, SQL Database construction, High and low level movement processing - Liather

License

This project is licensed under the GPL 3.0 License - see the LICENSE.md file for details

Acknowledgments

dynamic-home-computational-probe's People

Contributors

axiomyt avatar

Watchers

 avatar

Forkers

spencerx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.