Commit Graph

270 Commits

Author SHA1 Message Date
Edgar O Silva 1f99f011bc Fix typo in path call. 2013-11-12 12:58:51 -06:00
Edgar O Silva 0ae37390fe Remove @self references in favor of just @ and fix set mode to udpate the obj attr when actually changing the mode. 2013-11-12 12:47:50 -06:00
Edgar O Silva 1fd0a13347 Add missing param emitConnect. 2013-11-12 12:34:15 -06:00
Edgar O Silva 5fa0177d90 Fx missing param in setModeCallback. 2013-11-12 12:26:52 -06:00
Edgar O Silva 11fda85e56 Refactor digital pin. 2013-11-12 11:47:25 -06:00
Ron Evans 2a72ebbf6f Merge pull request #29 from hybridgroup/20-raspi-adaptor
20 raspi adaptor with GPIO support.
2013-11-12 10:50:08 -08:00
Edgar O Silva 04630c6420 Updating unexport path to use function call. 2013-11-12 09:37:15 -06:00
Edgar O Silva caf3cc0790 Make sure the pin mode is setup even if the file already exists. 2013-11-11 18:40:59 -06:00
Edgar O Silva 661b6815d1 Fixes disconnect pins by making last IO calls sync and validates for existance of pin files. 2013-11-11 18:36:54 -06:00
Edgar O Silva d65ebdd2be Fixes issue with undefined path in digital pin. 2013-11-11 18:09:33 -06:00
Edgar O Silva f71c24ff0a Added pin number to emit close event. 2013-11-11 14:33:36 -06:00
Edgar O Silva c47e3db26d Fox indenting error. 2013-11-11 13:44:48 -06:00
Edgar O Silva 9798fba74f Refactor GPIO file paths, added validation to check for existance of GPIO pins (they have already been setup), added new sync disconnect. 2013-11-11 13:34:43 -06:00
Andrew Stewart 6120e6da0b More consistent internal representation of components 2013-11-11 11:33:07 -05:00
Andrew Stewart 1cd5883a3f Clean up tests 2013-11-11 11:28:37 -05:00
Andrew Stewart 88ab1a2d34 Properly organize supporting classes for tests 2013-11-11 11:09:42 -05:00
Andrew Stewart 31bfa85fa8 Simplify readline setup for Windows users 2013-11-11 11:09:41 -05:00
Andrew Stewart b5a4854533 Add tests for Cylon#findRobotConnection 2013-11-08 17:33:29 -07:00
Andrew Stewart b7add10cb4 Add tests for Cylon#findRobotDevice() 2013-11-08 17:16:17 -07:00
Andrew Stewart 1778312e6c Tests for Cylon#api 2013-11-08 10:29:17 -07:00
Andrew Stewart da5cb27c21 The Future's So Bright, I Gotta Wear Shades
I apologize for this commit message but cylon-specs + this was just too perfect.

Anyways, have gotten Cylon robot specs working now. For some reason by the time
the spec runner gets around to running cylon.spec, inside cylon.js Robot has
been redefined to an empty object '{}'.

This resulted in a "TypeError: object is not a function on constructor" error.

So to solve this I moved the require() for 'robot' inside the Cylon.robot()
method. This shouldn't reload code thanks to Node's require cache, but will
properly assign Robot when instantiating a new one.
2013-11-08 10:03:16 -07:00
Andrew Stewart 620351c7c2 Allow configuration of API options 2013-11-06 16:13:35 -08:00
Andrew Stewart 7543f834e4 Merge branch 'master' into literate-coffeescript
* master: (21 commits)
  Removes unnecessary IO class.
  Fixes raspi button example typo.
  Updated DigitalPin and raspi_button example.
  Adding interval reads to digitalRead.
  Added new Digital read example for raspi, updated digitalRead in lib.
  Refactored DigitalRead and setup mode to only emit connection event on connect.
  Added new DigitalPin to Cylon core to use in adaptors, for real.
  Added new DigitalPin to Cylon core to use in adaptors.
  Added new example for raspi adaptor.
  Updated digital pin lib and example.
  Fixed missing mode variable in digital pin.
  Remove logging and update example.
  Change events and update example in digital pin.
  Added close for GPIO and updated negative ifs
  Change event triggers in callbacks to fat arrows to keep obj scope.
  Removed self and changed example.
  Updated IO and digital pin to use events.
  Fix bug in GPIO example.
  Adde pure GPIO example and updated digital pin lib
  Added new LinuxIO DigitalPin library.
  ...
