Skip to content

Commit

Permalink
phil merge 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantine Mushegian committed Jun 1, 2015
1 parent 491dc32 commit afd04ac
Show file tree
Hide file tree
Showing 882 changed files with 7,766 additions and 5,606 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -22,3 +22,6 @@ util/scripts/nao_files
util/scripts/wireless_config/wpa_supplicant.conf
src/serenity/cache.txt
.DS_Store
src/nbtool/bin/*
.project
.classpath
13 changes: 10 additions & 3 deletions data/logs/sync
Expand Up @@ -9,8 +9,8 @@ UP_OR_DOWN=$1
REMOTE_FOLDER=${2%/} #Strip the trailing slash if any

RSYNC=rsync
RSYNC_OPTS="-rvuza --chmod=ug+rw"

# Commented out section only supported in rsync 3.1.*
RSYNC_OPTS="-rvuza --chmod=ug+rws" # --chown=*:robocupgrp"

if [ "$1" = "" ]; then
echo "No push direction specified"
Expand All @@ -27,18 +27,25 @@ fi
echo "Type username for RoboCup server, followed by [ENTER]"
read username

SERVER=$username@robocup.bowdoin.edu
SERVER=$username@dover
ROBOCUP_DIR=/mnt/research/robocup
FRAMES_DIR=logs

SYNC_UP="$RSYNC $RSYNC_OPTS ./$REMOTE_FOLDER/ $SERVER:$ROBOCUP_DIR/$FRAMES_DIR/$REMOTE_FOLDER/"
SYNC_DOWN="$RSYNC $RSYNC_OPTS $SERVER:$ROBOCUP_DIR/$FRAMES_DIR/$REMOTE_FOLDER/ ./$REMOTE_FOLDER/"
DIFF="$RSYNC $RSYNC_OPTS -n $SERVER:$ROBOCUP_DIR/$FRAMES_DIR/$REMOTE_FOLDER/ ./$REMOTE_FOLDER/"

# Ensure that group is correctly set on the server.
# Once everyone is running 14.04 we can do this directly in rsync
CHOWN="chown -R :robocupgrp $ROBOCUP_DIR/$FRAMES_DIR/$REMOTE_FOLDER/"
RUN_CHOWN="ssh $SERVER sh -c '( ( $CHOWN ) )'"

if [ "$UP_OR_DOWN" = "up" ]; then

echo $SYNC_UP
$SYNC_UP
echo $RUN_CHOWN
$RUN_CHOWN

elif [ "$UP_OR_DOWN" = "down" ]; then

Expand Down
2 changes: 1 addition & 1 deletion data/tables/sync
Expand Up @@ -19,7 +19,7 @@ fi
echo "Type username for RoboCup server, followed by [ENTER]"
read username

SERVER=$username@robocup.bowdoin.edu
SERVER=$username@dover
ROBOCUP_DIR=mnt/research/robocup
TABLES_DIR=tables
DEST=.
Expand Down
2 changes: 1 addition & 1 deletion src/man/.gitmodules
@@ -1,3 +1,3 @@
[submodule "tables"]
path = tables
url = robocup@robocup.bowdoin.edu:git/tables.git
url = robocup@dover:git/tables.git
4 changes: 4 additions & 0 deletions src/man/CMakeLists.txt
Expand Up @@ -64,6 +64,10 @@ include_directories( SYSTEM ${PROTOBUF_INCLUDE_DIR} )
find_package( PythonLibs REQUIRED)
include_directories( ${PYTHON_INCLUDE_DIR} )

set(Boost_NO_BOOST_CMAKE true)
find_package(Boost COMPONENTS python REQUIRED)
include_directories( ${Boost_INCLUDE_DIR} )

# Our core includes come from here
include_directories( ${SHARE_DIR}/include )

Expand Down
2 changes: 2 additions & 0 deletions src/man/Man.cpp
Expand Up @@ -197,6 +197,8 @@ namespace man {
That being said, should probably not init (i.e. start threads)
if not necessary.
*/


#ifdef NAOQI_2
nblog::HOST_TYPE = nblog::V5ROBOT;
#else
Expand Down
3 changes: 0 additions & 3 deletions src/man/behaviors/CMakeLists.txt
@@ -1,8 +1,5 @@
# required libraries for python

set(Boost_NO_BOOST_CMAKE true)
find_package(Boost COMPONENTS python REQUIRED)

find_package( PythonLibs REQUIRED )
include_directories( ${PYTHON_INCLUDE_DIR} )

Expand Down
2 changes: 1 addition & 1 deletion src/man/behaviors/GameController.py
Expand Up @@ -86,7 +86,7 @@ def run(self):
# reset field for change
self.kickOffChanged = False

