Skip to content

Commit

Permalink
Merge branch 'misc_devel' into route_devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Gloudemans committed Feb 7, 2019
2 parents d64f504 + 457e0e8 commit 5055e93
Show file tree
Hide file tree
Showing 9 changed files with 908 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drive_system/scripts/drive_motor_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DriveController:

# Constructor
def __init__(self):

# Initialize publishers
self.speeds_pub = rospy.Publisher('drive_motor_speeds', UInt8, queue_size=1)

Expand Down
2 changes: 2 additions & 0 deletions high_level_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
geometry_msgs
sensor_msgs
)

## System dependencies are found with CMake's conventions
Expand Down
2 changes: 2 additions & 0 deletions high_level_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
<depend>roscpp</depend>
<depend>rospy</depend>
<depend>std_msgs</depend>
<depend>sensor_msgs</depend>
<depend>geometry_msgs</depend>

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

# ----------------------------------------------- #
# Table of index number of /joy.buttons:
# Index Button name on the actual controller
#
# 0 A
# 1 B
# 2 X
# 3 Y
# 4 LB
# 5 RB
# 6 back
# 7 start
# 8 power
# 9 Button stick left
# 10 Button stick right

# Table of index number of /joy.axes:
# Index Axis name on the actual controller
#
# 0 Moving left joystick left (+) and right (-) changes rotational velocity
# 1 Moving left joystick up (+) and down (-) changes linear velocity
# 2 LT
# 3 Left/Right Axis stick right
# 4 Up/Down Axis stick right
# 5 RT
# 6 cross key left/right
# 7 cross key up/down
# ----------------------------------------------- #

# import required packages
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy

class TeleopControl:

# Constructor
def __init__(self):

# Initialize publishers
self.drive_pub = rospy.Publisher('drive_cmd', Twist)
# other publishers will be added when necessary

# Initialize subscribers
self.joy_sub = rospy.Subscriber("joy", Joy, self.joy_callback)


# Callback function for joystick controls
def joy_callback(self, data):
self.set_drive_speed(data)
self.set_digging_mode(data)

# Sets drive speed based on left joystick input
def set_drive_speed(self, data):
twist = Twist()
twist.linear.x = data.axes[1]
twist.angular.z = data.axes[0]
self.drive_pub.publish(twist)

# Sets digging mode based on ???? (TBD)
def set_digging_mode(self, data):
pass

# additional functions TBD


if __name__ == '__main__':

# Initialize as ROS node
rospy.init_node('teleop_control')

# Create a TeleopControl object
control = TeleopControl()

# Ready to go
rospy.loginfo("Teleop Control initialized...")

# Loop continuously
while not rospy.is_shutdown():
pass
68 changes: 68 additions & 0 deletions mission_control/resources/css/cc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
body {
margin: 0px;
}

table {
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #f0f0f0;
text-align: left;
padding: 8px;
font-size: 14px;
}

td:nth-child(1) {
width: 150px;
}

tr:nth-child(even) {
background-color: #f0f0f0;
}

#left_region {
float: left;
width: auto;
max-width: 40%;
margin-right: 30px;
}

#middle_region {
float: left;
width: 45%;
margin-right: 30px;
}

#middle_region_left {
float: left;
width: 48%;
margin-right: 4%;
}

#middle_region_right {
float: left;
width: 48%;
}

#right_region {
float: left;
width: 15%;
}

#body_content {
margin-left: auto;
margin-right: auto;
width: 90%;
}

#header_bar {
background-color: #000000b7;
height: 50px;
margin-bottom: 20px;
}

#state_image {
max-height: 800px;
}
Loading

0 comments on commit 5055e93

Please sign in to comment.