diff --git a/robot_software/followPath.pyc b/robot_software/followPath.pyc index 1668062..6b8fcc8 100644 Binary files a/robot_software/followPath.pyc and b/robot_software/followPath.pyc differ diff --git a/robot_software/rasppi_listener.py b/robot_software/rasppi_listener.py new file mode 100644 index 0000000..375ce11 --- /dev/null +++ b/robot_software/rasppi_listener.py @@ -0,0 +1,32 @@ +import socket +import json + +def listen(): + PORT = 65432 # Port to listen on (non-privileged ports are > 1023) + + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + HOST = socket.gethostbyname(socket.gethostname()) + s.bind((HOST, PORT)) + print("Listening on {}:{}".format(HOST,PORT)) + while True: + s.listen(1) + conn, addr = s.accept() + + print('Connected by', addr) + + data = conn.recv(1024) + data = data.decode('utf-8') + data = data.split(' ') + if data[0] == 'grab': + print('grab') + elif data[0] == 'prepare': + print('prepare_grabber') + elif data[0] == 'wait_for_bump': + print('wait for bump') + raw_input() + print("BUMP!") + elif data[0] == 'lift': + print('lift to {}'.format(data[1])) + + conn.sendall(b'done') + conn.close() diff --git a/website/nuxt.config.js b/website/nuxt.config.js index 3704d6a..89d1c34 100644 --- a/website/nuxt.config.js +++ b/website/nuxt.config.js @@ -16,8 +16,8 @@ module.exports = { ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, - { rel: 'stylesheet', type: 'text/css', href: '//cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css' }, - { rel: 'stylesheet', type: 'text/css', href: 'https://fonts.googleapis.com/css?family=Raleway&Open+Sans' } + // { rel: 'stylesheet', type: 'text/css', href: '//cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css' }, + // { rel: 'stylesheet', type: 'text/css', href: 'https://fonts.googleapis.com/css?family=Raleway&Open+Sans' } ] }, @@ -34,7 +34,8 @@ module.exports = { ** Global CSS */ css: [ - '@/assets/sass/style.sass' + '@/assets/sass/style.sass', + '@/node_modules/@mdi/font/css/materialdesignicons.min.css', ], /* diff --git a/website/package-lock.json b/website/package-lock.json index da0c44d..f72e2c0 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -974,6 +974,11 @@ "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.12.tgz", "integrity": "sha512-1QWhGGu03NjPYk45w5muLq6a43Fhvd5+LGZrPydXLs7/FgQHqW6aSKmJClTwBHP1rynLSLLA7+9E/35cur6g/g==" }, + "@mdi/font": { + "version": "3.5.95", + "resolved": "https://registry.npmjs.org/@mdi/font/-/font-3.5.95.tgz", + "integrity": "sha512-WHSJ0TJ70qkn+EPsW9w22pQU+kjEnRZlfN4N7xsFFmKa6VhpdQcwTWqj9PDH3oq6Be2p0IW/VDURJvPWDnBAUw==" + }, "@nuxt/babel-preset-app": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.4.2.tgz", @@ -7402,6 +7407,11 @@ "object-visit": "^1.0.0" } }, + "material-design-icons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/material-design-icons/-/material-design-icons-3.0.1.tgz", + "integrity": "sha1-mnHEh0chjrylHlGmbaaCA4zct78=" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -8024,6 +8034,14 @@ "@nuxt/webpack": "2.4.2" } }, + "nuxt-material-design-icons": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nuxt-material-design-icons/-/nuxt-material-design-icons-1.0.4.tgz", + "integrity": "sha512-1DwI3n7zLIMO+dV87JUSohhF6yFtIXyzBZ15YLQYSDEQWFBpo/3k1excO1dooaaGVJFS4ObnOCreiy4Xov4t/A==", + "requires": { + "material-design-icons": "^3.0.1" + } + }, "nwsapi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.0.tgz", diff --git a/website/package.json b/website/package.json index 670c670..2a266fc 100644 --- a/website/package.json +++ b/website/package.json @@ -12,6 +12,7 @@ "test": "jest" }, "dependencies": { + "@mdi/font": "^3.5.95", "@nuxtjs/axios": "^5.3.6", "@nuxtjs/bulma": "^1.2.1", "axios": "^0.18.0", @@ -20,6 +21,7 @@ "firebase": "^5.8.2", "node-sass": "^4.11.0", "nuxt": "^2.3.4", + "nuxt-material-design-icons": "^1.0.4", "sass-loader": "^7.1.0", "vue-cookies": "^1.5.12", "vue-headroom": "^0.9.0", diff --git a/website/pages/merchant/items/create.vue b/website/pages/merchant/items/create.vue index 74736ee..1f494f9 100644 --- a/website/pages/merchant/items/create.vue +++ b/website/pages/merchant/items/create.vue @@ -16,7 +16,7 @@
- +
@@ -43,7 +43,7 @@
@@ -56,7 +56,7 @@
@@ -69,7 +69,7 @@ @@ -78,12 +78,15 @@
- +
+

+ kg, lbs, litres, etc... or blank. +

@@ -107,7 +110,7 @@
- +
@@ -146,17 +149,17 @@ export default { warehouseId: this.$nuxt._route.params.id, warehouse: {}, - name: null, + name: "", image: null, position: { x: 0, y: 0, z: 0, }, - quantity: null, + quantity: "", unit: null, size: 'tiny', - price: null + price: "" } }, methods: { @@ -222,7 +225,7 @@ export default { }, computed: { can_submit: function () { - return this.name && this.quantity && this.price + return this.name.toString().length > 0 && this.quantity.toString().length > 0 && this.price.toString().length > 0 } }, mounted: function () { diff --git a/website/pages/merchant/items/edit/_id.vue b/website/pages/merchant/items/edit/_id.vue index 5696fd7..8688a1f 100644 --- a/website/pages/merchant/items/edit/_id.vue +++ b/website/pages/merchant/items/edit/_id.vue @@ -3,7 +3,7 @@

- Add item + Edit item

diff --git a/website/pages/merchant/warehouses/create.vue b/website/pages/merchant/warehouses/create.vue index f47a324..30916c1 100644 --- a/website/pages/merchant/warehouses/create.vue +++ b/website/pages/merchant/warehouses/create.vue @@ -12,7 +12,7 @@
- +
@@ -42,22 +42,33 @@

- +
- +

The Z values are the amount of shelfs and their respected heights from the robot's perspective. (Include bottom shelf as 0.0)

- + class="is-flex align-center mb10"> + + + + + + +
Add a shelf @@ -95,15 +106,15 @@ export default { }, data: function () { return { - name: null, + name: "", image: null, location: { - latitude: null, - longitude: null + latitude: "", + longitude: "" }, dimensions: { - x: null, - y: null, + x: "", + y: "", z: [ 0.0 ] @@ -114,6 +125,9 @@ export default { addShelf: function () { this.dimensions.z.push(this.dimensions.z[this.dimensions.z.length - 1]) }, + deleteShelf: function (i) { + this.dimensions.z.splice(i, 1) + }, uploadFile: function (event) { let file = event.target.files[0] this.createImage(file); @@ -158,7 +172,7 @@ export default { }, computed: { can_submit: function () { - return this.name && this.location.latitude && this.location.longitude && this.dimensions.x && this.dimensions.y + return this.name.toString().length > 0 && this.dimensions.x.toString().length > 0 && this.dimensions.y.toString().length > 0 } } };