2013-11-06 15:14:30 -08:00
Edgar O Silva 0b02822f6a Added debugging log to unexport pins command. 2013-11-06 16:52:12 -06:00
Edgar O Silva c24601139f Removes unnecessary IO class. 2013-11-06 15:04:25 -06:00
Edgar O Silva ff978f3a0d Updated DigitalPin and raspi_button example. 2013-11-06 14:20:33 -06:00
Edgar O Silva 250a0d0166 Adding interval reads to digitalRead. 2013-11-06 14:20:33 -06:00
Edgar O Silva c370041329 Added new Digital read example for raspi, updated digitalRead in lib. 2013-11-06 14:20:33 -06:00
Edgar O Silva 9c0ef5408c Refactored DigitalRead and setup mode to only emit connection event on connect. 2013-11-06 14:20:33 -06:00
Edgar O Silva 2bcdd9f683 Added new DigitalPin to Cylon core to use in adaptors, for real. 2013-11-06 14:20:33 -06:00
Edgar O Silva 0cec5a3822 Added new DigitalPin to Cylon core to use in adaptors. 2013-11-06 14:20:33 -06:00
Edgar O Silva b03019544b Updated digital pin lib and example. 2013-11-06 14:20:33 -06:00
Edgar O Silva 3b078321f1 Fixed missing mode variable in digital pin. 2013-11-06 14:20:33 -06:00
Edgar O Silva 115a1bb405 Remove logging and update example. 2013-11-06 14:20:33 -06:00
Edgar O Silva 81bd0adb83 Change events and update example in digital pin. 2013-11-06 14:20:32 -06:00
Edgar O Silva 3dec21c459 Added close for GPIO and updated negative ifs 2013-11-06 14:20:32 -06:00
Edgar O Silva 33f8c95edc Change event triggers in callbacks to fat arrows to keep obj scope. 2013-11-06 14:20:32 -06:00
Edgar O Silva 87a75745dd Removed self and changed example. 2013-11-06 14:20:32 -06:00
Edgar O Silva 3bdecf665a Updated IO and digital pin to use events. 2013-11-06 14:20:32 -06:00
Edgar O Silva 239056fa65 Fix bug in GPIO example. 2013-11-06 14:20:32 -06:00
Edgar O Silva 831fbe4069 Adde pure GPIO example and updated digital pin lib 2013-11-06 14:20:32 -06:00
Edgar O Silva 6d694f85b5 Added new LinuxIO DigitalPin library. 2013-11-06 14:20:32 -06:00
Andrew Stewart 866e079830 Merge branch 'master' into literate-coffeescript
* master:
  Revise proxy to use objects instead of prototypes
