Skip to content

Commit

Permalink
use the correct index for the robot position for the close points
Browse files Browse the repository at this point in the history
  • Loading branch information
varun7654 committed Mar 7, 2023
1 parent 54d0552 commit afd87ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
11 changes: 9 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions .idea/runConfigurations/DesktopLauncher.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public void updatePoint(OrthographicCamera camera, Vector3 mousePos,
synchronized (robotPositions) {
float scale = AutoBuilder.getConfig().getPointScaleFactor();
for (int i = 0; i < robotPositions.size(); i++) {
RobotPosition robotPosition = robotPositions.get(i).get(0);
ArrayList<RobotPosition> robotPositionsAtTime = (ArrayList<RobotPosition>) robotPositions.get(i);
RobotPosition robotPosition = robotPositionsAtTime.get(robotPositionsAtTime.size() - 1);
float len2 = mousePos.dst2((float) (robotPosition.x() * scale), (float) (robotPosition.y() * scale), 0);
if (len2 < maxDistance2) {
points.add(new CloseTrajectoryPoint(len2, this, i, 0));
Expand Down

0 comments on commit afd87ed

Please sign in to comment.