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

Add driver_station #47

Merged
merged 6 commits into from
Mar 17, 2019
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

### macOS ###
.DS_Store

### Python Binary###
Oasixer marked this conversation as resolved.
Show resolved Hide resolved
*.pyc
9 changes: 9 additions & 0 deletions driver_station/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 2.8.3)
project(driver_station)
find_package(catkin REQUIRED)
catkin_package()
catkin_python_setup()
install(PROGRAMS scripts/driver_station
matthew-reynolds marked this conversation as resolved.
Show resolved Hide resolved
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

18 changes: 18 additions & 0 deletions driver_station/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<package format="2">
<name>driver_station</name>
<version>0.0.0</version>
<description>Driver station based on FRC Driver Station</description>

<maintainer email="[email protected]">UW React Software Team</maintainer>
Oasixer marked this conversation as resolved.
Show resolved Hide resolved

<license>BSD-3</license>

<url type="website">http://uwreact.ca</url>
<url type="repository">http://github.com/frc_control/driver_station</url>
<url type="bugtracker">http://github.com/frc_control/driver_station/issues</url>
Oasixer marked this conversation as resolved.
Show resolved Hide resolved

<buildtool_depend>catkin</buildtool_depend>
<depend>python_qt_binding</depend>

</package>
51 changes: 51 additions & 0 deletions driver_station/scripts/driver_station
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env python

##############################################################################
# Copyright (C) 2019, UW REACT
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of UW REACT, nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
##############################################################################
"""
Launch the driver station
"""

from python_qt_binding.QtWidgets import QApplication
from driver_station.window import MainWindow


def main():
"""
Main function
"""
app = QApplication([])

window = MainWindow()
window.resize(2000, 2000)
window.show()

app.exec_()


if __name__ == '__main__':
main()
13 changes: 13 additions & 0 deletions driver_station/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# yapf: disable

## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

d = generate_distutils_setup(
packages=['driver_station'],
package_dir={'': 'src'}
)

setup(**d)
Empty file.
41 changes: 41 additions & 0 deletions driver_station/src/driver_station/window.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
##############################################################################
# Copyright (C) 2019, UW REACT
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of UW REACT, nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
##############################################################################
"""
TODO(Kaelan): Module docstring
"""

from python_qt_binding.QtWidgets import QMainWindow


class MainWindow(QMainWindow):
"""
Main window for the visualizer
"""

def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowTitle("driver station (in development)")
1 change: 1 addition & 0 deletions frc_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<exec_depend>binary_state_controller</exec_depend>
<exec_depend>ternary_state_controller</exec_depend>
<exec_depend>pdp_state_controller</exec_depend>
<exec_depend>driver_station</exec_depend>

<export>
<metapackage/>
Expand Down