Skip to content

Commit

Permalink
first step to merge doc and master
Browse files Browse the repository at this point in the history
  • Loading branch information
amamory committed Apr 12, 2019
2 parents 7e56e2f + 03de38d commit 174dcbf
Show file tree
Hide file tree
Showing 165 changed files with 8,474 additions and 941 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
build/
docs/doxygen/html/
client/godonnie/Log/
Log/

# gtts resource
download.mp3
Expand All @@ -84,3 +85,9 @@ GoDonnieLexer.c
GoDonnieLexer.h
GoDonnieParser.c
GoDonnieParser.h

# Files generated by install.sh
Player
Stage
docs/_build
donnie-assistive-robot-sw
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/wiki/player-stage"]
path = docs/wiki/player-stage
url = https://github.com/lsa-pucrs/Player-Stage-Manual
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_install:
# install Player/Stage depedencies
- sudo apt-get install -y libfltk1.1-dev freeglut3-dev libpng12-dev libltdl-dev libdb5.1-stl libgnomecanvasmm-2.6-dev python-gnome2
#sudo apt-get install -y libboost-all-dev # overkill, the actually required libraries are boostthread, boostsignal, boostsystem
- sudo apt-get install -y libboost-signals-dev libboost-system-dev libboost-thread-dev
- sudo apt-get install -y libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-locale-dev
# old OpenCV for older Player drivers
- sudo apt-get install -y libopencv-dev libopencv-core-dev libcv-dev libcvaux-dev libhighgui-dev
- sudo apt-get install -y libasound2-dev libgsl0-dev libxmu-dev libpq-dev libpqxx-dev
Expand Down
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project(Donnie)
#ENDIF (POLICY CMP0048)
#set(PROJECT_VERSION "0.1")

cmake_policy(SET CMP0017 OLD)

#####################################
# check DONNIE_PATH
if(DEFINED ENV{DONNIE_PATH})
Expand All @@ -27,15 +29,23 @@ message(STATUS "DONNIE_SOURCE_PATH = ${DONNIE_SOURCE_PATH}")
#####################################
# important varaiable used to find packages
if(DEFINED ENV{PKG_CONFIG_PATH})
SET (PKG_CONFIG_PATH $ENV{PKG_CONFIG_PATH})
MESSAGE(STATUS "PKG_CONFIG_PATH = $ENV{PKG_CONFIG_PATH}")
#SET (PKG_CONFIG_PATH $ENV{PKG_CONFIG_PATH})
# get the CMake module paths from the environmental variable CMAKE_MODULE_PATH
set(AUX_PKG_CONFIG_PATH "$ENV{PKG_CONFIG_PATH}")
# PKG_CONFIG_PATH must be a list, with ; as delimitation character
string(REPLACE ":" ";" PKG_CONFIG_PATH ${AUX_PKG_CONFIG_PATH})
MESSAGE(STATUS "PKG_CONFIG_PATH = ${PKG_CONFIG_PATH}")
else()
message(FATAL_ERROR "PKG_CONFIG_PATH is NOT defined. Set where to find the pkg-config files.")
endif()