if (gameState.kick_off_team == self.teamColor):
if (gameState.kick_off_team == gameState.team(teamIndex).team_number):
# It is currently our kick off
if not self.ownKickOff:
self.kickOffChanged = True
Expand Down
8 changes: 8 additions & 0 deletions src/man/behaviors/PyConstants.cpp
Expand Up @@ -5,6 +5,8 @@

#include <boost/python.hpp>

#include "DebugConfig.h"

using namespace boost::python;
using namespace man::behaviors;
using namespace man;
Expand All @@ -18,6 +20,12 @@ BOOST_PYTHON_MODULE(noggin_constants)
scope().attr("USE_LAB_FIELD") = false;
#endif

#ifdef NAOQI_2
scope().attr("NAOQI_2") = true;
#else
scope().attr("NAOQI_2") = false;
#endif

// Walk time
scope().attr("TIME_STEP") = TIME_STEP;
scope().attr("TIME_PER_STEP") = TIME_PER_STEP;
Expand Down
61 changes: 35 additions & 26 deletions src/man/behaviors/SweetMoves.py
Expand Up @@ -117,10 +117,10 @@ def getMoveTime(move):
.4,1, stiff.STANDUP_STIFFNESSES ),

#Feet in front
((117.3, -40.3, 62.2, -89.8),
((127.3, -40.3, 62.2, -89.8),
(-70.0, 41.3, -87.3, 11.4, -25.5, 32.9),
(0.0, -44.1, -74.4, -4.5, -25.3, -34.3),
(117.3, 41.3, -62.2, 89.8),
(127.3, 41.3, -62.2, 89.8),
.4,1, stiff.STANDUP_STIFFNESSES ),

#Sit Back
Expand All @@ -144,19 +144,23 @@ def getMoveTime(move):
0.6,1, stiff.STANDUP_STIFFNESSES),
#sitting legs spread hands behind facing forward

# makes elbow straight
((40,60,4,-28),
(-28,8,-49,126,-25,-22),
(-28,-31,-87,80,52,0),
(120,-33,-4,4),
(120,-33,-4,0.4),
.6,1, stiff.STANDUP_STIFFNESSES),
# turns to right a little and stands with one arm on ground
# turns to right a little and stands with
# one arm on ground

((42,28,5,-47),
(-49,-16,27,101,-70,-5),
(-49,-32,-110,61,39,-7),
(91,-20,-4,0),
0.8,1, stiff.STANDUP_STIFFNESSES),
# gets hips up and over knees


((42,28,5,-47),
(-49,-16,22,101,-70,-5),
(-49,-32,-89,61,39,-7),
(101,-15,-4,3),
0.6,1, stiff.STANDUP_STIFFNESSES),
#gets hips up and over knees

((59.76,29.35,4.39,-45.79),
(-30.23,-10.19,-35.86,122.78,-67.68,8.44),
Expand All @@ -166,18 +170,19 @@ def getMoveTime(move):
#pulls right leg in a little

((77.5, 28.9, 5.6, -40.7),
(-30.1, 0.6, -28.2, 123.4, -69.9, 3.2),
(0.0, -15.5, -55.8, 123.7, -43.5, 7.2),
(-30.1, -2.2, -32.6, 123.5, -69.4, 3.1),
(-30.1, -14.2, -61.5, 123.2, -42.8, 8.6),
(88.1, -22.6, -1.0, 23.0),
0.6,1, stiff.STANDUP_STIFFNESSES),
#pulls both legs in, squat
0.6, 1, stiff.STANDUP_STIFFNESSES),
# pulls both legs in, squat

#stands up
(INITIAL_POS[0][0],
INITIAL_POS[0][1],
INITIAL_POS[0][2],
INITIAL_POS[0][3],
1,0, stiff.STANDUP_STIFFNESSES) )
1,0, stiff.STANDUP_STIFFNESSES)
)

# new robots
STAND_UP_BACK = (
Expand Down Expand Up @@ -300,24 +305,27 @@ def getMoveTime(move):

((42,28,5,-47),
(-49,-16,27,101,-70,-5),
(-49,-32,-89,61,39,-7),
(-44.0, -32.9, -91.9, 88.7, 21.7, -3.5),
(101,-15,-4,3),
0.6,1, stiff.STANDUP_STIFFNESSES),
#gets hips up and over knees


((59.76,29.35,4.39,-45.79),
(-30.23,-10.19,-45.86,122.78,-67.68,8.44),
(-30.23,-10.19,-45.86,122.78,-67.68,8.44),
(-30.23,-26.72,-70.78,54.41,34.99,19.69),
(54.85,-45.62,-0.27,24.35),
0.4,1, stiff.STANDUP_STIFFNESSES),
0.4,1, stiff.STANDUP_STIFFNESSES),
#pulls right leg in a little



