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

Oms 4 usb reset debugging #15

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
51 changes: 11 additions & 40 deletions qt-gui.workspace.user
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.2.1, 2018-08-28T22:56:34. -->
<!-- Written by QtCreator 4.2.1, 2019-03-16T12:32:05. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{87d6e2af-d768-4e25-a852-033ba8fb5a4a}</value>
<value type="QByteArray">{1cdd7bd7-53f1-43dd-8e81-2dd8afa72b84}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
Expand All @@ -19,7 +19,7 @@
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
<value type="QByteArray" key="CurrentPreferences">ROSProject.CppCodeStyle</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
Expand Down Expand Up @@ -54,33 +54,21 @@
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangStaticAnalyzer.SuppressedDiagnostics"/>
</valuemap>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{f4cc9e8d-34cc-4663-9466-ea6b16c693b9}</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{53a1a275-3cec-4649-8add-1b460e25bc60}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">CatkinMake Step</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSCatkinMakeStep</value>
<value type="QString" key="ROSProjectManager.ROSCatkinMakeStep.CMakeArguments"></value>
<value type="QString" key="ROSProjectManager.ROSCatkinMakeStep.CatkinMakeArguments"></value>
<value type="QString" key="ROSProjectManager.ROSCatkinMakeStep.MakeArguments"></value>
<value type="int" key="ROSProjectManager.ROSCatkinMakeStep.Target">0</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
Expand All @@ -93,28 +81,11 @@
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges">
<value type="QString">CMAKE_PREFIX_PATH=/home/ros/owr-qtgui/devel:/home/ros/owr_software/rover/devel:/home/ros/ros_deps/devel:/opt/ros/kinetic</value>
<value type="QString">LD_LIBRARY_PATH=/home/ros/owr-qtgui/devel/lib:/home/ros/owr_software/rover/devel/lib:/home/ros/ros_deps/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x86_64-linux-gnu:/opt/qt57/lib/x86_64-linux-gnu:/opt/qt57/lib</value>
<value type="QString">PATH=/opt/ros/kinetic/bin:/opt/qt57/bin:/home/ros/bin:/home/ros/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin</value>
<value type="QString">PKG_CONFIG_PATH=/home/ros/owr-qtgui/devel/lib/pkgconfig:/home/ros/owr_software/rover/devel/lib/pkgconfig:/home/ros/ros_deps/devel/lib/pkgconfig:/opt/ros/kinetic/lib/pkgconfig:/opt/ros/kinetic/lib/x86_64-linux-gnu/pkgconfig:/opt/qt57/lib/pkgconfig</value>
<value type="QString">PWD=/home/ros/owr-qtgui</value>
<value type="QString">PYTHONPATH=/home/ros/owr-qtgui/devel/lib/python2.7/dist-packages:/home/ros/owr_software/rover/devel/lib/python2.7/dist-packages:/home/ros/ros_deps/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages</value>
<value type="QString">ROSLISP_PACKAGE_DIRECTORIES=/home/ros/owr-qtgui/devel/share/common-lisp:/home/ros/owr_software/rover/devel/share/common-lisp:/home/ros/ros_deps/devel/share/common-lisp</value>
<value type="QString">ROS_DISTRO=kinetic</value>
<value type="QString">ROS_ETC_DIR=/opt/ros/kinetic/etc/ros</value>
<value type="QString">ROS_MASTER_URI=http://localhost:11311</value>
<value type="QString">ROS_PACKAGE_PATH=/home/ros/owr-qtgui/src:/home/ros/owr_software/rover/src:/home/ros/ros_deps/src:/opt/ros/kinetic/share</value>
<value type="QString">ROS_ROOT=/opt/ros/kinetic/share/ros</value>
<value type="QString">ROS_VERSION=1</value>
<value type="QString">SHLVL=3</value>
<value type="QString">TERM=xterm</value>
<value type="QString">_=/usr/bin/env</value>
</valuelist>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSBuildConfiguration</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">0</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">61797536</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.CMakeBuildType">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
Expand All @@ -137,7 +108,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSBuildConfiguration</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">48753808</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">61797536</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.CMakeBuildType">1</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
Expand All @@ -160,7 +131,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSBuildConfiguration</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">48753808</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">61797536</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.CMakeBuildType">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
Expand All @@ -183,7 +154,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSBuildConfiguration</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">48753808</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.BuildSystem">61797536</value>
<value type="int" key="ROSProjectManager.ROSBuildConfiguration.CMakeBuildType">3</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ project(gui)
##############################################################################

