File Exchange

image thumbnail

RaspiRemoteControl

version 1.0.0.0 (486 KB) by Ryhor Prakapovich
This package contains files necessary to build Mobile Robot Remote Control based on Raspberry Pi

1 Download

Updated 21 Jul 2016

View License

The app RaspiRemoteControl designed to explore features and capabilities of a Raspberry Pi Hardware. A mobile robot remote control system had been considered as example. The app (running on host computer with MATLAB) allows Raspberry Pi board to communicate with other hardware using GPIO-pins, serial port, I2C and SPI interfaces. For acquiring sensor data and image data had been used MATLAB Support Package for Raspberry Pi Hardware. For creating GUI had been used GUIDE – drag-and-drop environment which the provides various interactive components, including menus, tool bars and axes.
https://www.youtube.com/watch?v=42we9W22iCM

The app menu allows you to perform the following functions:
1. RasPi
• Connect – connect app to Raspberry Pi Hardware via Wi-Fi (usb-dongle); the IP-address may be entered in a special text box “IP address connect” on the main window app; this mode will indicated by green-highlighted button Connect.
• Disconnect – disconnect app from Raspberry Pi Hardware; this mode will indicated by red-highlighted button Connect.
• Network – open the dialogue box to enter IP address, login and password for Raspberry Pi.
• Reboot – reboot the Raspberry Pi operating system.
• Shutdown – shutdown the Raspberry Pi operating system.
• Terminal – open SSH terminal on host computer to use Raspberry Pi onboard Linux shell.
• Close – close the app.

2. Interfaces
• Camera – open the dialogue box to change default settings of Raspberry Pi Camera Board.
• RS232 – open the dialogue box to change default settings of Raspberry Pi Serial Port.
• SPI – open the dialogue box to change default settings of Raspberry Pi SPI interface.
• TWI – is not available in this version.

3. Devices
• Joystick – connect a joystick to the host computer (first joystick on the list).
• Webcam – is not available in this version.

Additional field “Interfaces” on the main window allows user to activate Raspberry Pi interfaces via radio buttons: Camera Board, Serial Port, SPI interface and TWI interface (TWI is not available in this version).
Use Camera Board to obtain images with Raspberry Pi. After the joystick had been connected and radio button “Camera” had been activated, angles of slope first and second axis is being converted into wheel speeds. Then wheel speeds are being sent via serial port in form:
[‘$’, 1, 0, 0, Left Robot Wheel speed, 0, 0, Right Robot Wheel speed, 0, ‘#’].
It is necessary to install MATLAB® firmware (Raspbian) on Raspberry Pi board. Raspberry Pi and host computer must be in same Wi-Fi network. All settings stored in the raspi.mat structure.

Comments and Ratings (3)

Thank you Ryhor.

I want to know how to connect and control motor.
When I saw this project movie , operator controlled robot using joystick.I want to do same thing .
So, please tell me constitution of robot hardware , especially around raspberrypi.

If I have to fix this program for control robot using joystick , please tell me the program.

Unfortunately, I have not tested the application on Raspberri Pi 3B. However, I can advise you to activate the SPI Raspberri interface :
sudo raspi-config
select “9. Advanced Options” afterwards -> “A6 SPI” -> choose “Yes” -> again choose “Yes” on “Would you like the SPI kernel module to be loaded by default?” -> click “Finish” -> “Yes” on “Would you like to reboot?”

Hello Ryhor,

The application GUI looks great. However, I can't connect to my Raspberry PI 3B. It throws me the following error:

Error using raspi.internal.spidev (line 59)
SPI channel CE0 is not available. Use AvailableSPIChannels property of the raspi object
to see a list of available SPI channels.

Error in raspi/spidev (line 603)
spiObj = raspi.internal.spidev(obj, varargin{:});

Error in RaspiRemoteControl>pushbutton_IPconnect_Callback (line 196)
handles.spi = spidev(handles.mypi,...

Error in RaspiRemoteControl>Menu_Raspi_Connect_Callback (line 641)
pushbutton_IPconnect_Callback(src, evt, handles)

Error while evaluating Menu Callback

I can connect both in Simulink and MATLAB .m to my RPI no problem. But I can't using this file. What should I comment or enable to connect to my RPI?

I don't have any other thing, just RPI and the camera. No joystick.

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

RaspiRemoteControl/