Skip to content
Snippets Groups Projects
Commit fda022bf authored by wu-chinese's avatar wu-chinese
Browse files

renamed the varaibles, and fixed a logic bug on sidewalk curb

parent 4968b399
Branches master
No related tags found
No related merge requests found
......@@ -94,7 +94,7 @@ function Game() {
playerSprite.y = toScreenCoords(playerSprite_curTgc).y;
// Setup our pose classifier
/****** CODE FOR THE POSE CLASSIFER! UNCOMMENT TO HAVE THE MODEL RUNNING */
/****** CODE FOR THE POSE CLASSIFER! UNCOMMENT TO HAVE THE MODEL RUNNING */
// video = createCapture(VIDEO);
// video.hide();
// poseNet = ml5.poseNet(video, modelLoaded);
......@@ -107,7 +107,7 @@ function Game() {
// debug: true
// }
// brain = ml5.neuralNetwork(options);
// LOAD PRETRAINED MODEL: Uncomment below to train your own model!
// const modelInfo = {
// model: 'model1/model.json',
......@@ -234,7 +234,7 @@ function Game() {
/**** For debugging the pose classifier *****/
// Uncomment for seeing each prediction drawn on the screen
// for easy debugging
// for easy debugging
// push();
// translate(video.width, 0);
// scale(-1, 1);
......@@ -246,7 +246,7 @@ function Game() {
// let b = skeleton[i][1];
// strokeWeight(2);
// stroke(0);
// line(a.position.x, a.position.y, b.position.x, b.position.y);
// }
// for (let i = 0; i < pose.keypoints.length; i++) {
......@@ -315,7 +315,7 @@ function Game() {
updateTileSprite(tgc_x, tgc_y, sidewalkCurbRampTopLeft);
} else if (tile_orientation === "rotated90") {
updateTileSprite(tgc_x, tgc_y, sidewalkCurbRampBotLeft);
} else if (tile_orientation === "rotated90") {
} else if (tile_orientation === "rotated180") {
updateTileSprite(tgc_x, tgc_y, sidewalkCurbRampBotRight);
} else {
updateTileSprite(tgc_x, tgc_y, sidewalkCurbRampTopRight);
......@@ -492,7 +492,7 @@ function Game() {
console.log('pose classification ready!');
classifyPose();
}
function classifyPose() {
// console.log("We are in classifyPose");
if (pose) {
......@@ -510,7 +510,7 @@ function Game() {
setTimeout(classifyPose, 100);
}
}
function gotResult(error, results) {
if (results[0].confidence > 0.75) {
poseLabel = results[0].label.toUpperCase();
......@@ -519,7 +519,7 @@ function Game() {
console.log(results);
classifyPose();
}
function gotPoses(poses) {
// console.log("Did we get any poses??");
// console.log(poses);
......@@ -539,7 +539,7 @@ function Game() {
}
}
}
function modelLoaded() {
console.log('poseNet ready');
}
......
......@@ -13,10 +13,10 @@ function preload() {
sidewalkCornerBotLeft = loadImage("assets/tile_pngs/sidewalkCorner_topLeft.png"); // Corner Bot Left (rot 90)
sidewalkCornerBotRight = loadImage("assets/tile_pngs/sidewalkCorner_topLeft.png"); // Corner Bot Right (rot 180)
sidewalkCornerTopRight = loadImage("assets/tile_pngs/sidewalkCorner_topLeft.png"); // Corner Top Right (rot 270)
sidewalkCurbRampTopLeft = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_topLeft.png"); // Corner w Curb Ramp Top Left
sidewalkCurbRampBotLeft = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_topLeft.png"); // Corner w Curb Ramp Bot Left (rot 90)
sidewalkCurbRampBotRight = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_topLeft.png"); // Corner w Curb Ramp Bot Right (rot 180)
sidewalkCurbRampTopRight = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_topLeft.png"); // Corner w Curb Ramp Top Right (rot 270)
sidewalkCurbRampTopLeft = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_down.png"); // Corner w Curb Ramp Top Left
sidewalkCurbRampBotLeft = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_left.png"); // Corner w Curb Ramp Bot Left (rot 90)
sidewalkCurbRampBotRight = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_up.png"); // Corner w Curb Ramp Bot Right (rot 180)
sidewalkCurbRampTopRight = loadImage("assets/tile_pngs/sidewalkCornerCurbRamp_right.png"); // Corner w Curb Ramp Top Right (rot 270)
roundaboutTile = loadImage("assets/tile_pngs/RoundBout280.png");
}
......@@ -36,7 +36,7 @@ function setup() {
sidewalkCornerBotRight.resize(64, 64);
sidewalkCornerTopRight.resize(64, 64);
roundaboutTile.resize(252, 252);
createCanvas(bkImage.width, bkImage.height);
var mgr = new SceneManager();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment