tapsterbot
tapsterbot copied to clipboard
calibrate failure
Hi Jason,
I followed your steps and after running node bot.js and doing calibrate gives following error
1381103959581 Board Connecting... 1381103959655 Serial Found possible serial port /dev/cu.usbmodemfd121 1381103959656 Board -> Serialport connected /dev/cu.usbmodemfd121 1381103962951 Board <- Serialport ready /dev/cu.usbmodemfd121 1381103962951 Repl Initialized
calibrate() [ 0, 19.999997306409433, 19.999997306409433, 19.999997306409433 ] [ 0, 20.918998038766908, 20.918998038766908, 20.918998038766908 ] undefined [ 0, 21.837425158401306, 21.837425158401313, 21.837425158401313 ] [ 0, 22.755629088045165, 22.755629088045175, 22.755629088045175 ] [ 0, 23.67396257757593, 23.67396257757595, 23.67396257757595 ] [ 0, 24.592781777472137, 24.592781777472176, 24.592781777472176 ] [ 0, 25.51244735346581, 25.51244735346585, 25.51244735346585 ] [ 0, 26.433325652625896, 26.433325652625946, 26.433325652625946 ] [ 0, 27.355789932088012, 27.35578993208806, 27.35578993208806 ] [ 0, 28.280221662852167, 28.280221662852217, 28.280221662852217 ] [ 0, 29.20701192253976, 29.20701192253981, 29.20701192253981 ] [ 0, 30.13656289278173, 30.13656289278178, 30.13656289278178 ] [ 0, 31.0692894790604, 31.06928947906044, 31.06928947906044 ] [ 0, 32.00562107342385, 32.0056210734239, 32.0056210734239 ] [ 0, 32.94600348362525, 32.946003483625304, 32.946003483625304 ] [ 0, 33.89090105602969, 33.89090105602973, 33.89090105602973 ] [ 0, 34.84079902422503, 34.84079902422507, 34.84079902422507 ] [ 0, 35.79620612086168, 35.79620612086175, 35.79620612086175 ] [ 0, 36.75765749706603, 36.75765749706611, 36.75765749706611 ] [ 0, 37.725718002137214, 37.72571800213732, 37.72571800213732 ] [ 0, 38.70098588654256, 38.70098588654266, 38.70098588654266 ] [ 0, 39.68409700399441, 39.684097003994495, 39.684097003994495 ] [ 0, 40.67572960430076, 40.67572960430087, 40.67572960430087 ] [ 0, 41.67660982863174, 41.67660982863183, 41.67660982863183 ] [ 0, 42.687518044031926, 42.687518044032025, 42.687518044032025 ] [ 0, 43.709296186041804, 43.709296186041875, 43.709296186041875 ] [ 0, 44.742856319351496, 44.74285631935159, 44.74285631935159 ] [ 0, 45.789190679487106, 45.78919067948723, 45.78919067948723 ] [ 0, 46.84938352776067, 46.84938352776077, 46.84938352776077 ] [ 0, 47.9246252429081, 47.92462524290817, 47.92462524290817 ] [ 0, 49.016229194223875, 49.016229194223946, 49.016229194223946 ] [ 0, 50.12565210442943, 50.12565210442951, 50.12565210442951 ] [ 0, 51.25451883327433, 51.25451883327442, 51.25451883327442 ] [ 0, 52.404652820619106, 52.404652820619205, 52.404652820619205 ] 1381103999709 Board
string_decoder.js:109
charStr += buffer.toString(this.encoding, 0, end);
^
RangeError: toString() radix argument must be between 2 and 36
at Number.toString (native)
at StringDecoder.write (string_decoder.js:109:21)
at ReadStream.onData (readline.js:839:39)
at ReadStream.EventEmitter.emit (events.js:95:17)
at Board.
When I try avoid calibration, and try tapping on control webpage I get following error
1381104324488 Board Connecting... 1381104324561 Serial Found possible serial port /dev/cu.usbmodemfd121 1381104324562 Board -> Serialport connected /dev/cu.usbmodemfd121 DEVICE: { foo: 'bar', height: 898, width: 1335 } 1381104327855 Board <- Serialport ready /dev/cu.usbmodemfd121 1381104327855 Repl Initialized
Down event { x: 210, y: 297 }
/Users/ub/arduino/workspace/tapsterbot/src/bot.js:158
b = translationMatrix.elements[1][0],
^
TypeError: Cannot read property '0' of undefined
at deviceGo (/Users/ub/arduino/workspace/tapsterbot/src/bot.js:158:38)
at Socket.
Your timely response is much appreciated.
- rgds, Umesh
This error:
RangeError: toString() radix argument must be between 2 and 36
Occurs when toString() is called on a number with an invalid radix. I've seen this before when two operations are trying to control process.stdin. What version of Johnny-Five is currently in node_modules?
@ubatra13 in node_modules/johnny-five/lib/board.js, find this line: process.stdin.emit( "data", 1 );
(it should be 304) and comment it out. Then run the calibration program and let me know what happens.
@rwaldron now I am getting different error while taping on control screen
node bot.js 1381110839728 Board Connecting... 1381110839838 Serial Found possible serial port /dev/cu.usbmodemfd121 1381110839839 Board -> Serialport connected /dev/cu.usbmodemfd121 1381110843132 Board <- Serialport ready /dev/cu.usbmodemfd121 DEVICE: { foo: 'bar', height: 460, width: 320, orientation: 0 } DEVICE: { foo: 'bar', height: 898, width: 1335 } DEVICE: { foo: 'bar', height: 898, width: 1335 } Down event { x: 203, y: 297 }
/Users/ub/arduino/workspace/tapsterbot/src/bot.js:158
b = translationMatrix.elements[1][0],
^
TypeError: Cannot read property '0' of undefined
at deviceGo (/Users/ub/arduino/workspace/tapsterbot/src/bot.js:158:38)
at Socket.
@rwaldron also, when calibrating I get this
node bot.js 1381111111889 Board Connecting... 1381111111962 Serial Found possible serial port /dev/cu.usbmodemfd121 1381111111963 Board -> Serialport connected /dev/cu.usbmodemfd121 1381111115258 Board <- Serialport ready /dev/cu.usbmodemfd121 DEVICE: { foo: 'bar', height: 460, width: 320, orientation: 0 } calibrate() 1381111140745 Repl Initialized
/Users/ub/arduino/workspace/tapsterbot/src/bot.js:79 return ik.forward(servo1.last.degrees, servo2.last.degrees, servo3.last.degr ^ ReferenceError: servo1 is not defined at position (/Users/ub/arduino/workspace/tapsterbot/src/bot.js:79:21) at moveZ (/Users/ub/arduino/workspace/tapsterbot/src/bot.js:152:6) at Socket.
(/Users/ub/arduino/workspace/tapsterbot/src/bot.js:140:5) at Socket.EventEmitter.emit as $emit at SocketNamespace.handlePacket (/Users/ub/arduino/workspace/tapsterbot/node_modules/socket.io/lib/namespace.js:335:22) at Manager.onClientMessage (/Users/ub/arduino/workspace/tapsterbot/node_modules/socket.io/lib/manager.js:487:38) at WebSocket.Transport.onMessage (/Users/ub/arduino/workspace/tapsterbot/node_modules/socket.io/lib/transport.js:387:20) at Parser. (/Users/ub/arduino/workspace/tapsterbot/node_modules/socket.io/lib/transports/websocket/hybi-16.js:39:10) at Parser.EventEmitter.emit (events.js:95:17) at finish (/Users/ub/arduino/workspace/tapsterbot/node_modules/socket.io/lib/transports/websocket/hybi-16.js:288:16)
@rwaldron just to clarify because I guess I posted two issues here,
Issue 1. when calibrating for first time it went fine prints "13811111**** Repl Initialized" and then when trying out http://localhost:8011/control, I get the error I mentioned above.
/Users/ub/arduino/workspace/tapsterbot/src/bot.js:158 b = translationMatrix.elements[1][0], ^ TypeError: Cannot read property '0' of undefined
Issue 2. When I try calibrating second time, I got error as
1381111140745 Repl Initialized
/Users/ub/arduino/workspace/tapsterbot/src/bot.js:79 return ik.forward(servo1.last.degrees, servo2.last.degrees, servo3.last.degr ^ ReferenceError: servo1 is not defined
but Issue 2, I am not able to reproduce it now; so we can ignore it for now in case you know what it is?
I think for me, if issue 1 is resolved I am good to proceed.
@rwaldron please ignore, finally, it worked, I was doing calibrate step wrong, very thanks for your help.