Cada cor controla um grau de liberdade.
"É o ramo da física que se ocupa da descrição dos movimentos dos corpos, sem se preocupar com a análise das forças em causa (dinâmica)".
// #enei2018 ...
// Reset configuration
$('#reset-button').click(function () {
// #enei2018 ...
})
// Random configuration
$('#random-button').click(function () {
// #enei2018 ...
})
get configuration () {
// #enei2018 ...
}
get zeroConfiguration () {
// #enei2018 ...
}
if (this._kinematics.joints.hasOwnProperty(prop)) {
const joint = this._kinematics.joints[prop]
if (!joint.static) {
// #enei2018 ...
}
}
// set configuration (q) { ... }
// #enei2018 ...
get configuration () {
return this._q.slice()
}
get zeroConfiguration () {
return new Array(this.degreesOfFreedom + 1).join('0').split('').map(parseFloat)
}
if (this._kinematics.joints.hasOwnProperty(prop)) {
const joint = this._kinematics.joints[prop]
if (!joint.static) {
q.push(THREE.Math.randFloat(joint.limits.min, joint.limits.max))
}
}
// set configuration (q) { ... }
this._q = q.slice()
q = q.slice()
for (const prop in this._kinematics.joints) {
if (this._kinematics.joints.hasOwnProperty(prop)) {
if (!this._kinematics.joints[prop].static) {
this.setJointValue(prop, q.shift())
}
}
}
// Reset configuration
$('#reset-button').click(function () {
// #enei2018 ...
})
// Random configuration
$('#random-button').click(function () {
// #enei2018 ...
})
for (let i = 0; i < 1e4; i++) {
// #enei2018 ...
}
// Reset configuration
$('#reset-button').click(function () {
robot.configuration = robot.zeroConfiguration
})
// Random configuration
$('#random-button').click(function () {
robot.configuration = robot.randomConfiguration
})
for (let i = 0; i < 1e4; i++) {
robot.configuration = robot.randomConfiguration
for (let j = 0; j < robot.tipLinks.length; j++) {
const point = new THREE.Vector3()
point.setFromMatrixPosition(robot.getLinkPose(robot.tipLinks[j]))
rawPoints[j].push(point)
}
}
case 72: // H
console.log(`Moving robot to 'home' position`)
// #enei2018 ...
break
case 80: // P
console.log('Executing motion...')
// #enei2018 ...
break
// Initialises data structures for tween.js
// #enei2018 ...
kinematicsTween.onUpdate(function () {
// Update robot configuration, joint by joint.
// #enei2018 ...
})
case 72: // H
console.log(`Moving robot to 'home' position`)
moveFromTo(robot.configuration, robot.zeroConfiguration)
break
case 80: // P
console.log('Executing motion...')
moveFromTo(robot.configuration, robot.randomConfiguration)
break
// Initialises data structures for tween.js
for (const joint of robot._joints) {
tweenStart[joint] = q_s.shift()
tweenFinal[joint] = q_t.shift()
}
kinematicsTween.onUpdate(function () {
// Update robot configuration, joint by joint.
for (const j of robot._joints) { robot.setJointValue(j, this[j]) }
})