Code Monkey home page Code Monkey logo

atlas_ros's Introduction

atlas_ros

ROS node for Atlas Scientific's water quality sensor kit. Tested and working in ROS Kinetic.

Installation

After installing ROS and building the Catkin workspace, simply clone this repository and install via Catkin:

    $ cd ~/catkin_ws/src
    $ git clone https://github.com/disaster-robotics-proalertas/atlas_ros
    $ cd ~/catkin_ws/src
    $ catkin_make clean
    $ catkin_make install

If using a Raspberry Pi with Raspbian and ROS installed (following this guide, see Usage section below), installing the package is recommended with the "catkin_make_isolated" command. Log into the Raspberry with SSH and enter the following:

    $ cd ~/ros_catkin_ws
    $ sudo ./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/kinetic --pkg atlas_ros

The sudo authentication is necessary to write the install files to "/opt/ros/kinetic" so ROS can see them, as the "catkin_make_isolated" command does not produce a setup script to set ROS' environmental variables. Alternatively, you can point the environmental variables (mainly ROS_PACKAGE_PATH) directly to the install folder of your choosing.

Usage

Currently, the sensor modules are mounted on a prototype board which communicates to a Raspberry Pi Zero (RPi) with Raspbian Stretch and ROS Kinetic Desktop Full. Although the package should work with any computer with a I2C interface, setting up the sensors along with the RPi is strongly recommended. The wiring for this particular case can be seen below (the Raspberry Pi 2 and Zero share the same GPIO pinout).

The ROS package contains two nodes, i2c_sensors.py and serial_sensors.py, which communicate with the Atlas circuits using I2C and Serial UART. The nodes read the sensors one at a time, publishing their data in custom message ROS topics. To run the nodes, first run a ROS core, and then use the rosrun command:

    $ roscore
    $ rosrun atlas_ros i2c_sensors.py
    OR
    $ rosrun atlas_ros serial_sensors.py

The package contains launch files as well, where several parameters of the node can be set, namely:

  • Publishing rate (Hz)
  • Sensor topic names
  • Sensor ports (i.e., the Serial Expander port to which the sensors are connected)

To use the launch files: In your RPi, copy the files from the "launch" folder to ROS' package install directory:

    $ sudo cp ~/ros_catkin_ws/src/atlas_ros/launch/*_sensors.launch /opt/ros/kinetic/share/atlas_ros/launch

To run, use the roslaunch command (a core will be automatically run if none is active):

    $ roslaunch atlas_ros i2c_sensors.launch
    OR
    $ roslaunch atlas_ros serial_sensors.launch

This file also automatically starts a ROSBAG recording of all topics. To disable this, comment the rosbag node line from the launch file in "/opt/ros/kinetic/share/atlas_ros/launch/sensors.launch".

ROS Network setup

If using the RPi setup described above, it is highly recommended to set the RPi to be a master in the ROS network. This allows for other computers to seamlessly access the RPi's topics, parameters and node information. To do this, follow this tutorial, changing the ROS_MASTER_URI and ROS_HOSTNAME appropriately on the RPi and other computers in the ROS network.

Contributors

atlas_ros's People

Contributors

amamory avatar igorsouzaa avatar rgmaidana avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

robotcodelab

atlas_ros's Issues

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.