Giter Site home page Giter Site logo

tangobot's Introduction

tangobot

An Android application integrating a mobile base (Kobuki) with a Tango enabled device (Lenvo Phab 2 Pro) and ROS. The aim of this application is to show how to enable a robot to navigate running all the required code on Android.

This work is developed by Ekumen in collaboration with Intermodalics and Google Tango. Do not hesitate to give us feedback if something is broken or if you think it lacks some features. The best way to do this is by adding issues to this repository.

Kickstart

We encourage you to read the robot's wiki entry for more information about the required hardware components and step-by-step tutorials.

Running the app demo

Follow these steps to get your robot up and navigating in an empty map, using a computer for visualization and for sending goals. We assume you have all the required hardware components.

Pre requisites

You will need to have Ubuntu 14.04 & ROS Indigo or Ubuntu 16.04 & ROS Kinetic. You can check Installing ROS section if you don't have ROS installed. For these instructions, we will assume ROS Kinetic; replace kinetic by indigo if that's not your case when necessary.

Software & robot setup

To get the robot up and running without needing to build the app from source, install Tangobot app from Google's Play Store in your device. You will also need to get a helper package in your computer to launch the visualizer.

First, clone the Tangobot respository:

mkdir -p ~/tangobot_ws/src
cd ~/tangobot_ws/src
git clone https://github.com/ekumenlabs/tangobot

Then, install the package dependencies in case you don't have them, and source the environment:

cd ~/tangobot_ws
source /opt/ros/kinetic/setup.bash
rosdep update
rosdep install --from-paths src/tangobot/tangobot_desktop
catkin_make --pkg tangobot_desktop

Connect your device to your robot base using a "USB on the go" cable. The device's main camera should have the same direction of the robot's front. You can check the robot's wiki article for more information about the hardware setup and how to place the Android device over the robot.

Starting the demo!

First, start a ROS Master from a separate terminal by running roscore. Launch the application in your Android device, and specify your PC's IP address to connect to the ROS master (you may optionally run the ROS master on the device directly; for this example we will assume that the ROS master is running on your computer).

