UT code is compiled into the build folder (RoboCup3D)

University of Texas at Austin Code: Code File
According to many methods on the Internet, it is directly
**cmake .**
**make**
The following content will appear:
picture.png
However, this is a bit messy. All the compiled Makefiles and other data files will be stored under utaustinvilla3d-master, which is quite messy. According to our compilation habits, I created a separate buid folder, and then compiled it under the build folder:
**cmake ..**
**make**
The following content appears:
picture.png
Run in terminal first
**rcsoccersim3d**
The stadium screen pops up, then switch to the utaustinvilla3d-master directory for execution.
**./start.sh**
Start the shell script file and find that the permissions are insufficient, as shown below:
picture.png
Then pass the command
**chmod + x start.sh**
Give the file executable permissions.
Then continue to run **./start.sh** and find a new error:
picture.png
Based on the error message, I guessed that the file path was wrong (most tutorials on the Internet are compiled directly under utaustinvilla3d-master, so I guessed that the file system generated by compilation was not found, so the script file started abnormally), so I checked the script file:

#!/bin/bash
#
# UT Austin Villa start script for 3D Simulation Competitions
#


AGENT_BINARY=agentspark
#BINARY_DIR="."
BINARY_DIR="build"
LIBS_DIR="./libs"
NUM_PLAYERS=11

team="UTAustinVilla_Base"
host="localhost"
port=3100
paramsfile=paramfiles/defaultParams.txt
mhost="localhost"


export LD_LIBRARY_PATH=$LIBS_DIR:$LD_LIBRARY_PATH


usage()
{<!-- -->
  (echo "Usage: $0 [options]"
   echo "Available options:"
   echo " --help prints this"
   echo "HOST specifies server host (default: localhost)"
   echo " -p, --port PORT specifies server port (default: 3100)"
   echo " -t, --team TEAMNAME specifies team name"
   echo " -mh, --mhost HOST IP of the monitor for sending draw commands (default: localhost)"
   echo " -pf, --paramsfile FILENAME name of a parameters file to be loaded (default: paramfiles/defaultParams.txt)") 1> & amp;2
}


fParsedHost=false
paramsfile_args="--paramsfile ${paramsfile}"

while [ $# -gt 0 ]
do
  case $1 in

    --help)
      usage
      exit 0
      ;;

    -mh|--mhost)
      if [ $# -lt 2 ]; then
        usage
        exit 1
      fi
      mhost="${2}"
      shift 1
      ;;

    -p|--port)
      if [ $# -lt 2 ]; then
        usage
        exit 1
      fi
      port="${2}"
      shift 1
      ;;

    -t|--team)
      if [ $# -lt 2 ]; then
        usage
        exit 1
      fi
      team="${2}"
      shift 1
      ;;

    -pf|--paramsfile)
      if [ $# -lt 2 ]; then
        usage
        exit 1
      fi
      DIR_PARAMS="$( cd "$( dirname "$2" )" & amp; & amp; pwd )"
      PARAMS_FILE=$DIR_PARAMS/$(basename $2)
      paramsfile_args="${paramsfile_args} --paramsfile ${PARAMS_FILE}"
      shift 1
      ;;
    *)
      if $fParsedHost;
      then
        echo 1> &2
        echo "invalid option "${1}"." 1> & amp;2
        echo 1> &2
        usage
        exit 1
      else
        host="${1}"
fParsedHost=true
      fi
      ;;
  esac

  shift 1
done

opt="${opt} --host=${host} --port ${port} --team ${team} ${paramsfile_args} --mhost=${mhost}"

DIR="$( cd "$( dirname "$0" )" & amp; & amp; pwd )"
cd $DIR

for ((i=1;i<=$NUM_PLAYERS;i + + )); do
    case $i in
1|2)
echo "Running agent No. $i -- Type 0"
"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 0 --paramsfile paramfiles/defaultParams_t0.txt & amp;#> /dev/null & amp;
#"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 0 --paramsfile paramfiles/defaultParams_t0.txt > stdout$i 2> stderr$i & amp;
;;
3|4)
echo "Running agent No. $i -- Type 1"
"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 1 --paramsfile paramfiles/defaultParams_t1.txt & amp;#> /dev/null & amp;
#"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 1 --paramsfile paramfiles/defaultParams_t1.txt > stdout$i 2> stderr$i & amp;
;;
5|6)
echo "Running agent No. $i -- Type 2"
"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 2 --paramsfile paramfiles/defaultParams_t2.txt & amp;#> /dev/null & amp;
#"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 2 --paramsfile paramfiles/defaultParams_t2.txt > stdout$i 2> stderr$i & amp;
;;
7|8)
echo "Running agent No. $i -- Type 3"
"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 3 --paramsfile paramfiles/defaultParams_t3.txt & amp;#> /dev/null & amp;
#"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 3 --paramsfile paramfiles/defaultParams_t3.txt > stdout$i 2> stderr$i & amp;
;;
*)
echo "Running agent No. $i -- Type 4"
"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 4 --paramsfile paramfiles/defaultParams_t4.txt & amp;#> /dev/null & amp;
#"$BINARY_DIR/$AGENT_BINARY" $opt --unum $i --type 4 --paramsfile paramfiles/defaultParams_t4.txt > stdout$i 2> stderr$i & amp;
;;
\t
    esac
    sleep 1
done

I found these lines according to the number of lines prompted by the terminal information (111, 116, 121, 126, 131), and found that they are all corresponding to the ones used to control the robot (respectively 12, 34, 56, 78, and the rest are all), \ ”

B

I

N

A

R

Y

D

I

R

/

BINARY_DIR/

BINARYD?IR/AGENT_BINARY” is the path. I saw **BINARY_DIR='.'** on line 8, which means to search in the current directory. Just change the path to build. .
Later, I also found the compilation according to the commonly used compilation path on the Internet (the file is shown in the first picture of this article), and found that this path corresponds to the agentspark file generated by compilation. Therefore the changes are reasonable.