Skip to content

Conversation

@AnkitLakkapragada
Copy link
Contributor

Create a simulator, animating the robot's position and orientation at a certain time using a slider. Also implemented a play button.

Copy link
Contributor

@shadaj shadaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass

lazy val sharedDependencies = if (System.getenv("NATIVE_TARGET") == "ARM32") {
Def.setting(Seq(
"org.typelevel" %%% "squants" % "1.3.0"
"org.typelevel" %% "squants" % "1.3.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnkitLakkapragada these should not have been changed; they break our ability to compile to JS and Native.

publishMavenStyle := true
publishTo in ThisBuild := Some(Resolver.file("gh-pages-repo", baseDirectory.value / "repo"))

libraryDependencies += "com.lihaoyi" %% "upickle" % "0.5.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed. We have dropped uPickle in favor of Argonaut, which supports all platforms we want to use.


class Canvas(val w: Int, val h: Int) extends JPanel {

var xPos: Int = _
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting: no extra lines at beginning, should be initialized to zero.


((x * cos - y * sin).toInt, (x * sin + y * cos).toInt)
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra lines

g.setColor(Color.WHITE)
g.fillRect(0, 0, w, h)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra lines

val simulatorGUI = new SimulatorGUI(Feet(10), Feet(10))
simulatorGUI.startGUI()
simulatorGUI.useLogFile(new File("simlog-,(0.0 ft,0.0 ft,0.0 ft),(-0.1 ft,5.0 ft,0.0 ft),(-5.0 ft,10.0 ft,0.0 ft)"))
val timer = new Timer()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This timer appears to be doing nothing.

import com.lynbrookrobotics.potassium.ClockMocking._
import com.lynbrookrobotics.potassium.Signal
import com.lynbrookrobotics.potassium.commons.drivetrain.twoSided.TwoSidedDriveProperties
import com.lynbrookrobotics.potassium.commons.drivetrain.{ForwardPositionGains, ForwardVelocityGains, TurnPositionGains, TurnVelocityGains}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not have been changed.

import com.lynbrookrobotics.potassium.Signal
import com.lynbrookrobotics.potassium.commons.drivetrain.{ForwardPositionGains, ForwardVelocityGains, TurnPositionGains, TurnVelocityGains}
import com.lynbrookrobotics.potassium.commons.drivetrain.unicycle.control.purePursuit.{Auto, BackwardsOnly, ForwardBackwardMode, MathUtilities}
import com.lynbrookrobotics.potassium.commons.drivetrain.unicycle.control.purePursuit.MathUtilities
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this file should not have been changed.



}
}, 0, 100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems kinda slow. You probably want to update every 1000/60 = 16.7 ms for 60fps rendering.

*/

def moveFunction(): Unit = {
timeSlider.setValue(timeSlider.getValue + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems arbitrary. You should be running the simulation in real time so the time passed when rendering matches the time passed in the log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants