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
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
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-04-06T16:20:47. -->
<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
4 changes: 2 additions & 2 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ 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})
include_directories(${catkin_INCLUDE_DIRS}; usb_reset)
# 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.
Expand Down
2 changes: 2 additions & 0 deletions src/gui/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<build_depend>sensor_msgs</build_depend>
<build_depend>libqt4-dev</build_depend>
<build_depend>ros_video_components</build_depend>
<build_depend>usb_reset</build_depend>
<run_depend>usb_reset</run_depend>
<run_depend>ros_video_components</run_depend>
<run_depend>qt_build</run_depend>
<run_depend>image_transport</run_depend>
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: usbDevices
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/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
12 changes: 12 additions & 0 deletions src/owr_messages/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,19 @@ find_package(catkin REQUIRED COMPONENTS
add_message_files(
FILES
activeCameras.msg
camera_angle.msg
motor.msg
status.msg
stream.msg
position.msg
voltage.msg
ultrasonic.msg
heading.msg
pwm.msg
board.msg
adc.msg
stop.msg
devices.msg
)

## Generate services in the 'srv' folder
Expand Down
3 changes: 3 additions & 0 deletions src/owr_messages/msg/adc.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Header header
float32[] pot
string[] potFrame
2 changes: 2 additions & 0 deletions src/owr_messages/msg/board.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pwm[] joints
Header header
3 changes: 3 additions & 0 deletions src/owr_messages/msg/camera_angle.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
geometry_msgs/Vector3 angle
int32 feed_number

1 change: 1 addition & 0 deletions src/owr_messages/msg/devices.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
string[] devices
1 change: 1 addition & 0 deletions src/owr_messages/msg/heading.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
float64 heading
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Vector3 angle
Int32 feed_number
float64 angle
int32 motor_number

35 changes: 35 additions & 0 deletions src/owr_messages/msg/position.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Message that reports the position, and orientation of the robot
# Location specified using the WGS 84 reference ellipsoid

#Based on the NavSatFix message here: http://docs.ros.org/api/sensor_msgs/html/msg/NavSatFix.html


# Latitude [degrees]. Positive is north of equator; negative is south.
float64 latitude

# Longitude [degrees]. Positive is east of prime meridian; negative is west.
float64 longitude


# Altitude [m]. Positive is above the WGS 84 ellipsoid
# (quiet NaN if no altitude is available).
float64 altitude

#The orientation of the front of the rover
#relative to grid North on the WGS 84 datum
#where 0 deg is Grid North
float64 orientation

#The pitch of the robot (facing forward), in degrees.
#0 being level to the horizon, and positive being facing above the horizon (nose up)
#rotation is around the centre of the robot
float64 pitch

#The roll of the robot (forward facing)
#0 deg is level with the horizon, Positive is left up
float64 roll

#The heading relative to the grid north. (WGS 84)
float64 heading


6 changes: 6 additions & 0 deletions src/owr_messages/msg/pwm.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
string joint
int32 pwm
float64 targetVel
float64 currentVel
float64 currentPos
float64 targetPos
2 changes: 2 additions & 0 deletions src/owr_messages/msg/status.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
float32 battery
float32 signal
2 changes: 2 additions & 0 deletions src/owr_messages/msg/stop.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bool stopP
bool stopN
1 change: 1 addition & 0 deletions src/owr_messages/msg/ultrasonic.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
int64[] pulseTime #pulse in microseconds (uS)
1 change: 1 addition & 0 deletions src/owr_messages/msg/voltage.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
float32 voltage
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
Loading