Repository navigation
Unknown mode detected #64
Copy link
Copy link
Open
Description
Hi, I'm using Roomba 642 and a simple USB-serial connection to connect it to my raspberry pi 3. When first I run roslaunch ca_driver create_2.launch, it outputs [CREATE] Unknown mode detected but I ignore it. Then, I run teleop_joy_keyboard and successfully control my roomba with the keyboard. However, when I try it again, this time when I run roslaunch ca_driver create_2.launch, it gives me an error as below and my roomba freezes. I'm running create_autonomy on ROS kinetic.
pi@pi-desktop:~/catkin_ws$ roslaunch ca_driver create_2.launch
... logging to /home/pi/.ros/log/93e6802c-306c-11ea-85c7-b827eba5a161/roslaunch-pi-desktop-2378.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
xacro.py is deprecated; please use xacro instead
started roslaunch server http://pi-desktop:44355/
SUMMARY
========
PARAMETERS
* /ca_driver/base_frame: base_footprint
* /ca_driver/dev: /dev/ttyUSB0
* /ca_driver/latch_cmd_duration: 0.2
* /ca_driver/loop_hz: 10.0
* /ca_driver/odom_frame: odom
* /ca_driver/publish_tf: True
* /ca_driver/robot_model: CREATE_2
* /robot_description: <?xml version="1....
* /rosdistro: kinetic
* /rosversion: 1.12.14
NODES
/
ca_driver (ca_driver/ca_driver)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
ROS_MASTER_URI=http://localhost:11311
process[ca_driver-1]: started with pid [2431]
process[robot_state_publisher-2]: started with pid [2438]
[ INFO] [1578305369.481359865]: [CREATE] "CREATE_2" selected
[ INFO] [1578305370.552198949]: [CREATE] Connection established.
[ INFO] [1578305370.553044573]: [CREATE] Battery level 49.81 %
[ INFO] [1578305370.808227190]: [CREATE] Ready.
[ERROR] [1578305370.809554949]: [CREATE] Unknown mode detected
[ERROR] [1578305370.909520832]: [CREATE] Unknown mode detected
[ERROR] [1578305371.009491455]: [CREATE] Unknown mode detected
[ERROR] [1578305371.110775420]: [CREATE] Unknown mode detected
[ERROR] [1578305371.209784284]: [CREATE] Unknown mode detected
[ERROR] [1578305371.309791583]: [CREATE] Unknown mode detected
[ERROR] [1578305371.410613726]: [CREATE] Unknown mode detected
[ERROR] [1578305371.509811808]: [CREATE] Unknown mode detected
[ERROR] [1578305371.609841555]: [CREATE] Unknown mode detected
[create::Serial] serial error - End of file
[ERROR] [1578305371.709839584]: [CREATE] Unknown mode detected
[FATAL] [1578305371.711663644]: [CREATE] Runtime error: write: Input/output error
[ INFO] [1578305371.712741767]: [CREATE] Destruct sequence initiated.
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): write: Input/output error
[ca_driver-1] process has died [pid 2431, exit code -6, cmd /home/pi/catkin_ws/devel_isolated/ca_driver/lib/ca_driver/ca_driver __name:=ca_driver __log:=/home/pi/.ros/log/93e6802c-306c-11ea-85c7-b827eba5a161/ca_driver-1.log].
log file: /home/pi/.ros/log/93e6802c-306c-11ea-85c7-b827eba5a161/ca_driver-1*.log
I really hope you can help me with this error. Thanks!
Reactions are currently unavailable
Activity
jacobperron commentedon Feb 10, 2021
Apologies for not replying sooner. Seeing that "unknown mode detected" error is concerning. It means that it is not correctly reading packets over serial. This probably also explains the driver crashing unexpectedly.
I suggest starting and stopping the driver to try and get the Create into the OFF state (or trying a hard reset by holding down the power button until you hear a reset sound).
I'm going to close this since it seems to be an issue unique to your robot. But feel free to keep commenting if the issue persists (or you found a solution!).
GrobaxGrappleBlast commentedon Mar 16, 2021
i am experiencing a similar issue with roomba 675, unknown mode detected, I have no idea how to handle the issue. seeing this closed is troubeling since its clearly not an isolated case
jacobperron commentedon Mar 16, 2021
@GrobaxGrappleBlast Thanks for reporting, it's good to know it may not be an isolated issue.
I don't have a Roomba 6xx, and not able to reproduce. Have you tried resetting the robot as I suggested above?
[-]Destruct sequence initiated[/-][+]Unknown mode detected[/+]vinnnyr commentedon May 22, 2021
Just chiming in here, I have gotten this in the
foxyport as well, but can get the robot to move with some sequence of restarting the robot and launching the driver. I also have a 600 series robot. Is there some information we should report back to help further drill down this issue?hypertechnic commentedon Oct 14, 2021
+1, same "unknown mode detected" error on 675, running melodic on jetson nano
blaine141 commentedon Nov 12, 2021
+1, same "unknown mode detected" error on 694, running kinetic on Raspberry Pi Zero W. I'm going to see if I can find out why only that command is failing.
eddiem3 commentedon Jan 15, 2022
Just happened to me on a 694 w/ a Raspberry PI 3B on melodic. After the unknown mode error started, the Roomba shut off. I think it's bricked now :/
blaine141 commentedon Jan 15, 2022
Hey! A fellow 694! I will say I've been using this code with a 694 and while I do get the message, I've never had any negative consequences and definitely never bricked it
eddiem3 commentedon Jan 15, 2022
Haha yes Team 694! It came back on after I plugged the MDIN back in and ran the launch file again go figure. It still isn't acting the same so I'm trying to factory reset it. You were able to eventually use this package even with the error?
blaine141 commentedon Jan 15, 2022
5 remaining items
process1183 commentedon Feb 1, 2022
Right, I also didn't think mode
4was valid (and checked the spec.) I didn't see a/diagnostics_aggtopic, but there is a plain/diagnosticstopic. Here's one of the messages:I definitely appear to be getting corrupted packets... I can also try directly attaching my laptop to the Roomba's serial port, as you suggested, and running the
create_driverfrom there.process1183 commentedon Feb 1, 2022
Ok, so I connected the Roomba 690 to my laptop via a SparkFun Beefy 3 FTDI board and ran
ros2 run create_driver create_driver. I got the same behavior as on the RPi-... Unknown mode (4) detected. However this time I was not seeing any corrupted packets reported in the/diagnosticstopic, even after letting it run for a few minutes:I also modified a copy of the
battery_levelexample fromlibcreateto just report the mode, and saw that it reported mode2at first, then began reporting mode4... which is odd. Here's the console output from that experiment:And the modified example (
mode.cpp):jacobperron commentedon Feb 1, 2022
My only other thought at the moment is to try reducing the number of packets being requested in the serial stream, e.g. by commenting out any unused data here:
https://github.com/AutonomyLab/libcreate/blob/1563e2b3e180e55baa5fcc4cef147cb333227a5c/src/data.cpp#L13-L45
Here was the most recent change that adding an additional packet for Create 2 era models (which you could also try reverting): AutonomyLab/libcreate@850b011#diff-009fc4b513f11ceea77f7c4c20a542fa5e707cf8936ace1fd8fdff68ef328915
jacobperron commentedon Feb 1, 2022
@process1183 When you say you are using "v2.0.0" for libcreate, are you actually using the tag 2.0.0 or the head of
master? I would be sure to try the tag and check if the issue persists.process1183 commentedon Feb 2, 2022
@jacobperron I was using the head of
masterforlibcreate, not the2.0.0tag- my apologies for the confusion. I switched to the2.0.0tag forlibcreateand got some Boost errors during build. I temporarily resolved the Boost problem with:However, that lead to problems building the
foxybranch ofcreate_robotwhich I resolved with:I was able to get everything to build using the
2.0.0tag oflibcreate, but I am still seeing the same behavior as as before. I also tweaked themode.cppto set and report modes 1-3 (still on the2.0.0tag oflibcreate.) After setting a mode, the mode reported bygetMode()is off by one:The new
mode.cpp:I tried commenting out all but
ID_OI_MODE,ID_LEFT_ENC, andID_RIGHT_ENCindata.cppand re-runningmode.cpp, but still saw the same 'off by one' modes. The 850b011a55a04d87569d26f6a264b36a5857f33a commit is not present on this2.0.0tag, so I can't revert that :)process1183 commentedon Feb 6, 2022
I've done some more digging and I don't think this is a problem with
libcreateorcreate_driver. I attached a logic analyzer to the Roomba's serial port and re-ran themode.cppcode. After sending opcode132, the OI mode packet in the sensor stream shows4. This appears to be a Roomba firmware bug, and is present in fw versions3.2.47and3.5.62(latest.)Here's a screenshot of one of the sensor stream packets after sending opcode

