Skip to content

Commit

Permalink
alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarhead committed Sep 9, 2024
1 parent 1922a1b commit 717b398
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'jarhead'
version '1.4.4'
version '1.6.0'


repositories {
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/jarhead/DrawPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void paintComponent (Graphics g){
long renderStart = System.currentTimeMillis();
if(trajectory != null) {
// renderRobotPath((Graphics2D) g, trajectory, lightPurple, 0.5f);
render.renderRobotPath((Graphics2D) g, ActionEntityKt.actionTimeline(trajectory).getSecond(), lightPurple, 0.5f, this.getWidth(), this.getHeight());
// render.renderRobotPath((Graphics2D) g, ActionEntityKt.actionTimeline(trajectory).getSecond(), lightPurple, 0.5f, this.getWidth(), this.getHeight());
render.renderSplines((Graphics2D) g, ActionEntityKt.actionTimeline(trajectory).getSecond(), cyan, 5, main.scale);
// renderPoints(g, trajectory, cyan, 1);
}
Expand Down Expand Up @@ -416,6 +416,16 @@ private void mPressed(MouseEvent e) {
double total = 0;

List<Marker> markers = getCurrentManager().getMarkers();

// if(trajectory != null){
// if(trajectory instanceof TrajectoryAction){
// TimeTrajectory traj = ((TrajectoryAction) trajectory).getT();
// CompositePosePath paths = (CompositePosePath) traj.path;
// for (PosePath path : paths.paths) {
// Pose2dDual<Arclength> mid = path.get(path.length() / 2, 0);
//


// for (int i = 0; i < trajectory.size(); i++) {
// SequenceSegment segment = trajectory.get(i);
// if (segment == null) continue;
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/jarhead/Render.kt
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,20 @@ class Render {
}

val poses = displacements.map { action.t.path[it, 1].value() }
// get the first pose
val coord = poses[0].position
trajectoryDrawnPath.moveTo(coord.x*scale, coord.y*scale)

// get the mid point
val midPoint = poses[displacementSamples/2].position
g.drawOval(
(midPoint.x*scale).toInt() - ovalScale / 2,
(midPoint.y*scale).toInt() - ovalScale / 2,
ovalScale, ovalScale)

for (pose in poses.drop(1)) {
val coord = pose.position
if (first) {
trajectoryDrawnPath.moveTo(coord.x*scale, coord.y*scale)
first = false
} else {
trajectoryDrawnPath.lineTo(coord.x*scale, coord.y*scale)
}
trajectoryDrawnPath.lineTo(coord.x*scale, coord.y*scale)
}
}
// is TurnAction -> {
Expand Down

0 comments on commit 717b398

Please sign in to comment.