Coder Social home page Coder Social logo

rongix / ros_navigation_command_app Goto Github PK

View Code? Open in Web Editor NEW
33.0 2.0 16.0 475 KB

Application for controlling ROS robot with voice commands, sending goals on map or remote control with virtual joystick

Kotlin 0.26% Swift 0.19% Objective-C 0.02% Dart 98.99% HTML 0.54%
ros ros-melodic dart flutter dialogflow mobile-app flutter-apps flutter-demo teleoperation

ros_navigation_command_app's Introduction

ros_command_app

Application for controlling ROS robot with voice commands, sending goals on map or remote controll with virtual joystick 29.03.2020

Please note that I made this app as a beginner (~29.03.2020), there are some mistakes and bad practices that should be changed, architecture / state management is also not great. It serves as a demo and the starter point for anyone interested in ROS + Flutter, please keep in mind that it is unlikely that the repository will be updated and / or activelly updated. Sorry for the inconvenience and unresolved issues.

Check out youtube video showcasing app (PL + ENG subtitles):

YouTube video here

Map page

You can move robot between points which are created fter clicking on the fab.

https://github.com/Rongix/ros_navigation_command_app

Controller page

Chat page

Chat page provides communication with Dialogflow Agent.

Internatiolization & language support

This app is not internationalized, there are some UI hardcoded strings in polish, sorry for any inconvenience! It uses polish dialogflow intents so it may be tricky to get it running flawlessly. This app has english and polish versions (no dialogflow agent included)

Getting started:

You need to have ROS installed. App was tested with Turtlebot3 Waffle Pi in the simulation environment, althought it can work with any robot. You can quickly set topics and configurate ROS in the app settings.

This project is a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Getting Started

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Prerequisites

Installation

Installation of ROS

ROS kinetic: please follow instruction ROS Melodic: Instruction for Ubuntu 18.04 below:

  1. Following step will update your system and install ROS-Melodic-dekstop-full version. It will also create few aliases and source ROS-melodic environment in your .bashrc, and create catkin_ws folder in your root directory.
sudo apt update
sudo apt upgrade -y
wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_melodic.sh && chmod 755 ./install_ros_melodic.sh && bash ./install_ros_melodic.sh
  1. Install dependencies.
sudo apt install ros-melodic-joy ros-melodic-teleop-twist-joy ros-melodic-teleop-twist-keyboard ros-melodic-laser-proc ros-melodic-rgbd-launch ros-melodic-depthimage-to-laserscan ros-melodic-rosserial-arduino ros-melodic-rosserial-python ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server ros-melodic-move-base ros-melodic-urdf ros-melodic-xacro ros-melodic-compressed-image-transport ros-melodic-rqt-image-view ros-melodic-gmapping ros-melodic-navigation ros-melodic-interactive-markers
  1. Install packages for Turtlebot3 (it contains node for simulation).
cd ~/catkin_ws/src/
git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ~/catkin_ws && catkin_make
  1. In the next steps you should configure your network.
sudo nano ~/.bashrc
// EDIT FIELDS: Replace with your ip adress. Please not that you should not use http://localhost:11311 because it won't work.
// Get your ip with: hostname -I
// EXAMPLE: export ROS_MASTER_URI=http://192.221.1.11:11311
// EXAMPLE: export ROS_HOSTNAME=192.221.1.11
// REPLACE: 192.221.1.11 with your ip.
  1. Install camera package.
cd ~/catkin_ws/src/
git clone https://github.com/OTL/cv_camera.git
cd ~/catkin_ws && catkin_make

// EXAMPLE of use: rosparam set cv_camera/device_id 001
// EXAMPLE of use: rosrun cv_camera cv_camera_node
  1. Export ROS parameters; simulated robot model. I use waffle_pi. Add appropriete line to your bashrc.
export TURTLEBOT3_MODEL=waffle_pi

Running ROS with application.

Refer ROBOTIS e-Manual for more information.

Launch ROS

Read instruction how to use launch nodes and fake node in simulation chapter.

roscore
roslaunch turtlebot3_fake turtlebot3_fake.launch
roslaunch turtlebot3_gazebo turtlebot3_house.launch
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
roslaunch turtlebot3_navigation turtlebot3_navigation.launch 
//NOTE: This is example, adjust paths to launch files.
roslaunch '/home/rongix/catkin_ws/src/turtlebot3/turtlebot3_navigation/launch/move_base.launch'

Configure ROS params in mobile app settings

Voice commands

To use voice commands you have to configure your own dialogflow agent

ros_navigation_command_app's People

Contributors

rongix avatar

Stargazers

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

Watchers

 avatar  avatar

ros_navigation_command_app's Issues

Cannot connect to ROS

Hi, I am able to build and compile the app successfully. However, when I refresh the connection by pressing the refresh button, I am getting this error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: Bad state: No element
#0 Iterable.first (dart:core/iterable.dart:624:7)
#1 RosSubscriber.establishTCPROSConnection. (package:ros_nodes/src/ros_subscriber.dart:124:12)
#2 _rootRunUnary (dart:async/zone.dart:1434:47)
#3 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#4 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#5 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#6 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#7 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#8 _TakeStream._handleData (dart:async/stream_pipe.dart:305:12)
#9 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)
#10 _rootRunUnary (dart:async/zone.dart:1434:47)
#11 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#12 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#13 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#14 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#15 _SyncBroadcastStreamController._sendData. (dart:async/broadcast_stream_controller.dart:385:20)
#16 _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:322:15)
#17 _SyncBroadcastStreamController._sendData (dart:async/broadcast_stream_controller.dart:384:5)
#18 _BroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:244:5)
#19 _AsBroadcastStreamController.add (dart:async/broadcast_stream_controller.dart:474:11)
#20 _rootRunUnary (dart:async/zone.dart:1434:47)
#21 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#22 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#23 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#24 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#25 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#26 _StreamController._add (dart:async/stream_controller.dart:648:7)
#27 _StreamController.add (dart:async/stream_controller.dart:596:5)
#28 _Socket._onData (dart:io-patch/socket_patch.dart:2314:41)
#29 _rootRunUnary (dart:async/zone.dart:1442:13)
#30 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
#31 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
#32 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
#33 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#34 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#35 _StreamController._add (dart:async/stream_controller.dart:648:7)
#36 _StreamController.add (dart:async/stream_controller.dart:596:5)
#37 new _RawSocket. (dart:io-patch/socket_patch.dart:1839:33)
#38 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14)
#39 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#40 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

I am really unable to understand why this is happening, and am not able to fix it. Any help would be greatly appreciated! Thanks a lot!

Unable to subscribe

Hey, I managed to compile the APK and am trying to run it on an android device. I have set the master IP to the ROS_MASTER_URI and the local IP correctly. I'm able to send data on /cmd_vel but am not able to subscribe to any topic (such as camera on the correct topic or the map.

Did I miss any step in setup? Can you help me debug this?

Can we get the Coordinates from the rendered map to Publish as a goal

Hey Rongix,
Firstly I greatly appreciate for this project which helped me integrate ROS and Flutter. I just started to learn in depth concepts like Canvas in Flutter, Can you help me add this feature where we can get the Coordinates from rendered map using interactive Viewer which can be used to pass it as a Goal through DartROS publisher. I have tried it but no visible results. Any idea how to add this functionality? Any help will be greatly appreciated.

Thanks,
V

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.