Skip to content

Commit

Permalink
Step trajectory by plus one
Browse files Browse the repository at this point in the history
  • Loading branch information
aaravpandya committed May 7, 2024
1 parent 870252a commit d4ee7f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ inline void movementSystem(Engine &e,
else
{
// Follow expert trajectory
CountT curStepIdx = getCurrentStep(stepsRemaining);
CountT curStepIdx = getCurrentStep(stepsRemaining) + 1; // +1 to get the next step
model.position= trajectory.positions[curStepIdx];
model.heading = trajectory.headings[curStepIdx];
model.speed = trajectory.velocities[curStepIdx].length();
Expand Down Expand Up @@ -499,7 +499,7 @@ inline void stepTrackerSystem(Engine &ctx,
}

// An agent can be done early if it reaches the goal
if(done.v != 1)
if(done.v != 1 || info.reachedGoal != 1)
{
float dist = (model.position - goal.position).length();
if(dist < ctx.data().params.rewardParams.distanceToGoalThreshold)
Expand Down

0 comments on commit d4ee7f0

Please sign in to comment.