2013-11-06 09:43:09 -08:00
Andrew Stewart 8be896a5af Remove duplicate word 2013-11-06 09:31:56 -08:00
deadprogram 041da7acc8 Handle exit event, by stopping devices and disconnecting connections 2013-11-05 21:34:23 -08:00
deadprogram bb4859d83d Revise proxy to use objects instead of prototypes 2013-11-05 20:08:03 -08:00
Andrew Stewart d184528312 Document API with Literate Coffeescript 2013-11-05 15:14:03 -08:00
Andrew Stewart d9287be2b1 WIP on Literate Coffeescript version of api.coffee 2013-11-05 12:56:30 -08:00
Andrew Stewart f423758310 Properly set up websockets 2013-11-05 10:51:11 -08:00
Andrew Stewart fa53720e17 API now functions correctly 2013-11-05 10:45:14 -08:00
Andrew Stewart 9b2b405f0d Correct bug with defineEvent() 2013-11-05 10:43:25 -08:00
Andrew Stewart bba7ef1f4d Refactor API routes to be more like Artoo API 2013-11-04 15:15:59 -08:00
Andrew Stewart 82e85e04f3 Remove pointless namespacing of API 2013-11-04 14:26:46 -08:00
Andrew Stewart fb8c8acca8 Namespace Port class 2013-11-04 12:21:36 -08:00
Andrew Stewart eda6f9db76 Namespace Device class 2013-11-04 12:21:28 -08:00
Andrew Stewart ae666f67dd Namespace Connection class 2013-11-04 12:13:40 -08:00
Andrew Stewart 9d48cba3cf Namespace Robot class 2013-11-04 11:57:27 -08:00
Andrew Stewart 4615ac7c71 Add TomDoc to Robot 2013-11-04 11:18:37 -08:00
Andrew Stewart ac8d888fd6 Add TomDoc to Port class 2013-11-04 11:18:37 -08:00
Andrew Stewart 9692b4fd90 Commenting for Logger classes 2013-11-03 18:09:28 -08:00
Andrew Stewart e880ff7454 Add TomDoc for Device 2013-11-03 17:56:40 -08:00
Andrew Stewart a0fa9de948 Add TomDoc to Connection 2013-11-03 01:36:31 -07:00
Andrew Stewart 9e908f4027 Add TomDoc to Cylon 2013-11-03 01:36:24 -07:00
Andrew Stewart 1056b91c60 Comment new methods in Basestar 2013-11-03 00:29:47 -07:00
Andrew Stewart 616bbbeee3 TomDoc Number monkeypatches 2013-11-02 22:55:08 -07:00
Ron Evans 333327aa63 Merge pull request #18 from hybridgroup/api
Add API backend
2013-11-01 17:44:40 -07:00
deadprogram ff3c1c4270 Refactor Basestar event proxy functions 2013-11-01 15:56:50 -07:00
Andrew Stewart a45dd83c51 Server now correctly identifies the URL it's listening on 2013-11-01 15:25:49 -07:00
Andrew Stewart dc48cb3be5 Merge branch 'master' into api
* master:
  Updated Basestar to include some proxy event functions and updated sphero messages example.
  Pure JS drone example
  Better class oriented code
  Adding some more examples
  Correct README typo
  Adding servo driver example.
  Fix issue with currentSpeed having to go through driver.
  Added speed output to the example.
  Added examples for motor speed and led brightness.
2013-11-01 15:23:43 -07:00
Andrew Stewart 3cb8d91af6 Switch to express.io and add websocket route 2013-11-01 15:22:50 -07:00
Andrew Stewart 2c873e374a Add commands to handle fetching connections
- Adds method for fetching all connections belonging to a Robot
- Adds method for fetching a specific connection belonging to a Robot
2013-11-01 11:22:25 -07:00
Andrew Stewart e9a4f25ccd Add method to run a command for a particular device 2013-11-01 11:13:03 -07:00
Andrew Stewart b9560b159c WIP on runDeviceCommand 2013-10-31 16:43:20 -07:00
Edgar O Silva a73a790327 Updated Basestar to include some proxy event functions and updated sphero messages example. 2013-10-31 16:15:39 -06:00
Andrew Stewart d9c0229a62 Add API method for fetching device commands 2013-10-31 14:48:47 -07:00
Andrew Stewart fbadbac5c6 Small method rename 2013-10-31 13:51:53 -07:00
Andrew Stewart 54e5226dd6 Callbacks are cool 2013-10-31 13:36:28 -07:00
Andrew Stewart 1b4e05575c Add method for fetching a specific device belonging to a Robot 2013-10-31 12:27:00 -07:00
Andrew Stewart 65a2e20959 Add /robots/:robotid and /robots/:robotid/devices 2013-10-30 17:41:16 -07:00
Andrew Stewart 2a91066864 Start to API and fetching of all Robots 2013-10-30 16:42:50 -07:00
Andrew Stewart 05c8ad3bdc Add methods to export data from Robot/Device/Connection 2013-10-30 16:40:07 -07:00
Andrew Stewart a58ed257b8 Merge branch 'master' into api
* master:
  Need a line break
  Updates for version 0.2.0
  Removing DriverName param in favor of opts, which already contains it.
  Adding analog sensor support to cylon GPIO.
