From 392156bf6ca9d495c50706d7e741c7f26748d83f Mon Sep 17 00:00:00 2001 From: len0rd Date: Thu, 2 Aug 2018 20:44:04 -0400 Subject: [PATCH] fixed. generated MD now shows up and looks half decent. going to have it also use a scrollspy navbar on the left. needs to be autogenerated by the prestart script --- assets/css/projects.css | 17 ++++++++++ ...{frsky-controller => frsky-controller.jpg} | Bin assets/script/app.js | 1 - project_writeups/darkstar.md | 30 +++++++++--------- server.js | 2 +- views/pages/index.ejs | 2 +- views/pages/projects/project_template.ejs | 21 ++++++++---- views/partials/include.ejs | 4 +-- views/partials/post_html_include.ejs | 2 +- 9 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 assets/css/projects.css rename assets/img/writeup/darkstar/{frsky-controller => frsky-controller.jpg} (100%) diff --git a/assets/css/projects.css b/assets/css/projects.css new file mode 100644 index 0000000..55d4dfd --- /dev/null +++ b/assets/css/projects.css @@ -0,0 +1,17 @@ +img { + display: block; + margin-left: auto; + margin-right: auto; + padding-top: 2vh; + padding-bottom: 2vh; + width: 50%; +} + +iframe { + display: block; + margin-left: auto; + margin-right: auto; + width: 50%; + margin-top: 2vh; + margin-bottom: 2vh; +} \ No newline at end of file diff --git a/assets/img/writeup/darkstar/frsky-controller b/assets/img/writeup/darkstar/frsky-controller.jpg similarity index 100% rename from assets/img/writeup/darkstar/frsky-controller rename to assets/img/writeup/darkstar/frsky-controller.jpg diff --git a/assets/script/app.js b/assets/script/app.js index de7e864..a47e946 100644 --- a/assets/script/app.js +++ b/assets/script/app.js @@ -3,7 +3,6 @@ var $document = $(document), navbarDef = 'bg-dark', effect = 'fadeInDown'; -console.log('waddup'); if (window.location.pathname ==='/') { $document.scroll(function() { //if >100 pixels have been scrolled diff --git a/project_writeups/darkstar.md b/project_writeups/darkstar.md index 0fc2c80..a41a014 100644 --- a/project_writeups/darkstar.md +++ b/project_writeups/darkstar.md @@ -10,7 +10,7 @@ Having landed a gig at an autonomous flight research center for the summer, I fi As is the case with most hobbies, much of my money was spent on initial startup costs: an RC transmitter and battery charger, while essential, would only need to be purchased once. If I want to build more rc-craft in the future, this will make it a lot easier. -![FrSky Taranis QX7](img/writeup/frsky-contoller.jpg) +![FrSky Taranis QX7](/img/writeup/darkstar/frsky-controller.jpg) **Transmitter:** I went with a [FrSky Taranis QX7](https://www.amazon.com/dp/B06XC4C4WH) for a few reasons: @@ -23,13 +23,13 @@ As is the case with most hobbies, much of my money was spent on initial startup **Frame:** Really nothing special here. I got a [Reptile 500](https://www.ebay.com/sch/i.html?_nkw=reptile500+v3+quadcopter+frame) frame... or something. Honestly not sure on the name here. Basically my strategy was to browse [hobbyking](https://hobbyking.com) til I found something I liked, then I headed over to ebay, to buy something similar. You can get frames for pretty cheap off there if you're willing to wait for it to ship from China. I wasn't, so I paid an extra $10 to get it from a US seller. As Shipped: -![Frame as shipped](img/writeup/darkstar/frame-boxed-sm.jpg) +![Frame as shipped](/img/writeup/darkstar/frame-boxed-sm.jpg) (Mostly) Assembled: -![Assembled](img/writeup/darkstar/frame-assembled-sm.jpg) +![Assembled](/img/writeup/darkstar/frame-assembled-sm.jpg) Some of the arms were a pain to secure: -![Arm Trouble](img/writeup/darkstar/frame-armtrouble-sm.jpg) +![Arm Trouble](/img/writeup/darkstar/frame-armtrouble-sm.jpg) Overall I'm pretty happy with the frame. It's simple and it was cheap. At first I thought 500mm between motors would be huge, but I've grown to like it and how much space it gives me. I have plenty of room to jam all of my various gizmos throughout. Being cheap and from ebay, it was a bit of an effort to secure all the arms to the frame; aligning the holes was more difficult than anticipated. But once mounted they're pretty solid, and have already survived a few crashes with ease. @@ -37,11 +37,11 @@ Overall I'm pretty happy with the frame. It's simple and it was cheap. At first I was stupid and tried to screw the motor in through all 4 holes on the arm with some aggressive dremeling, before realizing there were two holes for my motor size, and two for a different size. -![Motors attached](img/writeup/darkstar/motor-attached-sm.jpg) +![Motors attached](/img/writeup/darkstar/motor-attached-sm.jpg) DJI props! So much easier than the other nightmares I've worked with in the past. -![DJI Props](img/writeup/darkstar/motor-djiprops-sm.jpg) +![DJI Props](/img/writeup/darkstar/motor-djiprops-sm.jpg) **Receiver:** [FrSky D4R-II](https://www.amazon.com/gp/product/B00SWHWFWO/) Cheap, compatible, capable. I would be comfortable with any FrSky CPPM receiver here. @@ -55,28 +55,28 @@ DJI props! So much easier than the other nightmares I've worked with in the past Mostly I just added things on here and there as I got them in the mail. I had most of the frame pieces setup and ready to go by the time I had my big 'assembly party'... alone... on a Friday night.... Help me: Receiver mounted on top with a twist tie, ESC's secured on the arm with some good velcro/zip ties: -![Receiver mounted](img/writeup/darkstar/assembly-1-sm.jpg) +![Receiver mounted](/img/writeup/darkstar/assembly-1-sm.jpg) This plate+anti-shock mount combo was intended to go in the front of the drone for fpv. While that is something I would like to eventually add, this plate also happened to be the perfect size for the Flip32. So I drilled a few holes, allowing me to mount the naze as close to the center of gravity as was reasonable: -![Flip32 Mount](img/writeup/darkstar/assembly-2-sm.jpg) +![Flip32 Mount](/img/writeup/darkstar/assembly-2-sm.jpg) Assembly can get messy: -![Assembly environment](img/writeup/darkstar/assembly-3-sm.jpg) +![Assembly environment](/img/writeup/darkstar/assembly-3-sm.jpg) This is the handiest edition I think I've made. This allows me to plug in the battery with the confidence that the motors aren't going to immediately attack me. Currently I only use one side of the switch, but in the future I plan on having one side turn everything on, while the other side only turns on the small electronics(and not the finger-slicing motors): -![Power switch](img/writeup/darkstar/assembly-4-sm.jpg) +![Power switch](/img/writeup/darkstar/assembly-4-sm.jpg) Power distribution soldered and mounted! The velcroed piece at the top is my 5V BEC: -![Power distribution](img/writeup/darkstar/assembly-5-sm.jpg) +![Power distribution](/img/writeup/darkstar/assembly-5-sm.jpg) Naze (aka Flip32) mounted! This is all a bit tighter than anticipated: -![Naze mounted](img/writeup/darkstar/assembly-6-sm.jpg) +![Naze mounted](/img/writeup/darkstar/assembly-6-sm.jpg) Todo: cable management -![Cable management](img/writeup/darkstar/assembly-7-sm.jpg) +![Cable management](/img/writeup/darkstar/assembly-7-sm.jpg) Also Todo: Secure the battery in a non-terrible way -![Secure battery](img/writeup/darkstar/assembly-8-sm.jpg) +![Secure battery](/img/writeup/darkstar/assembly-8-sm.jpg) ## Part 2: Fixes and Tweaks Its been a few weeks since writing part 1 and a lot has changed. For starters the thing actually flies now. As I mentioned in part 1 I had some troubles getting my first set of esc's to work correctly. So I replaced them with new, smaller ones, and *still* had trouble with them. That is until I finally sat down and figured out how to calibrate them (protip: read the instructions that come with your products!). With that squared away, this hunk of junk finally became a flyable drone as opposed to a 180deg flipping machine, as shown in the video below. @@ -85,7 +85,7 @@ Its been a few weeks since writing part 1 and a lot has changed. For starters th Unfortunately I dont have any footage of the first successful flights(I was out by myself, as usual), but just know it was legendary. Flight 1 went well until I accidentally crashed into a pine tree, which provided a surprisingly cushy landing. Flight 2 was absolutely beautiful until I somehow managed to clothesline my drone on literally the only power line in the immediate vicinity. The rest of the initial flights followed a similar pattern. All-in-all, I ended up buying another 4 sets (with 2/set) of props, after breaking 4 of them. Seeing as this was my first real drone-flying experience, and I was still tweaking some of the settings, I chalk it up to the cost of learning. -![Broken Props](img/writeup/darkstar/tweaks-1-sm.jpg) +![Broken Props](/img/writeup/darkstar/tweaks-1-sm.jpg) ### Sim Practice diff --git a/server.js b/server.js index ee0e4cf..b637325 100644 --- a/server.js +++ b/server.js @@ -30,7 +30,7 @@ app.get(/\/.*/, function(req, res) { } console.log('request for path: ' + pathname + ', and page: ' + page); - res.render(pathname, {"page": this.page}); + res.render(pathname, {"page": page}); }); app.listen(PORT); \ No newline at end of file diff --git a/views/pages/index.ejs b/views/pages/index.ejs index 64d66f7..13a642c 100644 --- a/views/pages/index.ejs +++ b/views/pages/index.ejs @@ -69,7 +69,7 @@ diff --git a/views/pages/projects/project_template.ejs b/views/pages/projects/project_template.ejs index bf4fb0a..33e1ef8 100644 --- a/views/pages/projects/project_template.ejs +++ b/views/pages/projects/project_template.ejs @@ -1,20 +1,29 @@ +<% var rootPath = '../../'; %> - <% include ../../partials/include %> + <%- include(rootPath + 'partials/include') %> +
- <% include ../../partials/nav %> + <%- include(rootPath + 'partials/nav') %>
-
- <% include(page) %> +
+
+
+ +
+
+ <%- include(rootPath + page) %> +
+
- <% include ../../partials/footer %> - <% include ../../partials/post_html_include %> + <%- include(rootPath + 'partials/footer') %> + <%- include(rootPath + 'partials/post_html_include') %> \ No newline at end of file diff --git a/views/partials/include.ejs b/views/partials/include.ejs index 0305b86..43ed401 100644 --- a/views/partials/include.ejs +++ b/views/partials/include.ejs @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/views/partials/post_html_include.ejs b/views/partials/post_html_include.ejs index f291b71..faec051 100644 --- a/views/partials/post_html_include.ejs +++ b/views/partials/post_html_include.ejs @@ -1,4 +1,4 @@ - + \ No newline at end of file