I'm a frontend web engineer - building performant, high-quality user interfaces. Formerly, a robotics teacher.
Above stats generated with: tipsy/profile-summary-for-github
Blazing fast hexapod robot simulator for the web.
Home Page: https://hexapod.netlify.app
License: Apache License 2.0
I'm a frontend web engineer - building performant, high-quality user interfaces. Formerly, a robotics teacher.
Above stats generated with: tipsy/profile-summary-for-github
You can do
const localFrame = hexapod.localFrame,
So you dont have to type it all the time
hexapod/src/hexapod/plotter.js
Line 64 in c5d8406
hexapod/src/hexapod/VirtualHexapod.js
Line 117 in c09993f
cloneTrotShift(frame, tx = 0, ty = 0, tz = 0) {
let clone = new Hexagon(this.dimensions, {hasNoPoints: false } )
clone.cog = this.cog.cloneTrotShift(frame, tx, ty, tz)
clone.head = this.head.cloneTrotShift(frame, tx, ty, tz)
clone.verticesList = this.verticesList.map(point =>
point.cloneTrotShift(frame, tx, ty, tz)
)
return clone
}
constructor(dimensions, flags = { hasNoPoints: false } ) {
this.dimensions = dimensions
if (hasNoPoints) { return }
const { front, middle, side } = this.dimensions
const vertexX = [middle, front, -front, -middle, -front, front]
const vertexY = [0, side, side, 0, -side, -side]
this.verticesList = POSITION_LIST.map(
(position, i) =>
new Vector(vertexX[i], vertexY[i], 0, `${position}Vertex`, i)
)
this.head = new Vector(0, side, 0, "headPoint", 7)
this.cog = new Vector(0, 0, 0, "centerOfGravityPoint", 6)
}
Related to #27
Readings:
Deploy and setup continuous integration
const bodyContactPoints = hexapod.body
.cloneShift(tVec.x, tVec.y, tVec.z)
.cloneTrot(rotMatrix).verticesList
const bodyContactPoints = hexapod.body
.cloneTrot(rotMatrix)
.cloneShift(tVec.x, tVec.y, tVec.z)
.verticesList
This function has a high cognitive complexity, rewrite this
hexapod/src/hexapod/VirtualHexapod.js
Line 29 in a55a0e8
Find all the hard-coded strings in the code base. List them all here.
Please take a look at the link texts.py
below to get a better idea of what I'm trying to do.
Related to: #37
Something like this:
Examples (but not limited to)
Headers:
LandingPage Message
Hyperlinks texts and paths
Your app will work regardless of network state, even if offline. This means your users will be able to use your app at 10,000 feet and on the subway.
https://github.com/mithi/hexapod/blob/master/src/hexapod/solvers/LinkageIKSolver.js
From:
class LinkageIKSolver {
legXaxis = new Vector(1, 0, 0, "legXaxis")
bodyContactPoint = new Vector(0, 0, 0, "localBodyContact")
coxia
femur
tibia
summa
rho
p1
targetFootTipPoint
parsVector
pars
beta
gamma
obtainedSolution
reachedTarget
message```
To:
class LinkageIKSolver {
legXaxis = new Vector(1, 0, 0, "legXaxis")
dimensions = { coxia: null, femur: null, tibia: null, summa: null, pars: null }
points = {
bodyContactPoint: zeroVec("bodyContactPoint"),
coxiaPoint: zeroVec("coxiaPoint"),
femurPoint: zeroVec("femurPoint"),
footTipPoint: zeroVec("actualFootTipPoint"),
targetFootTipPoint: zeroVec("targetFootTipPoint"),
}
angles = { alpha: null, beta: null, gamma: null, rho: null }
vectors = {
legXaxis: new Vector(1, 0, 0, "legXaxis"),
parsVector: null
}
additionalInfo = {
obtainedSolution: false,
reachedTarget: false,
message: "",
}
hexapod/src/hexapod/Hexagon.js
Line 67 in 8cdc22d
I don't think anyone uses this function, I should probably just delete it.
Using only a partial bundle of Plotly reduced the bundle size by 50%.
Right now, Plotly still occupies 75% of the bundle.
#54
Other things that we can try:
MathJS
as dependency and just write all the matrix multiplications from scratchReactMarkdown
and just write them in htmlreact-icons
is taking up more space than it shouldpreact
and eject
Eject
Preact
Codesplitting
Importing only one icon from react-icon
The best practice i've discovered is to compute the transformation matrix outside and pass it
to the hexagon. This is because usually we use the same transformation matrix not only to the hexagon but other things like legs or coordinate frames (axes). So we'll just compute the transformation matrix only once for all the objects that need it. This is why we don't need these kinds of abstractions anymore.
hexapod/src/hexapod/Hexagon.js
Line 104 in 8fa9cbc
Add the following:
hexapod/src/hexapod/VirtualHexapod.js
Line 156 in c09993f
I should be able to do the following:
leg.coxiaPoint
leg.femurPoint
leg.footTipPoint
leg.bodyContactPoint
https://github.com/mithi/hexapod/blob/master/src/hexapod/Linkage.js
so we must pass something unique in the htmlFor
of each input widget, which is the id for the inputField, each inputfield must have an id which is unique to whole page
When we used identity
from mathjs
in the Linkage
module, all sorts of bugs came up on mobile.
It might be better if we don't use this library at all.
hexapod/src/hexapod/solvers/ik/hexapodSolver.js
Lines 13 to 20 in dbd772c
Add check.
that tx, ty, tz are between -1 and 1,
rx, ry, rz, hipStance and legStance are within what is specified in
https://github.com/mithi/hexapod/blob/master/src/components/vars.js
We can return null (early exit) or throw and error
related to #73
and how it's called
To have an idea on what kinds of tests to make.
Thanks!
Google Analytics, Ultimate Beginner’s Guide
https://www.youtube.com/watch?v=gBeMELnxdIg
Google Analytics Tutorial 2019: Beginner To Expert
https://www.youtube.com/watch?v=1T83gm6GBt0
Put the block of _computeMaybeGroundContact()
this this line directly since its the only one using it
hexapod/src/hexapod/Linkage.js
Line 120 in a55a0e8
Rename _computePointsWrtHexapodsCog
to _computePointsWrtHexapodCog
hexapod/src/hexapod/Linkage.js
Line 225 in a55a0e8
When you look at the app state, on load, latestCameraView
is undefined even though we explicitly define it . Why?
Also when we move from one page to another it does not remember this default state, if we don't change the camera view on page load, (ie we intend to use the default camera view). What happens is it moves to a camera view that we don't intend (probably plotly's default camera view)
however, when we do change it (ie we explicitly play with the camera view), the app state does remember this camera view.
Line 53 in 7e1b9bd
This is not the behavior we intend. We need to fix it.
Rename from legsWithoutGravity
to legsNoGravity
hexapod/src/hexapod/VirtualHexapod.js
Line 133 in a55a0e8
Rename from legsOnGroundWithoutGravity
to groundLegsNoGravity
hexapod/src/hexapod/VirtualHexapod.js
Line 145 in a55a0e8
Destructure this ie
{xAxis, yAxis, zAxis } = this.localFrame
hexapod/src/hexapod/VirtualHexapod.js
Line 215 in a55a0e8
hexapod/src/hexapod/Hexagon.js
Line 65 in 5cee12e
Make sure that this does not introduce breaking changes
leg.CloneTrotShift(leg, frame, tx, ty, tz)
pointCloneTrotShift(leg, frame, tx, ty, tz)
pointNewTrotShift(point, frame, tx, ty, tz)
hexagonCloneTrotShift(hexagon, frame, tx, ty, tz)
pointCloneShift(point, tx, ty, tz)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.