Table of Contents
Roomba Change Mode
Changes Roomba mode to Passive, Safe or Full.
Library
MATLAB Command Line
Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:
qc_open_library('quarc_library/Devices/Third-Party/iRobot/Roomba/Interfacing')Description
The Roomba Change Mode block changes the operating mode of Roomba to Passive, Safe or Full. Roomba has four operating modes: Off, Passive, Safe, and Full. The mode numbers are defined as follows:
Number |
Mode |
---|---|
0 |
Off |
1 |
Passive |
2 |
Safe |
3 |
Full |
After a battery change or when is first supplied, Roomba is in "off" mode. When Roomba is powered on, it is in Passive mode. Upon sending the Start command (opcode 128) or any one of the demo commands (which also starts the specific demo, e.g., Roomba Spot, Roomba Cover, Roomba Dock, or Roomba Run Demo), the robot enters into Passive mode. Once the Roomba is in Passive mode, a mode command for one of the three operating modes can be sent to change the operating mode. The mode commands are specified as follows:
Mode |
Opcode |
---|---|
Passive |
128 |
Safe |
131 |
Full |
132 |
When Roomba is in Passive mode, sensor data can be received by sending sensors commands ( see Roomba Sensor Request, Roomba Query List, Roomba Sensor Stream), built-in demos can be run, and the battery can be charged. However, the actuator commands (see Roomba Drive, Roomba Direct Drive, Roomba Play Song, Roomba LED, Roomba LSD, Roomba PWM LSD, Roomba Digital Output) can not be applied. To apply actuator commands, the operating mode must be switched from Passive mode to Full or Safe mode.
When Roomba is in Safe mode, the users have full control on Roomba, with the exception of the following safety-related conditions:
In case of above safety-related conditions in Safe mode, Roomba stops all motors and reverts to the Passive mode. If no commands are sent to Roomba in Safe mode, it waits with all motors and LEDs off and does not respond to Play or Advance button presses or other sensor inputs. Note that charging terminates when Roomba enters in Safe Mode.
When Roomba is in Full mode, the users have complete control over all of its actuators, and all of the safety-related conditions that are restricted when it is in Safe mode, as Full mode shuts off the cliff, wheel-drop and internal charger safety features. If no commands are sent to Roomba in Full mode, it waits with all motors and LEDs off and does not respond to Play or Advance button presses or other sensor input. Note that charging terminates when Roomba enters in Full Mode.
By default, the Roomba Initialize block sets the Roomba operating mode as Safe.
Important Notes
Use System Timebase block in Normal simulation.
Input Ports
rmb
A reference to the Roomba stream, which is the same as input Roomba stream reference. It helps creating a daisy chain of Roomba blocks.
err
This signal returns a negative value in case of memory allocation error or data communication error through Roomba serial port.
Output Ports
This block has no output ports.
Parameters and Dialog Box
Sample time
The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time. A sample time of -1 indicates that the block inherits its sample time.
Use 0.02 or higher since minimum time interval required for mode change is 20 ms.
Targets
Target Name |
Compatible* |
Model Referencing |
Comments |
---|---|---|---|
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
||
Yes |
Yes |
Last fully supported in QUARC 2018. |
|
Rapid Simulation (RSIM) Target |
Yes |
Yes |
|
S-Function Target |
No |
N/A |
Old technology. Use model referencing instead. |
Normal simulation |
Yes |
Yes |
Use System Timebase. |
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.
Link to this page.