Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile and run natively in Noetic/Qt5 #211

Open
wants to merge 4 commits into
base: indigo-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Stdr Simulator Travis Continuous Integration Configuration File
# Author: Christos Zalidis
# Maintained: Greg Lee (CWRU)
sudo: required
dist: trusty
dist: foxy
language: generic
compiler:
- gcc
notifications:
email:
recipients:
- etsardou@gmail.com
- zalidis@gmail.com
- aris.thallas@gmail.com
- leegs@case.edu
on_success: change #[always|never|change] # default: change
on_failure: change #[always|never|change] # default: always
before_install: # Use this to prepare the system to install prerequisites or dependencies
# Define some config vars
- export ROS_DISTRO=indigo
- export ROS_DISTRO=noetic
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME"
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu foxy main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get install -qq -y python-catkin-pkg python-rosdep python-wstool ros-$ROS_DISTRO-catkin ros-$ROS_DISTRO-ros
Expand Down
24 changes: 16 additions & 8 deletions stdr_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@ include_directories( include
${catkin_INCLUDE_DIRS}
)

find_package(Qt4 REQUIRED COMPONENTS
QtCore
QtGui
QtUiTools
find_package(Qt5 REQUIRED COMPONENTS
Core
Gui
UiTools
Widgets
)

ADD_DEFINITIONS(-DQT_NO_KEYWORDS)

include(${QT_USE_FILE})
#include(${QT_USE_FILE})

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)

catkin_package(
DEPENDS
QT
Qt5Core
Qt5Gui
Qt5UiTools
Qt5Widgets
CATKIN_DEPENDS
roscpp
roslib
Expand All @@ -44,6 +48,7 @@ catkin_package(
stdr_parser
sensor_msgs
nav_msgs
qt_gui
#INCLUDE_DIRS
#LIBRARIES
)
Expand All @@ -60,7 +65,7 @@ set(QT_FORMS
ui/thermalSensorProperties.ui ui/soundSensorProperties.ui
)

QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})
qt5_wrap_ui(QT_FORMS_HPP ${QT_FORMS})

QT_WRAP_CPP(stdr_gui_node SAMPLE_MOC_SRCS include/stdr_gui/stdr_gui_controller.h)
QT_WRAP_CPP(stdr_gui_node SAMPLE_MOC_SRCS include/stdr_gui/stdr_gui_connector.h)
Expand Down Expand Up @@ -115,7 +120,10 @@ add_executable(stdr_gui_node
add_dependencies(stdr_gui_node ${stdr_msgs_EXPORTED_TARGETS}) # Wait for stdr_msgs to build
target_link_libraries(stdr_gui_node
${catkin_LIBRARIES}
${QT_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5UiTools_LIBRARIES}
${Qt5Widgets_LIBRARIES}
)

# Install launch files
Expand Down
47 changes: 24 additions & 23 deletions stdr_gui/include/stdr_gui/stdr_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,34 @@
#include <QtCore/QTimer>
#include <QtCore/QTime>

#include <QtGui/QMenu>
#include <QtGui/QApplication>
#include <QtGui/QCheckBox>
#include <QtGui/QComboBox>
#include <QtGui/QDoubleSpinBox>
#include <QtWidgets/QMenu>
#include <QtWidgets/QApplication>

#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDoubleSpinBox>
#include <QtGui/QImage>
#include <QtGui/QFileDialog>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QListWidget>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QProgressBar>
#include <QtGui/QPushButton>
#include <QtGui/QRadioButton>
#include <QtGui/QScrollBar>
#include <QtGui/QStatusBar>
#include <QtGui/QTextEdit>
#include <QtGui/QTreeWidget>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include <QtGui/QWindowsStyle>
#include <QtGui/QInputDialog>
#include <QtWidgets/QProgressBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QRadioButton>
#include <QtWidgets/QScrollBar>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
//#include <QtWidgets/QWindowsStyle>
#include <QtWidgets/QInputDialog>
#include <QtGui/QMouseEvent>
#include <QtGui/QMessageBox>
#include <QtGui/QTimeEdit>
#include <QtGui/QInputDialog>
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QTimeEdit>
#include <QtWidgets/QInputDialog>
#include <QtGui/QFont>

#include <stdr_msgs/RobotIndexedVectorMsg.h>
Expand Down
11 changes: 9 additions & 2 deletions stdr_gui/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@
<depend>sensor_msgs</depend>
<depend>nav_msgs</depend>

<build_depend>libqt4-dev</build_depend>
<exec_depend>libqt4</exec_depend>
<build_depend>libqt5-core</build_depend>
<build_depend>libqt5-gui</build_depend>
<build_depend>libqt5-widgets</build_depend>
<build_depend>qt_gui</build_depend>
<exec_depend>libqt5-core</exec_depend>
<exec_depend>libqt5-gui</exec_depend>
<exec_depend>libqt5-widgets</exec_depend>
<exec_depend>qt_gui</exec_depend>
<exec_depend>map_server</exec_depend>

<export>
</export>
Expand Down
13 changes: 11 additions & 2 deletions stdr_gui/src/stdr_gui/stdr_gui_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,12 @@ namespace stdr_gui
this, SLOT(robotReplaceSet(QPoint,std::string)));

