mikeferguson / neato_robot

Drivers and ROS bindings for the Neato XV-11 robot.
43 stars 55 forks source link

Cannot read from robot #7

Closed jmtatsch closed 9 years ago

jmtatsch commented 9 years ago

Hi Mike,

I've tried to get your package running but the node seems to be stuck as soon as anything is read from the robot. The robot in question is a Botvac 80 Fw 3.1 and I'm running Indigo on Os X Yosemite and pyserial (2.7), so there are plenty of things where this could go wrong :(

When I run the driver, it does successfully turn on testmode and starts up ldsrotation. In

def getScanRanges(self):
   line = self.port.readline()

It reads "testmode on" and is stuck.

Shouldn't that be flushed with self.port.flushInput()? Also I'm not sure if readline() correctly identifies the lineendings. Apparently they send \r\n now and \x1a\r\n\x1a for EOF, was that the same for XV11?

miniterm.py /dev/tty.usbmodem1411 115200 -DD
--- Miniterm on /dev/tty.usbmodem1411: 115200,8,N,1 ---
--- Quit: Ctrl+]  |  Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
H\r\nHelp - Without any argument, this prints a list of all possible cmds.\r\nWith a command name, it prints the help for that particular command\r\nClean - Starts a cleaning by simulating press of start button.\r\nClearFiles - Erases Black Box, and other Logs\r\nDiagTest - Executes different test modes. Once set, press Start button to engage. (Test modes are mutually exclusive.)\r\nGetAccel - Get the Accelerometer readings.\r\nGetAnalogSensors - Get the A2D readings for the analog sensors.\r\nGetButtons - Get the state of the UI Buttons.\r\nGetCalInfo - Prints out the cal info from the System Control Block.\r\nGetCharger - Get the diagnostic data for the charging system.\r\nGetDigitalSensors - Get the state of the digital sensors.\r\nGetErr - Get Error Message.\r\nGetLanguage - Gets the UI Language from the robot.\r\nGetLDSScan - Get scan packet from LDS.\r\nGetMotors - Get the diagnostic data for the motors.\r\nGetSchedule - Get the Cleaning Schedule. (24 hour clock format)\r\nGetTime - Get Current Scheduler Time.\r\nGetVersion - Get the version information for the system software and hardware.\r\nGetWarranty - Get the warranty data.\r\nPlaySound - Play the specified sound in the robot.\r\nSetFuelGauge - Set Fuel Gauge Level.\r\nSetMotor - Sets the specified motor to run in a direction at a requested speed. (TestMode Only)\r\nSetTime - Sets the current day, hour, and minute for the scheduler clock.\r\nSetLanguage - Sets the UI Language for the robot.\r\nSetLED - Sets the specified LED to on,off,blink, or dim. (TestMode Only)\r\nSetIEC - Sets the IEC Cleaning Test parameters\r\nSetLCD - Sets the LCD to the specified display. (TestMode Only)\r\nSetLDSRotation - Sets LDS rotation on or off. Can only be run in TestMode.\r\nSetSchedule - Modify Cleaning Schedule.\r\nSetSystemMode - Set the operation mode of the robot. (TestMode Only)\r\nTestMode - Sets TestMode on or off. Some commands can only be run in TestMode.\r\nUpload - Uploads new program to the robot.\r\nSetButton - Simulates a button press.\r\nSetBatteryTest - Sets California Energy Commission 10-CFR-430 Battery Charging System Test mode.\r\n\x1a\r\n\x1aTestMode on\r\n\r\n\x1a\x1asetldsrotation on\r\n\x1a\r\n\x1agetldsscan\r\nAngleInDegrees,DistInMM,Intensity,ErrorCodeHEX\r\n0,438,93,0\r\n1,427,80,0\r\n2,0,80,8021\r\n3,408,102,0\r\n4,401,97,0\r\n5,394,113,0\r\n6,387,194,0\r\n7,379,200,0\r\n8,373,151,0\r\n9,369,121,0\r\n10,364,103,0\r\n11,359,111,0\r\n12,356,119,0\r\n13,352,110,0\r\n14,349,120,0\r\n15,346,132,0\r\n16,343,120,0\r\n17,341,110,0\r\n18,338,117,0\r\n19,337,106,0\r\n20,16724,48,0\r\n21,0,0,8035\r\n22,0,0,8035\r\n23,0,0,8035\r\n24,0,0,8003\r\n25,326,115,0\r\n26,16705,28,0\r\n27,0,0,8035\r\n28,0,0,8035\r\n29,0,0,8035\r\n30,0,0,8035\r\n31,0,0,8003\r\n32,0,0,8035\r\n33,0,0,8035\r\n34,0,0,8035\r\n35,0,0,8003\r\n36,0,0,8035\r\n37,0,0,8035\r\n38,652,57,0\r\n39,0,0,8003\r\n40,0,0,8035\r\n41,0,0,8035\r\n42,0,0,8035\r\n43,0,0,8003\r\n44,16993,18,0\r\n45,0,0,8035\r\n46,0,0,8035\r\n47,0,0,8035\r\n48,0,0,8002\r\n49,346,179,0\r\n50,345,248,0\r\n51,343,414,0\r\n52,343,468,0\r\n53,0,0,8035\r\n54,347,383,0\r\n55,353,314,0\r\n56,361,261,0\r\n57,370,245,0\r\n58,375,201,0\r\n59,381,269,0\r\n60,385,262,0\r\n61,393,162,0\r\n62,401,231,0\r\n63,404,279,0\r\n64,0,0,8002\r\n65,569,127,0\r\n66,0,0,8035\r\n67,0,0,8035\r\n68,0,0,8035\r\n69,0,0,8035\r\n70,0,0,8003\r\n71,0,0,8035\r\n72,0,0,8035\r\n73,0,0,8035\r\n74,0,0,8035\r\n75,0,0,8035\r\n76,0,0,8003\r\n77,0,0,8035\r\n78,0,0,8035\r\n79,0,0,8035\r\n80,0,0,8035\r\n81,0,0,8003\r\n82,0,0,8035\r\n83,0,0,8035\r\n84,0,0,8035\r\n85,0,0,8035\r\n86,0,0,8003\r\n87,0,0,8035\r\n88,0,0,8035\r\n89,0,0,8035\r\n90,0,0,8035\r\n91,0,0,8003\r\n92,0,0,8035\r\n93,1650,36,0\r\n94,1632,218,0\r\n95,1617,524,0\r\n96,1596,307,0\r\n97,0,0,8002\r\n98,0,0,8035\r\n99,0,0,8035\r\n100,819,120,0\r\n101,793,290,0\r\n102,779,374,0\r\n103,768,476,0\r\n104,762,521,0\r\n105,0,0,8002\r\n106,757,600,0\r\n107,758,583,0\r\n108,739,63,0\r\n109,663,24,0\r\n110,648,285,0\r\n111,654,226,0\r\n112,657,183,0\r\n113,2097,16,0\r\n114,0,0,8035\r\n115,0,0,8035\r\n116,1877,16,0\r\n117,0,0,8035\r\n118,1059,66,0\r\n119,1017,52,0\r\n120,979,39,0\r\n121,935,15,0\r\n122,0,15,8021\r\n123,0,0,8035\r\n124,868,37,0\r\n125,881,129,0\r\n126,895,219,0\r\n127,909,330,0\r\n128,920,378,0\r\n129,932,353,0\r\n130,942,377,0\r\n131,953,384,0\r\n132,966,349,0\r\n133,978,306,0\r\n134,992,256,0\r\n135,1146,212,0\r\n136,941,55,0\r\n137,928,137,0\r\n138,914,91,0\r\n139,902,144,0\r\n140,910,116,0\r\n141,897,161,0\r\n142,883,170,0\r\n143,875,227,0\r\n144,983,320,0\r\n145,969,349,0\r\n146,956,391,0\r\n147,943,364,0\r\n148,931,369,0\r\n149,920,402,0\r\n150,908,405,0\r\n151,898,431,0\r\n152,888,420,0\r\n153,878,405,0\r\n154,870,427,0\r\n155,859,453,0\r\n156,853,437,0\r\n157,846,460,0\r\n158,839,481,0\r\n159,832,507,0\r\n160,826,469,0\r\n161,819,500,0\r\n162,814,496,0\r\n163,808,510,0\r\n164,802,514,0\r\n165,798,528,0\r\n166,791,513,0\r\n167,779,323,0\r\n168,766,154,0\r\n169,0,0,8035\r\n170,0,0,8021\r\n171,0,0,8035\r\n172,0,0,8035\r\n173,0,0,8035\r\n174,707,28,0\r\n175,0,0,8003\r\n176,695,729,0\r\n177,689,823,0\r\n178,682,867,0\r\n179,681,911,0\r\n180,681,910,0\r\n181,679,873,0\r\n182,0,0,8002\r\n183,0,0,8002\r\n184,0,0,8003\r\n185,0,0,8002\r\n186,0,0,8002\r\n187,679,874,0\r\n188,674,325,0\r\n189,676,250,0\r\n190,681,916,0\r\n191,682,866,0\r\n192,674,863,0\r\n193,685,425,0\r\n194,774,302,0\r\n195,775,253,0\r\n196,694,94,0\r\n197,695,53,0\r\n198,0,0,8035\r\n199,0,0,8035\r\n200,0,0,8035\r\n201,670,42,0\r\n202,0,0,8002\r\n203,687,148,0\r\n204,694,199,0\r\n205,695,144,0\r\n206,0,0,8002\r\n207,824,483,0\r\n208,831,484,0\r\n209,839,479,0\r\n210,846,454,0\r\n211,853,477,0\r\n212,863,471,0\r\n213,873,456,0\r\n214,879,431,0\r\n215,890,435,0\r\n216,900,410,0\r\n217,912,407,0\r\n218,925,398,0\r\n219,936,394,0\r\n220,950,377,0\r\n221,962,354,0\r\n222,976,366,0\r\n223,992,351,0\r\n224,1006,299,0\r\n225,1024,292,0\r\n226,1041,286,0\r\n227,0,0,8035\r\n228,0,0,8035\r\n229,0,0,8035\r\n230,0,0,8035\r\n231,0,0,8035\r\n232,0,0,8002\r\n233,297,120,0\r\n234,293,176,0\r\n235,16673,106,0\r\n236,283,124,0\r\n237,279,249,0\r\n238,283,367,0\r\n239,291,374,0\r\n240,299,378,0\r\n241,309,322,0\r\n242,0,322,8021\r\n243,1530,61,0\r\n244,1556,20,0\r\n245,0,0,8035\r\n246,0,0,8035\r\n247,0,0,8035\r\n248,0,0,8035\r\n249,0,0,8003\r\n250,0,0,8035\r\n251,2207,17,0\r\n252,2280,33,0\r\n253,2448,31,0\r\n254,2269,11,0\r\n255,2097,13,0\r\n256,1953,12,0\r\n257,1835,19,0\r\n258,1721,22,0\r\n259,1609,35,0\r\n260,1536,297,0\r\n261,1548,50,0\r\n262,0,0,8035\r\n263,0,0,8035\r\n264,0,0,8035\r\n265,0,0,8035\r\n266,0,0,8003\r\n267,4180,21,0\r\n268,4163,27,0\r\n269,4173,28,0\r\n270,4107,16,0\r\n271,0,0,8035\r\n272,0,0,8035\r\n273,0,0,8035\r\n274,0,0,8035\r\n275,0,0,8003\r\n276,0,0,8035\r\n277,0,0,8035\r\n278,0,0,8035\r\n279,0,0,8035\r\n280,0,0,8003\r\n281,2343,25,0\r\n282,2359,50,0\r\n283,2362,77,0\r\n284,2351,90,0\r\n285,2342,40,0\r\n286,1353,48,0\r\n287,2379,57,0\r\n288,2376,89,0\r\n289,2354,38,0\r\n290,0,0,8035\r\n291,1069,24,0\r\n292,0,0,8002\r\n293,2457,75,0\r\n294,2477,83,0\r\n295,2472,76,0\r\n296,2478,33,0\r\n297,0,0,8035\r\n298,2580,13,0\r\n299,0,0,8035\r\n300,2554,9,0\r\n301,0,0,8035\r\n302,0,0,8035\r\n303,0,0,8035\r\n304,0,0,8035\r\n305,0,0,8003\r\n306,1465,12,0\r\n307,1462,33,0\r\n308,1476,35,0\r\n309,1768,7,0\r\n310,0,0,8035\r\n311,1212,41,0\r\n312,3051,34,0\r\n313,3097,35,0\r\n314,0,35,8021\r\n315,0,0,8035\r\n316,0,0,8035\r\n317,0,0,8035\r\n318,0,0,8002\r\n319,0,0,8035\r\n320,0,0,8035\r\n321,0,0,8035\r\n322,0,0,8035\r\n323,0,0,8003\r\n324,0,0,8035\r\n325,0,0,8035\r\n326,0,0,8035\r\n327,0,0,8003\r\n328,0,0,8035\r\n329,0,0,8035\r\n330,0,0,8035\r\n331,0,0,8003\r\n332,0,0,8035\r\n333,0,0,8035\r\n334,0,0,8035\r\n335,0,0,8003\r\n336,0,0,8035\r\n337,0,0,8035\r\n338,0,0,8035\r\n339,0,0,8003\r\n340,0,0,8035\r\n341,0,0,8035\r\n342,4100,15,0\r\n343,0,0,8003\r\n344,3882,33,0\r\n345,0,0,8035\r\n346,0,0,8035\r\n347,0,0,8035\r\n348,0,0,8002\r\n349,17024,37,0\r\n350,16986,49,0\r\n351,16964,48,0\r\n352,558,120,0\r\n353,535,57,0\r\n354,525,165,0\r\n355,508,80,0\r\n356,493,101,0\r\n357,479,89,0\r\n358,465,85,0\r\n359,450,88,0\r\nROTATION_SPEED,5.14\r\n\x1a\r\n\x1a
jmtatsch commented 9 years ago

imbinary fixed the problem in his fork with commit https://github.com/jmtatsch/neato_robot/commit/bf5d2a35aa41ae043fb47bb6777d573035eea097