((77.5, 28.9, 5.6, -40.7),
(-30.1, 0.6, -28.2, 123.4, -69.9, 3.2),
(0.0, -15.5, -55.8, 123.7, -43.5, 7.2),
(-30.1, -2.2, -32.6, 123.5, -69.4, 3.1),
(-30.1, -14.2, -61.5, 123.2, -42.8, 8.6),
(88.1, -22.6, -1.0, 23.0),
0.6,1, stiff.STANDUP_STIFFNESSES),
#pulls both legs in, squat
1.5, 1, stiff.STANDUP_STIFFNESSES),
# pulls both legs in, squat

# ((42,28,5,-47),
# (-49,-16,0,101,-70,-5),
Expand Down Expand Up @@ -345,7 +353,7 @@ def getMoveTime(move):
INITIAL_POS[0][1],
INITIAL_POS[0][2],
INITIAL_POS[0][3],
1,0, stiff.STANDUP_STIFFNESSES)
2,0, stiff.STANDUP_STIFFNESSES)
)

REVERSE_STAND_UP_BACK = mirrorMove(STAND_UP_BACK)
Expand Down Expand Up @@ -1117,7 +1125,8 @@ def LEFT_D_KICK(y,dist):
.14,0, stiff.NORMAL_STIFFNESSES),

# Recover
((80.,30.,-50.,-70.),
# ((80.,30.,-50.,-70.),
((90.,10.,-90.,-10.),
(0.,25.,-27.,43.5,-21.2,-20.),
(0.,15,-27,45.,-22.5,-18.),
(80.,-30.,50.,74.),
Expand All @@ -1127,7 +1136,7 @@ def LEFT_D_KICK(y,dist):
(0.0,0.0,-22.3,43.5,-21.2, 0.0),
(0.0,0.0,-22.3,43.5,-21.2, 0.0),
(90.,-10.,82.,13.2),
.7,0,stiff.NORMAL_STIFFNESSES),
.7,0,stiff.NORMAL_STIFFNESSES)
)

RIGHT_STRAIGHT_KICK = mirrorMove(LEFT_STRAIGHT_KICK)
Expand Down Expand Up @@ -1461,4 +1470,4 @@ def LEFT_D_KICK(y,dist):
1,0,stiff.NORMAL_STIFFNESSES),
)

ZELLVARRO_RIGHT_KICK = mirrorMove(ZELLVARRO_LEFT_KICK)
ZELLVARRO_RIGHT_KICK = mirrorMove(ZELLVARRO_LEFT_KICK)
32 changes: 18 additions & 14 deletions src/man/behaviors/kickDecider/KickDecider.py
Expand Up @@ -36,10 +36,10 @@ def sweetMovesOrbit(self):
self.brain.player.motionKick = False

self.kicks = []
self.kicks.append(kicks.LEFT_KICK)
self.kicks.append(kicks.RIGHT_KICK)
self.kicks.append(kicks.LEFT_SIDE_KICK)
self.kicks.append(kicks.RIGHT_SIDE_KICK)
self.kicks.append(kicks.LEFT_STRAIGHT_KICK)
self.kicks.append(kicks.RIGHT_STRAIGHT_KICK)
# self.kicks.append(kicks.LEFT_SIDE_KICK)
# self.kicks.append(kicks.RIGHT_SIDE_KICK)

self.scoreKick = self.minimizeOrbitTime

Expand All @@ -54,8 +54,8 @@ def frontKickCrosses(self):
self.brain.player.motionKick = False

self.kicks = []
self.kicks.append(kicks.LEFT_KICK)
self.kicks.append(kicks.RIGHT_KICK)
self.kicks.append(kicks.M_LEFT_STRAIGHT)
self.kicks.append(kicks.M_RIGHT_STRAIGHT)

self.scoreKick = self.minimizeOrbitTime

Expand Down Expand Up @@ -89,8 +89,8 @@ def frontKicksOrbitIfSmall(self):
self.brain.player.motionKick = False

self.kicks = []
self.kicks.append(kicks.LEFT_KICK)
self.kicks.append(kicks.RIGHT_KICK)
self.kicks.append(kicks.LEFT_SHORT_STRAIGHT_KICK)
self.kicks.append(kicks.RIGHT_SHORT_STRAIGHT_KICK)

self.scoreKick = self.minimizeOrbitTime

