Connect to the Matlab robotics system toolbox

Typically: "How do I... ", "How can I... " questions
Post Reply
Ahmed_Yacine
Posts: 13
Joined: 01 Oct 2014, 13:19

Connect to the Matlab robotics system toolbox

Post by Ahmed_Yacine »

the new release of matlab added support to ROS, is there a way to enable communication between vrep and the matlab robotics system toolbox on a windows computer.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Connect to the Matlab robotics system toolbox

Post by coppelia »

Hello,

you could try to install ROS on Windows, which is difficult and still experimental.
Or you could use a different messaging system on Windows for your communication between the matlab robotics system toolbox and V-REP: the remote API, which allows for communication and data streaming back and forth between V-REP and an external application.

Cheers

Ahmed_Yacine
Posts: 13
Joined: 01 Oct 2014, 13:19

Re: Connect to the Matlab robotics system toolbox

Post by Ahmed_Yacine »

coppelia wrote:Hello,

you could try to install ROS on Windows, which is difficult and still experimental.
Or you could use a different messaging system on Windows for your communication between the matlab robotics system toolbox and V-REP: the remote API, which allows for communication and data streaming back and forth between V-REP and an external application.

Cheers
as i understood from the vrep documentation, the vrep ros plugin works only on linux.
the new matlab toolbox is based on rosjava.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Connect to the Matlab robotics system toolbox

Post by coppelia »

The ROS plugin works also on MacOS, and probably also on Windows if ROS can be installed there (but it seems that is still tricky).

Cheers

adutta

Re: Connect to the Matlab robotics system toolbox

Post by adutta »

If you want to use Matlab Robotics System Toolbox (RST) from Windows, along with ROS and V-Rep (in Linux), then follow the steps:

1. Install ML in Windows.
2. Install ROS and V-Rep in Linux (it can be a VM which is shipped with ML-RST).
3. Initialize ROS from ML using RST command connecting to the ROS network in Linux where V-Rep is also installed (rosinit(hostname): http://www.mathworks.com/help/robotics/ref/rosinit.html).
4. Publish topics from V-Rep over ROS network (simple LUA script -> see ros_bubble_rob2).
5. Subscribe from ML to the published topics (http://www.mathworks.com/help/robotics/ ... riber.html). Remember to remotely connect ML to V-Rep.
6. Write the decision-making part of your controller in ML and send the control commands (such as wheel speeds) to V-Rep remotely.
7. Alternatively, you can publish the control commands from ML over ROS and subscribe to that from LUA script associated with the V-Rep robot.
8. It can be also done that you do all the publishing/subscribing using ML-RST only and use V-Rep only for visualizing robot movement (in case you are not comfortable with LUA script writing - but should be easy if you follow the ros_bubble_rob2 example.)
9. Keep in mind that it's a good idea to start with a small pause in ML side before expecting any data in your subscription object.

I hope this helps all the people who want to use V-REP, Matlab and ROS together. Once you have the setting ready, any controller in ML can use that setting and control the robot(s) in V-Rep.

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Connect to the Matlab robotics system toolbox

Post by coppelia »

Thanks for the clear step-by-step instructions!

Cheers

yasintamusa
Posts: 1
Joined: 14 Aug 2017, 15:26

Re: Connect to the Matlab robotics system toolbox

Post by yasintamusa »

Can you show me tutorials to interfacing vrep and matlab to ROS in ubuntu? Thank you for tge helps

coppelia
Site Admin
Posts: 10339
Joined: 14 Dec 2012, 00:25

Re: Connect to the Matlab robotics system toolbox

Post by coppelia »

V-REP interfaces to ROS via the RosInterface.
For Matlab and ROS, you will have to check on the Matlab forums and/or on the ROS forums.

Cheers

celaji2004
Posts: 1
Joined: 03 Nov 2020, 02:08

Re: Connect to the Matlab robotics system toolbox

Post by celaji2004 »

Could you guys please repost the steps how to connect to the Matlab Robotics System Toolbox for Mac computer? thanks in advance

Post Reply