132:jacobperron commentedon Feb 15, 2022
Do you think it's safe to ignore the bogus mode value? We could add an option to the driver to workaround the firmware bug by either fixing the off-by-one-error or not killing the program if an unexpected mode is received.
vinnnyr commentedon Feb 16, 2022
I also wonder if we can get iRobot to look into this supposed firmware bug. Should I try to open a support ticket with them? (I can fully appreciate that this is not necc. a support use case 😂 )
Add option for OI mode reporting bug workaround
Add parameter to enable the OI mode reporting bug workaround
process1183 commentedon Feb 17, 2022
@vinnnyr It probably wouldn't hurt to try to get iRobot to look into this possible bug. I have also opened a support ticket with them briefly explaining this issue and linking to this thread.
@jacobperron I think it's safe to add an option to
libcreateandcreate_driverto enable the mode reporting workaround, since the OI Mode reported in the sensor stream is consistently off-by-one. I have added this option to themode_report_workaroundbranch in my forks oflibcreateandcreate_robot. ( See commits process1183/libcreate@33066aa and process1183@24b60d7 ). Depending on iRobot's response to the support ticket, we can either wait for them to fix the firmware, or I can open a pull request for my workaround option.process1183 commentedon Mar 29, 2022
Apologies for the long follow-up delay. My initial OI bug ticket was passed to iRobot's Advanced Technical Support Team and one of the team members responded this morning saying, "Our team of developers got back to me informing me that at the moment we don't support the OI spec in the Wi-Fi robots." So the 6xx OI mode reporting bug is unlikely to be fixed.
jacobperron commentedon Apr 1, 2022
I'm happy to review a pull request with a proposed workaround.
Mode report workaround (#67)
Add parameter to enable the OI mode reporting bug workaround (#95)