Roomba Drive Roomba LED navigation bar

Table of Contents

Roomba Initialize

Connects to an iRobot Roomba.

Library

QUARC Targets/Devices/Third-Party/iRobot/Roomba/Interfacing

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

Roomba Initialize

The Roomba Initialize block establishes a serial connection to a Roomba. The connection is blocking and is made at model start. This block does not return until the connection is established. If the connection is successfully established then the rmb output refers to the connected stream. This stream signal is passed as an input to other Roomba blocks to refer to the stream.

By default, the Roomba Initialize block sets the Roomba operating mode as Safe (see Roomba Change Mode block). 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.

Important Notes

Note Use System Timebase block in Normal simulation.

Input Ports

This block has no input ports.

Output Ports

rmb

A reference to the Roomba stream. This reference is always valid but will not refer to a connected stream if the connection was not established or is still pending. It has a data type of t_roomba. It cannot be plotted and may only be connected to the rmb input of one of the Roomba blocks.

Parameters and Dialog Box

Roomba Initialize

URI of Roomba to which to connect

An iRobot Roomba is identified by a Universal Resource Identifier (URI), such as serial://localhost:2?baud=57600,word=8,parity=none,stop=1, where communication port 2 of the target is connected to the Roomba serial port with the specified parameters.

Send buffer size in bytes

The size of the buffer used by the Roomba stream for sending data. The buffer size must be at least as large as the Roomba command bytes. For example, in case of Roomba drive command, the buffer size must be at least 5 (1 byte opcode and 4 data bytes).

Receive buffer size in bytes

The size of the buffer used by the Roomba stream for receiving data. The buffer size must be at least as large as the maximum sensor bytes that will be received from Roomba. For example, in case of all available sensory data on Roomba, the buffer size must be 52 bytes.

Active during normal simulation

Indicates whether this block should execute during normal simulation. If this option is not checked then the block will not connect to the robot during normal simulation. This parameter has no effect on generated code.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

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.

* Compatible means that the block can be compiled for the target.

 

navigation bar