Before running the visualizer, ensure your network is properly configured. To do so, run the following command (you can check your system's IP address running ifconfig):

export ROS_IP=YOUR_COMPUTER_IP_ADDRESS

Then, run the visualizer:

roslaunch tangobot_desktop tangobot_demo_visualizer.launch

You should now see the robot in the center of an empty map in RVIZ. You can now send goal poses from there to navigate.

Building the application from source

Pre requisites

To build the application, we assume a clean installation of Ubuntu 16.04 in combination with ROS Kinetic; it should also work in Ubuntu 14.04 & ROS Indigo.

Installing ROS

Run the following commands to install ROS in your system (taken from this guide). Full desktop installation is recommended:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install ros-kinetic-rosjava-build-tools

Downloading source code

Clone the repository if you haven't done it already:

mkdir -p ~/tangobot_ws/src
cd ~/tangobot_ws/src
git clone https://github.com/ekumenlabs/tangobot

Building roscpp_android

This application uses native code to run. To be able to cross-compile native code to Android devices, the roscpp_android environment has to be installed and built. Run the commands described below (taken from the official guide). It will take a long while on the first build:

sudo apt-get update
sudo apt-get install curl git
curl -sSL https://get.docker.com/ | sudo sh
mkdir ~/ros-android-ndk
cd ~/ros-android-ndk
git clone https://github.com/ekumenlabs/roscpp_android.git
cd roscpp_android
./do_docker.sh --portable

Android Studio

This is the recommended tool to edit the code. It will also help you install the required Android SDKs. We will need to install Java first:

sudo apt-get update
sudo apt-get install openjdk-8-jdk
echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/" >> ~/.bashrc

Use openjdk-7 if your are in Ubuntu 14.04.

Then, follow these steps:

  • Download Android Studio from here, install it, and launch it.
  • Import the "tangobot_app" directory by clicking file -> new -> import (it should be in ~/tangobot_ws/src/tangobot/tangobot_app).
  • From the tools menu, select Android -> SDK manager. Install SDK versions 25 & 22.
  • Download Android NDK r13b; you can save it in the same directory the SDK is installed. The default is ~/Android/Sdk. You can get the NDK from NDK release history.
  • Check whether Android Studio created a local.properties file inside "tangobot_app", and if it contains the proper directories for your recently installed SDK. Add a line pointing to the installed NDK as ndk.dir.
  • Add your SDK directory to your PATH environment variable: export PATH=$PATH:$HOME/Android/Sdk/android-ndk-r13b (assuming the default path where Android Studio installs it, and that you stored the NDK there). You may optionally add that line to your ~/.bashrc file to add it permanently.
  • Inside the directory tangobot_app/app/src/main/cpp create a file named local-properties.mk. Add a single line to it: $(call import-add-path, {your path to your roscpp_android environment}/ros-android-ndk/roscpp_android/output) (i.e. the output folder of your recently installed roscpp_android environment. Use the absolute path without the curly braces).

Build and install the app

Almost there! Once you have all the pre-requisites installed, just go to the root of your catkin workspace and run catkin make:

cd ~/tangobot_ws
catkin_make

Congratulations! You just built your apk file. You can find it in tangobot_app/app/build/outputs/apk. You can install it running adb install app-debug.apk from that directory.

tangobot's People

Contributors

adamantivm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tangobot's Issues

Robot Localization

The standard Nav Stack uses AMCL to localize within a map using a laser scan.
The Tango Point cloud can be transformed to a laser scan, but perhaps there is some other way of using Tango features to solve the problem of localizing the robot relative to a fixed frame in a map more efficiently, given that the Tango device can be localized accurately with respect to the start_of_service frame.

Support for Lenovo Phab2 Pro

Test if it works as is or if there are modifications to be done.
To be able to use this device, a mount support needs to be built (e.g. 3D printed), and the extrinsics need to be corrected in the app (and configurable to use Tango Tablet as well).

  • Test and file any bugs found
  • Design and 3D print a mount
  • Create extrinsics configuration for Phab2 Pro sensors with provided mount
  • Update wiki with hardware instructions alternatives for the Phab2 Pro

App design - Status GUI

It would be nice to have indicators to check the app status.
Here's some of the indicators proposed:

  • ROS master URI
  • ROS master connection
  • Tango Status
  • Odometry source
  • Running nodes (navstack)
  • Extrinsics publisher
  • Base status

Navigation stack behavior for baseline configuration

The standard turtlebot running on Linux with and empty map and wheel odometry behaves different than the tangobot running the navigation stack on Android with the same configuration (Navfn & DWA local planner, standard launchfiles).

In particular, it takes more time to reach a given goal (slower movements), and it may get stuck when a goal is given behind the robot, oscillating to both sides until it aborts all plans.

These differences require further investigation.

  • #44 describes one of the possible causes for these differences.
  • #46 describes a way of analyzing the differences.

Racing condition for Parameter Loader

ParameterLoader runs in a thread separate to the main one, and while it's loading the parameters, move_base node may start and attempt to look for the required configuration.

Some mechanism needs to be implemented to ensure that the parameters are loaded before the nodes that consume them are launched.

Improve base_controller

A general review of the code should be performed. The module has some details that can be improved without an excessive effort.

  • The basic code publishes the odometry at 10 Hz using standard thread functions. This can be improved using higher rates and ROS Rate functions. The rate could be configurable too.
  • Some of the transformations being published are not necessary (e.g. laser_link).
  • The basic code publishes odometry using base_link as its target frame. The name could be configurable somehow (for example, publishing base_footprint proved to be useful in tests).
  • General cleanup of "To Do"s.

Supported ABIs

When I tried to add arm64-v8a, I got an error from Gradle saying that it is not supported.
Apparently, compileSdkVersion has to be upgraded to 21 to make it work. When I upgraded it, I got a compilation error coming from roscpp_android_ndk (some header file that was not found). I probably will need to recompile the ROS packages adding the new architecture to make it work.

I also read that for Coconut devices, armeabi-v7a seems to be fine (see here).

We should decide at some point if it is worth upgrading the sdk version and solving that compilation error to add arm64-v8a to abiFilters in gradle configuration.

USB Serial Library to Maven

Upload USB Serial Library to Maven (contact owner).
The USB Serial Lib code shall be removed from this project, and the proper Maven dependency shall be added to build scripts.

Publish a version of map_nav that can be used with Tangobot

Some applications in rosjava/android are available to visualize the robot in a map and send goal poses. map_nav is a good candidate, but it is outdated, and depends on packages that are outdated too in ROS kinetic.

A detailed description of the problems that the application currently has can be found here.

We should discuss and decide if it is worth the effort to get this application refurbished, or if there is a better solution for the problem.

Create tutorials

Create detailed tutorials in roswiki to get a tangobot setup running (detailed as Turtlebot tutorial).

  • Easy setup tutorial (blind / empty map) - See #56
    -- Check rosdep installation
    -- Source workspace
  • Advanced tutorial
    -- Map and sensor reqs TBD

Improve Install Instructions

The install instructions can be improved to make easier to install and run the app without using so many external references, and specifying the proper commands instead.

Base Controller to Maven

Upload Base Controller package to Maven, and add as a dependency in application package and remove code from repository.

Depends on #1 . It is desirable to solve #16 before uploading the package too.

Navigation stack libraries version

The roscpp_android environment uses a fixed version for move_base and its related libraries (costmaps and planners), which are detailed in its rosinstall file.

These libraries are not the ones used in the current Kinetic release, which are the ones used for the standard turtlebot setup. They should be updated to the current versions.

Executing Launchfiles with ROS Master running on device

From #8:
When a launchfile is executed from the computer, the following error appears:

load_parameters: unable to set parameters (last param was [None]):  <Fault 0: 'No such handler: system.multicall'>

This happens even with simple launchfiles like map_to_odom from navigation_setup.

This requires further investigation as it doesn't make running the demos possible.

Make odometry source configurable

Currently, the code uses the odometry coming from Tango using tango_ros_node.
For testing and comparison purposes, it would be good to be able to choose from Tango odometry and wheel odometry provided by base_controller.

Implement 'auxiliary' nodes of move_base in Android

The navigation stack also uses some nodes which are smaller than move_base; some of them are required, others are optional.

Required:

  • TF extrinsics publisher
  • Map Server
  • Base Controller

Desirable:

  • Velocity multiplexer
  • Velocity smoother
  • Safety controller

Optional:

  • Diagnostic aggregator (monitoring)
  • Joint state publisher (probably not required, research pending)

Not required:

  • Robot state publisher (transformations between frames taken from robot description). This one is required by the RVIZ, so it can be considered as part of the Linux visualizer.

Master on shutdown

Check what happens when running master on device and shutting down the app

Node configuration

Many nodes of the Nav Stack (mainly move_base, but also others like robot state publishers with its descriptions) require to have access to several configuration parameters.
In Linux, this problem is addressed using launchfiles, which are not available in Android environments. Then, some other way of configuring nodes has to be implemented in Android to solve this problem.

One possible option is to create a node that reads configuration files and updates the parameter server, emulating launchfiles.
Another option is to configure the nodes by using code directly (perhaps faster to implement, but less flexible).

Logo

Create a nice app logo

Upstream ParameterLoaderNode latching mechanism

#41 implements a simple latching mechanism to prevent other nodes from starting and consuming parameters that were not yet loaded.

The definite mechanism to prevent this should be discussed and implemented before upstreaming the changes to rosjava.
Another candidate to archive the same goal would be a callback after all the parameters are loaded.

Robot model flickers in RVIZ

Check if this is a problem when sending goals / if it can be fixed.
It may be related to robot joint state publisher (which publishes the TFs for the wheels, and is a standard turtlebot component that publishes at a lower rate).

Test: Navigation with Tango odometry instead of wheel odometry

To perform this test, some frame transformations have to be published into tf topic to correct the frames used by the Tango device and the required ones by move_base.

In particular, the Tango devices uses "start_of_service" and "device" as frames of reference, which need to be mapped to "odom" and to the robot frame.

#18 addresses this problem with some helper scripts, which take in the data published by the Tango Node, and republishes the required information.

The test result is successful: move_base can drive the robot properly using Tango odometry. The result can be visualized in RVIZ.

App design - Parameter configuration

Some parameters should be configurable from within the application. Some of them are:

  • Odometry source (Tango / wheels)
  • Nodes to execute
  • Custom Master Chooser (it would be nice to skip the default one and use something that saves the configuration and applies it automatically like in Tango Ros Streamer)

Topic remapper

The current demo running the navigation stack on the computer uses a helper script to remap topics, which runs a node that subscribes to the source topic and publishes the same information to a target topic. This is required because the move_base launchfile belongs to a turtlebot package, which remaps cmd_vel by default.

It would be good to remap the cmd_vel in a more efficient way. One way of doing so is using a proper mux, like in the std_turtlebot example.

Quick launch Readme / tutorial

  • Improve readme to provide instructions to quickly launch the robot without needing to build the whole app.
  • Create a tutorial in roswiki with similar instructions.

Cross compile move_base

This package is the main component of the navigation stack, so it requires special attention.
It consists of many plugins, which have to be cross compiled:

  • Costmap 2D
  • Nav Core
  • Local Planner
  • Global Planner (navfn)
  • Recovery behaviors / costmap clearing

Extrinsics publisher improvement

#63 adds a basic implementation for extrinsics transformations publisher.

It would be better to publish these transformations by reading some YAML files instead of defining them using code.

Note: This is different to the robot state publisher as it uses tf_static to publish the robot frames, and move_base (costmaps in particular) needs the transformations in tf.

Snackbar for settings on first run

Add a snackbar to go to the Main activity on first run (currently, the "back" button has to be pressed and its confusing for a user).

Investigate Snakeyaml

To load configuration parameters from yaml files, Snakeyaml library seems to be a good candidate.
There are artifacts available on Maven: Snake Yaml Maven.

If the library fits the application, the problem of configuring the nodes can be considered as solved (see discussion in #10).

Roadmap

This issue is to keep track of high level tasks required to accomplish the final goal: a robot that navigates with an application running completely on an Android device.

Static tf publisher to Rosjava

#63 adds a node that is capable of publishing given transformations to tf, just as the native version for static tf publisher.

This could be an interesting contribution to rosjava; it would be nice if it could read what to transform from the parameter server or Yaml files.

Add Tango Node as new library to project

From Intermodalics App.

  • Publish TangoRosNode to Maven.
  • Remove local code.
  • Correct remaining details (we are using a slightly old version) and add new dependency.

Remove local base controller

The base controller module's source code is publicly available, so all the modifications for this project shall be properly contributed to base controller's repo.
The source of the module shall be removed from this project so as not to replicate existing code.

Map server - Read from real map

#64 adds a basic implementation for a map server.
This should eventually be replaced with a module that reads an actual image with metadata.

For a first version, reading an image from app resources would do.

Integrating Tango & Wheel odometry

Tango odometry is more accurate than wheel odometry.
Some research has to be done to figure if it is worth doing fusion with both odometries, correcting wheel odometry with Tango odometry, or just using Tango odometry alone.

Navigate on Linux with Tango data

To test the navigation stack on Linux, the starting point will be an operational navigation stack running with data coming from a simulator (such as Stage or Gazebo). Then, the simulation shall be removed, and the data inputs shall be replaced progressively with real data coming from a Tango device.
These are the steps to follow:

  • Run a fully operational Nav Stack on Linux using simulated data (Stage) - Step 0.
  • Remove the simulator, and use wheel odometry as input to move_base and the visualizer (RVIZ). Use a clean map. - Step 1
  • Use Tango odometry instead of wheel odometry. See #15 . - Step 2.
  • Use Wheel and Tango odometry in an effective manner (perhaps correcting wheel odometry with Tango odometry. Only if necessary).
  • Add Tango Point Cloud for obstacle avoidance.
  • Add a Map
  • Solve localization problem. See #13 .

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.