diff --git a/.gitignore b/.gitignore
index c057cef..eb0f44a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
-/scripts/qt_pi/*.pyc
+*.pyc
.ccls-cache
compile_commands.json
diff --git a/gazebo_sim/package.xml b/gazebo_sim/package.xml
index aa85652..7486499 100644
--- a/gazebo_sim/package.xml
+++ b/gazebo_sim/package.xml
@@ -5,6 +5,13 @@
Rishabh Kundu
MIT
catkin
+ gmapping
+ amcl
+ move_base
+ depthimage_to_laserscan
+ map_server
+ static_transform_publisher
+ teleop_twist_keyboard
diff --git a/qt_pi/CMakeLists.txt b/qt_pi/CMakeLists.txt
index b5d24c9..89b083e 100644
--- a/qt_pi/CMakeLists.txt
+++ b/qt_pi/CMakeLists.txt
@@ -1,62 +1,62 @@
cmake_minimum_required(VERSION 2.8.3)
project(qt_pi)
-set(CMAKE_CXX_FLAGS "-fpermissive -std=c++0x")
-
+set(CMAKE_CXX_FLAGS "-std=c++0x")
+#-fpermissive
+#ros setup
find_package(catkin REQUIRED COMPONENTS
qt_build
roscpp
roslib
)
-find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL)
-
-
-#set(FORMS ui/speller.ui)
-set(MOC include/mapview/mapview.h)
-set(HPP include/speller/speller.h include/mapview/vertex.h)
-set(SRCS src/speller.cpp src/mapview.cpp )
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-#qt5_wrap_ui(FORMS_HPP ${FORMS})
-qt5_wrap_cpp(MOC_HPP ${MOC})
-qt5_add_resources(RCC resources/resources.qrc)
-
catkin_python_setup()
catkin_package(DEPENDS)
+#Qt setup and MOC generation
+find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL)
+set(MOC include/speller/speller.h include/mapview/mapview.h)
+set(HPP include/mapview/vertex.h)
+set(SRCS src/speller.cpp src/mapview.cpp )
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+qt5_wrap_cpp(MOC_HPP ${MOC})
+qt5_add_resources(RCC resources/resources.qrc)
+
+
+
+
+
+#Mcrypt library includes
find_package(PkgConfig REQUIRED)
-
-find_path(Mcrypt_INCLUDE_DIR mcrypt.h PATHS
- /usr/include
-)
-
+find_path(Mcrypt_INCLUDE_DIR mcrypt.h PATHS /usr/include)
set(Mcrypt_LIB_PATHS /usr/lib)
find_library(Mcrypt_LIBS NAMES mcrypt rtfilter PATHS ${Mcrypt_LIB_PATHS})
+include_directories(${Mcrypt_INCLUDE_DIRS})
+link_directories(${Mcrypt_LIBS})
-include_directories(include
-${catkin_INCLUDE_DIRS}
-)
-
+#Gattlib includes
pkg_search_module(GATTLIB REQUIRED gattlib)
pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
-include_directories(${Mcrypt_INCLUDE_DIRS})
-link_directories(${Mcrypt_LIBS})
+include_directories(include
+ ${catkin_INCLUDE_DIRS}
+)
+
+#ble_connect library generation
add_library(ble_connect include/ble_connect/ble_connect.h src/ble_connect.c)
-
target_link_libraries(ble_connect ${GATTLIB_LIBRARIES} ${GATTLIB_LDFLAGS} ${GLIB_LDFLAGS} pthread ${Mcrypt_LIBS})
+#ble_connect_test executable generation
add_executable(ble_connect_test tests/ble_test.cpp)
target_link_libraries(ble_connect_test ble_connect)
-
+#speller library generation
add_library(speller ${SRCS} ${FORMS_HPP} ${MOC_HPP} ${RCC} ${HPP})
-target_link_libraries(speller Qt5::Widgets Qt5::Core Qt5::OpenGL Qt5::Gui ${catkin_LIBRARIES})
+target_link_libraries(speller Qt5::Widgets Qt5::Core Qt5::OpenGL Qt5::Gui ${catkin_LIBRARIES} ble_connect)
+#main executable generation
add_executable(speller_ui src/main.cpp)
target_link_libraries(speller_ui speller)
diff --git a/qt_pi/include/ble_connect/ble_connect.h b/qt_pi/include/ble_connect/ble_connect.h
index 511a78f..c5cccbc 100644
--- a/qt_pi/include/ble_connect/ble_connect.h
+++ b/qt_pi/include/ble_connect/ble_connect.h
@@ -14,7 +14,7 @@ enum Channels { AF3 = 0, T7 = 1, Pz = 2, T8 = 3, AF4 = 4 };
struct insight_data {
double uV[5];
struct timespec ts;
-} insight_data;
+};
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/qt_pi/include/mapview/mapview.h b/qt_pi/include/mapview/mapview.h
index e338ee5..87821d7 100644
--- a/qt_pi/include/mapview/mapview.h
+++ b/qt_pi/include/mapview/mapview.h
@@ -21,29 +21,38 @@ class MapView : public QOpenGLWindow, protected QOpenGLFunctions_3_1 {
public:
explicit MapView(QWidget *parent = 0);
~MapView();
+
void start_blinking();
void stop_blinking();
- volatile int sleep_control = 1;
+ void toggle_blinking();
protected:
GLsizei count;
GLint startingElements[4] = {0, 4, 8, 12};
GLsizei counts[4] = {4, 4, 4, 4};
+
void initializeGL() override;
void paintGL() override;
void resizeGL(int, int) override;
void teardownGL();
void printContextInformation();
+
signals:
void update_GUI();
+ void keyPress(QKeyEvent *key);
private:
QOpenGLBuffer m_vertex;
QOpenGLVertexArrayObject m_object;
QOpenGLShaderProgram *m_program;
- void run();
+
+ volatile int sleep_control = 1;
+ volatile int blinking;
+
std::thread *t;
- int blinking;
+
+ void run();
+ void keyPressEvent(QKeyEvent *key) override;
// QTimer *t1;
// QTimer *t2;
// QTimer *t3;
diff --git a/qt_pi/include/speller/speller.h b/qt_pi/include/speller/speller.h
index cdc5928..5d90381 100644
--- a/qt_pi/include/speller/speller.h
+++ b/qt_pi/include/speller/speller.h
@@ -1,18 +1,34 @@
#ifndef SPELLER
#define SPELLER
-#include
+#include "ble_connect/ble_connect.h"
+#include "mapview/mapview.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include