timer_ = new QTimer(this);

connect(
timer_, SIGNAL(timeout()),
this, SLOT(updateMapInternal()));

timer_->start(50);

QObject::connect(
this,SIGNAL(waitForRfidPose()),
Expand Down Expand Up @@ -315,6 +318,7 @@ namespace stdr_gui
this, SIGNAL(setSoundSensorVisibility(QString,QString,char)),
&info_connector_, SLOT(setSoundSensorVisibility(QString,QString,char)));
}


/**
@brief Sets up the main window widgets
Expand Down Expand Up @@ -513,17 +517,18 @@ namespace stdr_gui

elapsed_time_.start();

map_initialized_ = true;
// map_initialized_ = true;
map_connector_.setMapInitialized(true);
gui_connector_.setMapInitialized(true);

timer_->start(50);
// timer_->start(50);

robot_subscriber_ = n_.subscribe(
"stdr_server/active_robots",
1,
&CGuiController::receiveRobots,
this);
map_initialized_ = true;
}

/**
Expand Down Expand Up @@ -1005,6 +1010,10 @@ namespace stdr_gui
**/
void CGuiController::updateMapInternal(void)
{
if ( ! map_initialized_ )
{
return;
}
while(map_lock_)
{
usleep(100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1662,8 +1662,7 @@ namespace stdr_gui
QApplication::translate(
"Footprint point",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_footprint_point_ = item;

Expand Down Expand Up @@ -1720,8 +1719,7 @@ namespace stdr_gui
QApplication::translate(
"LaserProperties",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_laser_ = item;

Expand Down Expand Up @@ -2242,8 +2240,7 @@ namespace stdr_gui
QApplication::translate(
"SonarProperties",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_sonar_ = item;

Expand Down Expand Up @@ -2287,8 +2284,7 @@ namespace stdr_gui
QApplication::translate(
"RfidAntennaProperties",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_rfid_ = item;

Expand Down Expand Up @@ -2330,8 +2326,7 @@ namespace stdr_gui
QApplication::translate(
"CO2SensorProperties",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_co2_sensor_ = item;

Expand Down Expand Up @@ -2370,8 +2365,7 @@ namespace stdr_gui
QApplication::translate(
"ThermalSensorProperties",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_thermal_sensor_ = item;

Expand Down Expand Up @@ -2410,8 +2404,7 @@ namespace stdr_gui
QApplication::translate(
"SoundSensorProperties",
item->text(0).toStdString().c_str(),
0,
QApplication::UnicodeUTF8));
0));

current_sound_sensor_ = item;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</robot>

<robot_specifications>
<allowed>initial_pose,footprint,laser,sonar,rfid_reader,kinematic</allowed>
<allowed>initial_pose,footprint,laser,sonar,rfid_reader,kinematic,co2_sensor</allowed>
</robot_specifications>

<initial_pose>
Expand Down