Expand Down Expand Up @@ -272,8 +272,8 @@ def kicksBeforeBallIsFree(self):

def allKicksAsap(self):
self.kicks = []
self.kicks.append(kicks.LEFT_KICK)
self.kicks.append(kicks.RIGHT_KICK)
self.kicks.append(kicks.LEFT_SHORT_STRAIGHT_KICK)
self.kicks.append(kicks.RIGHT_SHORT_STRAIGHT_KICK)
self.kicks.append(kicks.M_LEFT_STRAIGHT)
self.kicks.append(kicks.M_RIGHT_STRAIGHT)
self.kicks.append(kicks.M_LEFT_SIDE)
Expand Down Expand Up @@ -433,9 +433,9 @@ def allKicksIncludingBigKickAsapOnGoal(self):

### HIGH LEVEL PLANNERS ###
def attacker(self):
onGoalAsap = self.allKicksAsapOnGoal()
if onGoalAsap:
return onGoalAsap
frontKicks = self.frontKicksOrbitIfSmall()
if frontKicks:
return frontKicks

asap = self.motionKicksAsap()
if asap:
Expand All @@ -448,6 +448,10 @@ def defender(self):
if asap:
return asap

asap = self.motionKicksAsap()
if asap:
return asap

return self.frontKickCrosses()

def obstacleAware(self, clearing = False):
Expand Down Expand Up @@ -677,7 +681,7 @@ def upfieldEnough(self, kick):
return -40 <= kick.setupH <= 40

def isShortOrbit(self, kick):
return math.fabs(self.brain.loc.h - kick.setupH) < 30
return math.fabs(self.brain.loc.h - kick.setupH) < 50

### HELPER FUNCTIONS ###
def fromCartesianToPolarCoordinates(self, x, y):
Expand Down
14 changes: 9 additions & 5 deletions src/man/behaviors/kickDecider/kicks.py
Expand Up @@ -87,23 +87,27 @@ def __ne__(self, other):
move=SweetMoves.ZELLVARRO_LEFT_KICK)

ZELLVARRO_RIGHT_KICK = Kick("Zellvarro_Left_Kick",
x = 15.5, y = -3.95,
x = 15.5, y = -3.95,
dist = 300,
move=SweetMoves.ZELLVARRO_RIGHT_KICK)

LEFT_KICK = ZELLVARRO_LEFT_KICK
RIGHT_KICK = ZELLVARRO_RIGHT_KICK
LEFT_KICK = LEFT_SHORT_STRAIGHT_KICK
RIGHT_KICK = RIGHT_SHORT_STRAIGHT_KICK

# Motion kicks
M_LEFT_STRAIGHT = Kick("M_Left_Straight", x = 14, y = 3.6, dist = 70)
M_RIGHT_STRAIGHT = Kick("M_Right_Straight", x = 14, y = -3.6, dist = 70)
M_LEFT_STRAIGHT = Kick("M_Left_Straight", x = 12.7, y = 3.6, dist = 70)
M_RIGHT_STRAIGHT = Kick("M_Right_Straight", x = 12.7, y = -3.6, dist = 70)

M_LEFT_CHIP_SHOT = Kick("M_Left_Chip_Shot", x = 12.3, y = -.3, h = 45, dist = 70)
M_RIGHT_CHIP_SHOT = Kick("M_Right_Chip_Shot", x = 12.3, y = .3, h = -45, dist = 70)

M_LEFT_SIDE = Kick("M_Left_Side", x = 13.4, y = -2.76, h = 90, dist = 100)
M_RIGHT_SIDE = Kick("M_Right_Side", x = 13.4, y = 2.76, h = -90, dist = 100)

# Motion kicks for v5s. We need to determine a good way of dealing with this in python
#M_LEFT_SIDE = Kick("M_Left_Side", x = 13, y = -2.8, h = 90, dist = 100)
#M_RIGHT_SIDE = Kick("M_Right_Side", x = 13, y = 2.8, h = -90, dist = 100)

# Not used 04-19-13
LEFT_SHORT_SIDE_KICK = Kick("L_Short_Side", x = 15.5, y = -.5,
h = 90,
Expand Down
2 changes: 1 addition & 1 deletion src/man/behaviors/navigator/Navigator.py
Expand Up @@ -60,7 +60,7 @@ def __init__(self, brain):
self.atLocPositionTransition : NavStates.atPosition,

Transition.CountTransition(navTrans.shouldDodge,
Transition.SOME_OF_THE_TIME,
Transition.OCCASIONALLY,
Transition.LOW_PRECISION)
: NavStates.dodge

Expand Down

0 comments on commit afd04ac

Please sign in to comment.