Skip to content

disaster-robotics-proalertas/atlas_ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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