2013-10-30 09:58:50 -07:00
Edgar O Silva cf6d2c88bc Removing DriverName param in favor of opts, which already contains it. 2013-10-29 18:15:41 -06:00
Edgar O Silva 2e0d0423bb Adding analog sensor support to cylon GPIO. 2013-10-29 17:56:57 -06:00
Andrew Stewart 43354cde41 Start for Cylon API Server 2013-10-29 16:56:19 -07:00
Andrew Stewart 3f494dd23d Basestar extends EventEmitter 2013-10-29 10:59:09 -07:00
Andrew Stewart 1c3d2236a0 Add Basestar class for use in external modules 2013-10-29 10:43:11 -07:00
deadprogram 504e51bd28 Can now attach users own functions to robot at will 2013-10-28 23:53:30 -07:00
deadprogram d87c63dc26 Cleanup startConnections and startDevices to ensure proper async startup 2013-10-28 18:58:06 -07:00
Andrew Stewart 76cfbbe765 Correctly proxy methods for classes 2013-10-28 17:48:29 -07:00
deadprogram 97b7335784 Merged better startup routine 2013-10-28 15:31:39 -07:00
Andrew Stewart 21624ffacd Use proxyFunctionsToObject for Connection and Device 2013-10-28 11:51:18 -07:00
Andrew Stewart 01b2d84bd1 Add method to proxy functions between objects 2013-10-28 11:51:03 -07:00
deadprogram 16a049f586 Pass requested driver name to driver module, for those that contain multiple drivers 2013-10-26 23:03:12 -07:00
deadprogram 08da7d3390 Some logging for debug mode only 2013-10-26 00:04:42 -07:00
deadprogram e43bf8ad45 Works for arduino blink, with new async hotness 2013-10-25 23:27:39 -07:00
deadprogram 5e6bf8763b Devices need pin 2013-10-25 20:29:11 -07:00
Edgar O Silva 450a87e17e Fixes issue with events not being triggered in drivers because .start was not being called to setup. 2013-10-25 19:49:35 -05:00
deadprogram fea55228cc Added ping driver for testing 2013-10-25 13:11:09 -07:00
deadprogram 7a67dbfd22 Namespace all the adaptors 2013-10-25 13:01:18 -07:00
deadprogram 69a476dfbf Correct missing command in loopback test adaptor 2013-10-25 12:52:55 -07:00
Andrew Stewart 1064e75128 Clear up scope 2013-10-24 17:26:36 -07:00
Andrew Stewart 612ddce142 Connections don't need direct binding, just Devices 2013-10-24 14:46:53 -07:00
Edgar O Silva 06f307afc9 WIP on collision detection and event emitter. 2013-10-24 16:27:37 -05:00
Edgar O Silva cc24e89249 WIP on event emitter for device and connection. 2013-10-24 16:26:14 -05:00
Andrew Stewart 31aa6e4901 Fix scope for performing work 2013-10-24 12:54:16 -07:00
deadprogram 10bccd896d A bit more cleanup of self 2013-10-24 00:50:53 -07:00
deadprogram f8eb77c959 Remove the extra messages 2013-10-24 00:32:35 -07:00
deadprogram dc4d3caa6c Calling into the driver 2013-10-24 00:24:55 -07:00
deadprogram a6d29ecbdd Can proxy commands from connection to associated adaptor 2013-10-23 23:18:19 -07:00
deadprogram b8371232d1 Proxy commands into device from associated driver 2013-10-23 23:02:54 -07:00
Andrew Stewart 29515adea7 Fix driver-related issues 2013-10-23 21:29:17 -07:00
Ron Evans abd742df3f Merge pull request #5 from hybridgroup/singleton
Master singleton class
2013-10-23 20:01:07 -07:00
Andrew Stewart 5f83d2f626 Easier singleton generation 2013-10-23 19:51:40 -07:00
Edgar O Silva 015ad3823c Move self = this into instance scope. 2013-10-23 20:40:03 -05:00
Andrew Stewart b8af863aad Switch to singleton robot Master 2013-10-23 18:40:00 -07:00
Edgar O Silva e8095a2ffd Fixes issue with connection port not being found in adaptor. 2013-10-23 20:27:15 -05:00
Andrew Stewart 0e5f27f1c6 Allow for similar hooking into drivers 2013-10-23 16:36:04 -07:00
Andrew Stewart 2c6d7ea7c3 Pass connection when requiring adaptors 2013-10-23 15:32:20 -07:00
Andrew Stewart 2c34f4c77e Fix issues with registerAdaptor 2013-10-23 15:12:53 -07:00
Andrew Stewart 4a57300d32 Fix test fails 2013-10-23 14:01:48 -07:00
Andrew Stewart 82c530fe5b Example of using cylon-sphero adaptor 2013-10-23 13:27:23 -07:00
Andrew Stewart ecdc417a58 Revise Logger to accept multiple arguments 2013-10-23 12:23:10 -07:00
Andrew Stewart 9452739244 Add addProxy() method to Adaptor class 2013-10-23 12:18:20 -07:00
Andrew Stewart f0ca9ee60b Use fat arrows (=>) to simplify scope management 2013-10-23 11:46:16 -07:00
Andrew Stewart bf4d42970e Proper initialization of adaptors 2013-10-23 11:10:52 -07:00
Andrew Stewart 541d70b66d Correctly set up loopback adaptor 2013-10-23 10:10:25 -07:00
deadprogram 72c357b64b Adding back comments line 2013-10-23 09:18:45 -07:00
deadprogram 7c551f41c6 Code runs, tests fail 2013-10-23 09:10:29 -07:00
deadprogram b3131fb0b6 More progress now just need correct export 2013-10-23 08:59:32 -07:00
deadprogram 8252d38a5e WIP on dynamic loading of adaptor and driver modules 2013-10-23 08:38:00 -07:00
deadprogram 132282d4c2 Much along the way to adaptor/driver registration and loading 2013-10-22 23:23:52 -07:00
deadprogram 8b390cc486 Resolve merge conflicts with master 2013-10-22 22:13:36 -07:00
deadprogram ca59493a12 Proper initialization of device 2013-10-22 22:06:49 -07:00
Andrew Stewart da95bccdfa Add global Logger object 2013-10-22 21:46:02 -07:00
deadprogram 60a7363985 Correct reference to parent robot 2013-10-22 21:02:25 -07:00
Andrew Stewart 7ab34693fa Simplify starting work 2013-10-22 20:29:24 -07:00
deadprogram 3b83b5d0f7 Simplify robot init even further 2013-10-22 19:22:09 -07:00
deadprogram ce154f8d25 Removing commentted line 2013-10-22 18:55:27 -07:00
deadprogram 03febed1bb Knowledge of self when working 2013-10-22 17:51:36 -07:00
deadprogram 1f93cee823 Resolve merge conflicts 2013-10-22 16:42:25 -07:00
deadprogram 48db540d37 Connections and Devices should belong to a robot 2013-10-22 16:39:49 -07:00
Andrew Stewart de79700427 Correct and consistent context for work functions
Also corrects context(this) issues for every() and after()
2013-10-22 16:34:27 -07:00
Andrew Stewart 30db92328d Properly init/start connections and devices 2013-10-22 16:33:36 -07:00
Andrew Stewart bc9dd05cbc Fix example and globally namespace utility functions 2013-10-22 14:09:23 -07:00
deadprogram 2e74b8bdef Starting to build the object chain 2013-10-22 13:30:16 -07:00
deadprogram af4636598a WIP on device 2013-10-22 13:13:55 -07:00
deadprogram f03eac212e Resolve merge conflicts 2013-10-22 12:23:57 -07:00
deadprogram 8b1f342964 Correct syntax outside of tests 2013-10-22 12:21:09 -07:00
Andrew Stewart ea90ed8889 Add utility functions and monkey-patches 2013-10-22 11:59:53 -07:00