if(DEFINED ENV{CMAKE_MODULE_PATH})
SET (CMAKE_MODULE_PATH $ENV{CMAKE_MODULE_PATH})
MESSAGE(STATUS "CMAKE_MODULE_PATH = $ENV{CMAKE_MODULE_PATH}")
#SET (CMAKE_MODULE_PATH $ENV{CMAKE_MODULE_PATH})
# get the CMake module paths from the environmental variable CMAKE_MODULE_PATH
set(AUX_CMAKE_MODULE_PATH "$ENV{CMAKE_MODULE_PATH}")
# CMAKE_MODULE_PATH must be a list, with ; as delimitation character
string(REPLACE ":" ";" CMAKE_MODULE_PATH ${AUX_CMAKE_MODULE_PATH})
MESSAGE(STATUS "CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
else()
message(FATAL_ERROR "CMAKE_MODULE_PATH is NOT defined. Set where to find the cmake files.")
endif()
Expand Down Expand Up @@ -130,6 +140,7 @@ MESSAGE (STATUS "----- Identification Done -----")

######################################
# Compile/Install Donnie

MESSAGE (STATUS)
MESSAGE (STATUS "----- Processing client makefiles -----")
add_subdirectory(client)
Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ most of the programming environments for kids are high visual, based on grab and
Donnie project proposes an inclusive robotic programming environment where all students
(with or without visual disabilities) can use.

Donnie comes with two usage options: simulated robot and physical robot. It is recommend to start with the simulated since it does not require building the robot. Moreover, the physical robot is functional, but still under test.
Donnie comes with two usage options: simulated robot and physical robot. It is recommended to start with the simulated since it does not require building the robot. Moreover, currently the physical robot is functional, but it is still under test.

Contents
--------
Expand Down Expand Up @@ -58,7 +58,7 @@ alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>

## Run Donnie Software from a Virtual Machine

Download this [VM](link) all Donnie software pre-installed and ready to run.
Download this [VM](http://www.osboxes.org/linux-mint/), select the Linux Mint 17.3 'Rosa', and selected the [Mate](https://drive.google.com/file/d/0B_HAFnYs6Ur-NGFCZWNFV2dBN2M/view?usp=sharing) version. Finally, follow the instructions to install Donnie package.

## Install Donnie Software on a Desktop Computer Using the Packages

Expand All @@ -70,11 +70,11 @@ alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
* It is recommended to update your packages before the instalation:
> sudo apt-get update
* To install, you can double-click it or execute:
> sudo dpkg -i donnie_1.0.0_amd64.deb
* In case of missing dependencies, try:
> sudo apt-get install -f
> sudo dpkg -i donnie-player-stage_0.1_amd64.deb
* In case of missing dependencies, try:
> sudo apt-get -f install
* To unistall:
> sudo dpkg -r donnie
> sudo dpkg -r donnie-player-stage
## Compile and Install Donnie Software on a Desktop Computer

Expand All @@ -88,6 +88,7 @@ alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
mkdir ~/donnie; cd ~/donnie
wget https://github.com/lsa-pucrs/donnie-assistive-robot-sw/raw/devel/install.sh
chmod +x ./install.sh
export DONNIE_PATH=/opt/donnie
./install.sh

### Configuring Donnie
Expand All @@ -99,8 +100,8 @@ The build system is based on CMake, so it is required to have some experience wi
Every part of Donnie Software Stack is also based on CMake. These are the software parts that can be customized:

- raspicam driver
- Player
- Stage
- [Player](https://github.com/playerproject/player)
- [Stage](https://github.com/rtv/Stage)
- Donnie Software

each of these packages have their one sets of parameters.
Expand All @@ -113,6 +114,12 @@ Developers interested in customization might want to read the following files:
- [install/setup-rpi.sh](install/setup-rpi.sh)
- and all the CMakeLists.txt files

### Learning Player and Stage

Donnie is based on Player/Stage robotic middlware and simulator. It is higly
recommended for Donnie developers to understand Player/Stage to add more features,
create new elaborated scenarios, etc. The official documents are [Player](https://playerproject.github.io/), [Player wiki](https://github.com/playerproject/player/wiki) and [Stage](http://rtv.github.io/Stage/).
However, the best documentation is the [Player/Stage tutorial](http://player-stage-manual.readthedocs.io).

### Parameter for Donnie Software

Expand Down Expand Up @@ -157,7 +164,8 @@ To build your own Donnie robot, please refer to the following repositories (gith

mkdir ~/donnie; cd ~/donnie
wget https://github.com/lsa-pucrs/donnie-assistive-robot-sw/raw/devel/install-rpi.sh
chmod +x ./install-rpi.sh
chmod +x ./install-rpi.sh
export DONNIE_PATH=/opt/donnie
./install-rpi.sh

Experienced programmers can configure the same paramerters presented before for the Raspberry Pi.
Expand Down
3 changes: 1 addition & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ IF(NOT ROBOT_COMPUTER)
# if it is compiling for the desktop computer, then compile the following modules
add_subdirectory(godonnie)
add_subdirectory(alerts)
#add_subdirectory(vib_belt)
add_subdirectory(test)
ELSE()
# if it is compiling for robot`s computer (RPi)
add_subdirectory(alerts)
ENDIF()


37 changes: 20 additions & 17 deletions client/alerts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,37 @@ PROJECT (${CLIENTNAME})
message(STATUS "Configuring '${CLIENTNAME}'")

#########
# check depedencies - libsox
# check DONNIE_PATH
#########
find_path( LSOX_INCLUDE_DIR sox.h DOC "Libsox include dir" )
find_library( LSOX_LIB
NAMES sox
HINTS /usr/lib/x86_64-linux-gnu/
DOC "Libsox lib" REQUIRED)

IF( NOT LSOX_LIB )
MESSAGE( FATAL_ERROR "libSoX not found. Please install 'sudo apt-get install libsox-dev'. aborting" )
if(DEFINED ENV{DONNIE_PATH})
SET(DONNIE_PATH "$ENV{DONNIE_PATH}")
#message(STATUS "DONNIE_PATH = ${DONNIE_PATH}")
else()
message(FATAL_ERROR "DONNIE_PATH is NOT defined")
endif()

#########
# check depedencies - boost locale
#########
FIND_PACKAGE (Boost REQUIRED COMPONENTS locale)
IF( NOT Boost_FOUND )
MESSAGE( FATAL_ERROR "Libboost-locale not found. Please install 'sudo apt-get install libboost-locale-dev'. aborting" )
ENDIF()
message(STATUS "SoX Library -- ${LSOX_LIB}")
message(STATUS "SoX Include -- ${LSOX_INCLUDE_DIR}")

#########
# set Player cmake modules
#########
# Include this CMake module to get most of the settings needed to build
SET (CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules")

# required to support 'acentos' in Portuguese
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexec-charset=iso-8859-1")
#SET (CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules")

INCLUDE (UsePlayerC++)

PLAYER_ADD_PLAYERCPP_CLIENT (${CLIENTNAME}
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/alerts.cc ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/utils.cpp
INCLUDEDIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/)

TARGET_LINK_LIBRARIES (${CLIENTNAME} sox)
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${LSOX_INCLUDE_DIR})
TARGET_LINK_LIBRARIES (${CLIENTNAME} ${Boost_LIBRARIES})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIR})

# Install executables with -x permission
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${CLIENTNAME} DESTINATION ${DONNIE_PATH}/bin)
Expand Down
26 changes: 20 additions & 6 deletions client/alerts/alerts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,29 @@ DonnieClient::DonnieClient()
{
string host = GetEnv("DONNIE_IP");
string donnie_path = GetEnv("DONNIE_PATH");
string donnie_lang = GetEnv("DONNIE_LANG");

int port = atoi(GetEnv("DONNIE_PORT").c_str());
if(host.size()==0) host = "localhost";
if(port==0) port = 6665;
if (donnie_path=="") {
cerr << "variable DONNIE_PATH not defined. Please execute 'export DONNIE_PATH=<path-to-donnie>'" << endl;
cerr << translate("variable DONNIE_PATH not defined. Please execute 'export DONNIE_PATH=<path-to-donnie>'") << endl;
exit(1);
}

// TODO: read a configuration file so user can change these sounds
if (donnie_lang=="") {
cerr << translate("variable DONNIE_LANG not defined. Please execute 'export DONNIE_LANG=$LANGUAGE'") << endl;
exit(1);
}
// Set up language environment
generator gen;
gen.add_messages_path(donnie_path + "/resources/loc");
gen.add_messages_domain("alerts");
locale loc = gen(donnie_lang + ".UTF-8");
locale::global(loc);
cout.imbue(loc);
cerr.imbue(loc);

// TODO: read a configuration file so user can change these sounds
SSTEP = donnie_path+"/resources/sounds/HIT.wav"; //Sound STEP
SSBACK = donnie_path+"/resources/sounds/192805sound13.wav"; //Sound Step BACK
STRIGHT = donnie_path+"/resources/sounds/126413specialcoin.wav"; //Sound Turn RIGHT
Expand All @@ -45,8 +59,8 @@ DonnieClient::DonnieClient()
#ifndef NDEBUG
cerr << e << endl;
#endif
cerr << "Não foi possível conectar no robô " << endl;
cerr << "Possivelmente o arquivo cfg está incorreto." << endl;
cerr << translate("Não foi possível conectar no robô ") << endl;
cerr << translate("Possivelmente o arquivo cfg está incorreto.") << endl;
exit(1);
}

Expand Down Expand Up @@ -96,7 +110,7 @@ void DonnieClient::checkSteps(){
/*if(dir>0)sound->play((char *)SSTEP.c_str());
if(dir<0)sound->play((char *)SSBACK.c_str());*/
#ifndef NDEBUG
cout << "translation>=STEP_LENGHT_ERROR:" << translation << endl;
cout << translate("translation>=STEP_LENGHT_ERROR:") << translation << endl;
#endif
}
translation=0;
Expand Down
6 changes: 6 additions & 0 deletions client/alerts/alerts.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@
#include "utils.h"
#include <libplayerc++/playerc++.h>

// Localization libraries
#include <boost/locale.hpp>

using namespace std;
using namespace PlayerCc;
using namespace boost::locale;
using boost::locale::translate;
using boost::locale::format;

typedef struct PathNodes{
double x, y, a;
Expand Down
24 changes: 20 additions & 4 deletions client/godonnie/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
CMAKE_MINIMUM_REQUIRED (VERSION 2.8 FATAL_ERROR)
cmake_policy(SET CMP0017 OLD)

SET (CLIENTNAME "GoDonnie")
PROJECT (${CLIENTNAME})

Expand Down Expand Up @@ -27,7 +29,7 @@ endif()


# Include this CMake module to get most of the settings needed to build
SET (CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules")
#SET (CMAKE_MODULE_PATH "/usr/local/share/cmake/Modules")

#########
# check depedencies - java -lreadline -lantlr3c
Expand Down Expand Up @@ -62,14 +64,28 @@ find_library( LANTLR3_LIB
DOC "Liantlr3 lib" REQUIRED)

IF( NOT LANTLR3_LIB )
MESSAGE( FATAL_ERROR "Liantlr3 not found. Please install 'sudo apt-get install libantlr3c-dev'. aborting" )
MESSAGE( FATAL_ERROR "Libantlr3 not found. Please install 'sudo apt-get install libantlr3c-dev'. aborting" )
ENDIF()
message(STATUS "ANTLR3 Library -- ${LANTLR3_LIB}")
message(STATUS "ANTLR3 Include -- ${LANTLR3_INCLUDE_DIR}")

#########
# check depedencies - boost locale
#########
FIND_PACKAGE (Boost REQUIRED COMPONENTS locale)
IF( NOT Boost_FOUND )
MESSAGE( FATAL_ERROR "Libboost-locale not found. Please install 'sudo apt-get install libboost-locale-dev'. aborting" )
ENDIF()

#########
# run antlr
#########
# Check for DONNIE_LANG variable
IF (NOT DEFINED ENV{DONNIE_LANG})
# If not defined, set to system language
SET (ENV{DONNIE_LANG} ENV{LANGUAGE})
ENDIF()

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/GoDonnie.tokens
COMMAND java -jar ${CMAKE_CURRENT_SOURCE_DIR}/Antlr/antlr-3.2.jar -o ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/GoDonnie.g
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/GoDonnie.g
Expand Down Expand Up @@ -104,8 +120,8 @@ PLAYER_ADD_PLAYERCPP_CLIENT (${CLIENTNAME}
INCLUDEDIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/)

# add the includes and libs to build it
TARGET_LINK_LIBRARIES (${CLIENTNAME} ${LREADLINE_LIB} ${LANTLR3_LIB})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${LANTLR3_INCLUDE_DIR} ${LREADLINE_INCLUDE_DIR} )
TARGET_LINK_LIBRARIES (${CLIENTNAME} ${LREADLINE_LIB} ${LANTLR3_LIB} ${Boost_LIBRARIES})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${LANTLR3_INCLUDE_DIR} ${LREADLINE_INCLUDE_DIR} ${Boost_INCLUDE_DIR})

# godonnie depends on GoDonnieParser. This makes sure that the parser is built before the GoDonnie interpreter
add_dependencies(GoDonnie GoDonnieParser)
Expand Down
Loading

0 comments on commit 174dcbf

Please sign in to comment.