-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from usnistgov/release_1.2_staging
Release 1.4
- Loading branch information
Showing
22 changed files
with
455 additions
and
165 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
if [[ ! $1 ]] ; then | ||
echo "Team configuration argument not passed" | ||
exit 1 | ||
fi | ||
|
||
teamName=$(python3 get_team_name.py $1) | ||
|
||
if [[ ! $teamName ]] ; then | ||
echo "Team name not found" | ||
exit 1 | ||
fi | ||
|
||
# Start the container | ||
docker run -d --name $teamName -p 6080:80 --shm-size=512m jfernandez37/ariac:ariac_latest | ||
|
||
# Copy scripts directory and yaml file | ||
docker cp ./scripts/ $teamName:/home/ubuntu | ||
docker cp ./competitor_build_scripts/ $teamName:/home/ubuntu | ||
docker cp ./trials/ $teamName:/home/ubuntu | ||
docker cp ./$1.yaml $teamName:/home/ubuntu/scripts | ||
|
||
|
||
# Run build script | ||
docker exec -it $teamName bash -c ". /home/ubuntu/scripts/build_environment.sh $1" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Competitor Build Scripts | ||
|
||
This folder is for any custom build scripts that competitors would like to be run when the docker container is created. Any scripts must be included by name in the yaml file. These script(s) will be run before the workspace is built. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import yaml | ||
|
||
def main(): | ||
# Get yaml file name | ||
if len(sys.argv) <= 1: | ||
exit() | ||
|
||
yaml_file = sys.argv[1] + '.yaml' | ||
|
||
# Parse yaml file | ||
with open(yaml_file, "r") as stream: | ||
try: | ||
data = yaml.safe_load(stream) | ||
except yaml.YAMLError: | ||
exit() | ||
|
||
try: | ||
team_name = data["team_name"] | ||
except KeyError: | ||
exit() | ||
|
||
print(team_name) | ||
|
||
|
||
if __name__=="__main__": | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
# team configuration for automated evaluation | ||
|
||
team_name: "" | ||
team_name: "nist_competitor" | ||
|
||
github: | ||
repo_link: "" # remove https | ||
public_access_token: "" | ||
repository: "github.com/jaybrecht/nist_competitor.git" | ||
personal_access_token: "****" | ||
|
||
build: | ||
debian_packages: [] | ||
pip_packages: [] | ||
extra_build_scripts: [] | ||
|
||
competition: | ||
package_name: "" | ||
sensor_file: "" | ||
launch_file: "" | ||
package_name: "nist_competitor" | ||
launch_file: "competitor.launch.py" | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
if [[ ! $1 ]] ; then | ||
echo "Team configuration argument not passed" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! $2 ]] ; then | ||
echo "Trial name not specified" | ||
exit 1 | ||
fi | ||
|
||
|
||
teamName=$(python3 get_team_name.py $1) | ||
|
||
if [[ ! $teamName ]] ; then | ||
echo "Team name not found" | ||
exit 1 | ||
fi | ||
|
||
docker exec -it $teamName bash -c ". /home/ubuntu/scripts/run_trial.sh $1 $2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import subprocess | ||
import yaml | ||
|
||
|
||
def main(): | ||
# Get yaml file name | ||
if len(sys.argv) <= 1: | ||
print("Please include an argument for the yaml file to run") | ||
exit() | ||
|
||
yaml_file = sys.argv[1] + '.yaml' | ||
print(f'Running {yaml_file}') | ||
|
||
if not os.path.isfile(yaml_file): | ||
print(f'{yaml_file} not found') | ||
exit() | ||
|
||
# Parse yaml file | ||
with open(yaml_file, "r") as stream: | ||
try: | ||
data = yaml.safe_load(stream) | ||
except yaml.YAMLError: | ||
print("Unable to parse yaml file") | ||
exit() | ||
|
||
# Store data from yaml filyaml_path | ||
try: | ||
repository = data["github"]["repository"] | ||
except KeyError: | ||
print("Unable to find repository link") | ||
exit() | ||
|
||
try: | ||
token = data["github"]["personal_access_token"] | ||
except KeyError: | ||
print("Unable to find personal_access_token") | ||
exit() | ||
|
||
try: | ||
package_name = data["competition"]["package_name"] | ||
except KeyError: | ||
print("Unable to find package_name") | ||
exit() | ||
|
||
try: | ||
launch_file = data["competition"]["launch_file"] | ||
except KeyError: | ||
print("Unable to find launch_file") | ||
exit() | ||
|
||
# Clone the repository | ||
clone_cmd = f"git clone https://{token}@{repository} ~/ariac_ws/src/{package_name}" | ||
subprocess.run(clone_cmd, shell=True) | ||
|
||
# Install extra packages | ||
for package in data["build"]["debian_packages"]: | ||
install_cmd = f"apt-get install {package} -y" | ||
subprocess.run(install_cmd, shell=True) | ||
|
||
if data["build"]["pip_packages"]: | ||
subprocess.run('apt install python3-pip -y' ,shell=True) | ||
|
||
for package in data["build"]["pip_packages"]: | ||
pip_command=f"yes | pip3 install {package}" | ||
subprocess.run(pip_command,shell=True) | ||
|
||
# Run custom build scripts | ||
os.chdir('/home/ubuntu/competitor_build_scripts') | ||
for script in data["build"]["extra_build_scripts"]: | ||
subprocess.run(f"chmod +x {script}", shell=True) | ||
subprocess.run(f"./{script}", shell=True) | ||
|
||
# Install rosdep packages | ||
os.chdir('/home/ubuntu/ariac_ws') | ||
rosdep_cmd = "rosdep install --from-paths src -y --ignore-src" | ||
subprocess.run(rosdep_cmd, shell=True) | ||
|
||
# Build the workspace | ||
subprocess.run("colcon build", shell=True) | ||
|
||
|
||
if __name__=="__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
cd ../home/ubuntu/scripts/ | ||
|
||
chmod +x build_competitor_code.py | ||
|
||
rm -r /home/ubuntu/ariac_ws/src/ariac/ariac_gazebo/config/trials | ||
mv /home/ubuntu/trials /home/ubuntu/ariac_ws/src/ariac/ariac_gazebo/config/ | ||
|
||
source /opt/ros/galactic/setup.bash | ||
python3 build_competitor_code.py $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import subprocess | ||
import yaml | ||
|
||
|
||
def main(): | ||
# Get yaml file name | ||
if len(sys.argv) <= 1: | ||
print("Please include an argument for the yaml file to run") | ||
exit() | ||
|
||
yaml_file = sys.argv[1] + '.yaml' | ||
print(f'Running {yaml_file}') | ||
|
||
if not os.path.isfile(yaml_file): | ||
print(f'{yaml_file} not found') | ||
exit() | ||
|
||
# Parse yaml file | ||
with open(yaml_file, "r") as stream: | ||
try: | ||
data = yaml.safe_load(stream) | ||
except yaml.YAMLError: | ||
print("Unable to parse yaml file") | ||
exit() | ||
|
||
# Store data from yaml filyaml_path | ||
try: | ||
package_name = data["competition"]["package_name"] | ||
except KeyError: | ||
print("Unable to find package_name") | ||
exit() | ||
|
||
try: | ||
launch_file = data["competition"]["launch_file"] | ||
except KeyError: | ||
print("Unable to find launch_file") | ||
exit() | ||
|
||
# Run | ||
launch_cmd = f"ros2 launch {package_name} {launch_file} trial_name:={sys.argv[2]}" | ||
subprocess.run(launch_cmd, shell=True, env=dict(os.environ, DISPLAY=":1.0")) | ||
|
||
|
||
if __name__=="__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
cd ../home/ubuntu/scripts/ | ||
|
||
chmod +x run_trial.py | ||
|
||
source /opt/ros/galactic/setup.bash | ||
source /home/ubuntu/ariac_ws/install/setup.bash | ||
|
||
python3 run_trial.py $1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Trial Name: qc.yaml | ||
# ARIAC2023 | ||
|
||
# ENVIRONMENT SETUP | ||
|
||
time_limit: -1 # options: -1 (no time limit) or number of seconds (max 500) | ||
|
||
kitting_trays: # Which kitting trays will be spawn | ||
tray_ids: [3, 8] | ||
slots: [1, 4] | ||
|
||
parts: | ||
bins: # bin params - 8 total bins each bin has nine total slots (1-9) | ||
bin2: | ||
- type: 'pump' | ||
color: 'purple' | ||
slots: [1, 3, 7, 9] | ||
bin6: | ||
- type: 'battery' | ||
color: 'blue' | ||
slots: [1, 3, 7, 9] | ||
|
||
orders: | ||
- id: 'MMB30H56' | ||
type: 'kitting' | ||
announcement: | ||
time_condition: 0 | ||
priority: false | ||
kitting_task: | ||
agv_number: 4 | ||
tray_id: 3 | ||
destination: 'warehouse' | ||
products: | ||
- type: 'battery' | ||
color: 'blue' | ||
quadrant: 3 | ||
- type: 'pump' | ||
color: 'purple' | ||
quadrant: 1 |
Oops, something went wrong.