# qt_build provides the qt cmake glue, roscpp the comms for a default talker
find_package(catkin REQUIRED COMPONENTS qt_build roscpp sensor_msgs image_transport ros_video_components owr_messages)
find_package(catkin REQUIRED COMPONENTS qt_build roscpp sensor_msgs image_transport ros_video_components owr_messages usb_reset)
set(QML_IMPORT_PATH "${QML_IMPORT_PATH};${CATKIN_GLOBAL_LIB_DESTINATION}" )
set(QML_IMPORT_PATH2 "${QML_IMPORT_PATH};${CATKIN_GLOBAL_LIB_DESTINATION}" )
include_directories(${catkin_INCLUDE_DIRS})
Expand Down
48 changes: 48 additions & 0 deletions src/gui/resources/main_window.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick 2.5
import QtQuick.Window 2.2
import bluesat.owr 1.0
import QtQuick.Controls 1.4



Expand Down Expand Up @@ -73,6 +74,7 @@ Window {

Item {
id: signal_strength_container
width: 173
z: 4
anchors.right: parent.right
anchors.rightMargin: 0
Expand Down Expand Up @@ -233,4 +235,50 @@ Window {
height: 80

}



Item {
id: usb_reset_container
z: 5
anchors.right: parent.right
anchors.rightMargin: 0
anchors.top: parent.top
anchors.topMargin: 80
anchors.left: parent.right
anchors.leftMargin: -700
anchors.bottom: parent.top
anchors.bottomMargin: -300
ROSUsbReset {
signal recieved(int upd)
// @disable-check M16
objectName: "usb_reset"
id: usb_reset
// @disable-check M16`
anchors.bottom: parent.bottom
// @disable-check M16
anchors.bottomMargin: 0
// @disable-check M16
anchors.top: parent.top
// @disable-check M16
anchors.left: parent.left
// @disable-check M16
anchors.right: parent.right
// @disable-check M16
topic: qsTr("/rover/usb")
ListView {
model: myModel
id: list
width: 500
height: 1000
spacing: 10
delegate: Button {text: "Reset"
onClicked: {
usb_reset.publish(index)
}
}
}
}

}
}
6 changes: 6 additions & 0 deletions src/gui/src/main_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "ros_video_components/ros_joystick_listener.hpp"
#include "ros_video_components/ros_drive_mode.hpp"
#include "gui/main_application.hpp"
#include "usb_reset/ros_usb_reset.hpp"

Main_Application::Main_Application() {}

Expand All @@ -19,6 +20,7 @@ void Main_Application::run() {
qmlRegisterType<ROSTimer>("bluesat.owr", 1, 0, "ROSTimer");
qmlRegisterType<Ros_Joystick_Listener>("bluesat.owr", 1, 0, "ROSJoystickListener");
qmlRegisterType<Ros_Drive_Mode>("bluesat.owr", 1, 0, "ROSDriveMode");
qmlRegisterType<ROS_Usb_Reset>("bluesat.owr", 1, 0, "ROSUsbReset");

// this loads the qml file we are about to create
this->load(QUrl(QStringLiteral("qrc:/main_window.qml")));
Expand Down Expand Up @@ -48,6 +50,10 @@ void Main_Application::run() {
Ros_Drive_Mode * drive_mode = this->rootObjects()[0]->findChild<Ros_Drive_Mode*>(QString("drive_mode"));
drive_mode->setup(&nh);

//this->rootContext passes the root context of main_window.qml
ROS_Usb_Reset * usb_reset = this->rootObjects()[0]->findChild<ROS_Usb_Reset*>(QString("usb_reset"));
usb_reset->setup(&nh, this->rootContext());

// setup the timer
ROSTimer * stopwatch = this->rootObjects()[0]->findChild<ROSTimer *>(QString("timerDisplay"));
// the following code section is for debugging
Expand Down
26 changes: 13 additions & 13 deletions src/ros_video_components/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>qt_build</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>libqt4-dev</build_depend>
<build_depend>owr_messages</build_depend>

<run_depend>qt_build</run_depend>
<run_depend>image_transport</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>libqt4-dev</run_depend>
<run_depend>owr_messages</run_depend>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>qt_build</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>libqt4-dev</build_depend>
<build_depend>owr_messages</build_depend>

<run_depend>qt_build</run_depend>
<run_depend>image_transport</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>libqt4-dev</run_depend>
<run_depend>owr_messages</run_depend>

ecl1ipse marked this conversation as resolved.
Show resolved Hide resolved
<!-- The export tag contains other, unspecified, tags -->
<export>
Expand Down
55 changes: 55 additions & 0 deletions src/usb_reset/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
##############################################################################
# CMake
##############################################################################

cmake_minimum_required(VERSION 2.8.3)
project(usb_reset)

##############################################################################
# Catkin
##############################################################################

# qt_build provides the qt cmake glue, roscpp the comms for a default talker
find_package(catkin REQUIRED COMPONENTS qt_build roscpp sensor_msgs image_transport owr_messages) #sensor_msgs image_transport)

include_directories(include ${catkin_INCLUDE_DIRS})
# Use this to define what the package will export (e.g. libs, headers).
# Since the default here is to produce only a binary, we don't worry about
# exporting anything.
catkin_package(
CATKIN_DEPENDS qt_build roscpp owr_messages std_msgs #sensor_msgs image_transport
INCLUDE_DIRS include
LIBRARIES UsbReset
)

##############################################################################
# Qt Environment
##############################################################################

# this comes from qt_build's qt-ros.cmake which is automatically
# included via the dependency ca ll in package.xml
find_package(Qt5 COMPONENTS Core Qml Widgets Quick REQUIRED)

##############################################################################
# Sections
##############################################################################

file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc)
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/usb_reset/*.hpp)

QT5_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
QT5_WRAP_CPP(QT_MOC_HPP ${QT_MOC})

##############################################################################
# Sources
##############################################################################

file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp)

##############################################################################
# Binaries
##############################################################################
add_library(UsbReset ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})
qt5_use_modules(UsbReset Quick Core Widgets)
target_link_libraries(UsbReset ${QT_LIBRARIES} ${catkin_LIBRARIES})
target_include_directories(UsbReset PUBLIC include)
22 changes: 22 additions & 0 deletions src/usb_reset/include/usb_reset/owr_ros_components.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Date Started: 25/07/16
* Original Author: Harry J.E Day
ecl1ipse marked this conversation as resolved.
Show resolved Hide resolved
* Editors:
* Purpose: C++ code representation of the QML package
* This code is released under the MIT License. Copyright BLUEsat UNSW, 2017
*/
#ifndef OWR_ROS_COMPONENTS_H
#define OWR_ROS_COMPONENTS_H

#include <QQmlExtensionPlugin>


class OWR_ROS_Components : public QQmlExtensionPlugin {
ecl1ipse marked this conversation as resolved.
Show resolved Hide resolved
Q_OBJECT
Q_PLUGIN_METADATA(IID "bluesat.owr")

public:
void registerTypes(const char * url);
};

#endif // OWR_ROS_COMPONENTS_H
Loading