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

Step trajectory by plus one #105

Closed
wants to merge 2 commits into from
Closed
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 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
Loading