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

Velocity Cost Override Param #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions systems/drone/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM 909785973729.dkr.ecr.us-east-1.amazonaws.com/drone-simulator:0de4571c4816b18d3f2d917a3be84d7d3b7fb182

ARG VELOCITY_COST_OVERRIDE
ENV VELOCITY_COST_OVERRIDE=$VELOCITY_COST_OVERRIDE
# Install JQ:
RUN apt-get update && apt-get install -y jq

COPY entrypoint.sh /

Expand Down
17 changes: 14 additions & 3 deletions systems/drone/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
#!/bin/bash

if [[ -n $VELOCITY_COST_OVERRIDE ]]; then
VELOCITY_COST_OVERRIDE="--velocity_cost_override ${VELOCITY_COST_OVERRIDE}"
# Set the cost override for the velocity cost
# Check if the parameters.json file that exists in /tmp/resim/inputs contains the velocity cost override:
if [ -f /tmp/resim/inputs/parameters.json ]; then
VELOCITY_COST_OVERRIDE=$(jq -r '.velocity_cost_override' /tmp/resim/inputs/parameters.json)
# check it is not null:
if [ "$VELOCITY_COST_OVERRIDE" == "null" ]; then
VELOCITY_COST_OVERRIDE=""
echo "No velocity cost override found in parameters"
# otherwise:
else
echo "Found a velocity cost override in the parameters.json file: $VELOCITY_COST_OVERRIDE"
VELOCITY_COST_OVERRIDE="--velocity_cost_override ${VELOCITY_COST_OVERRIDE}"
fi
fi


echo "Running container with cost override: $VELOCITY_COST_OVERRIDE"
/sim_container_entrypoint.sh $VELOCITY_COST_OVERRIDE