We've got a new Marty User's site for Activities, Tutorials and Educational content       Check it out →  
Posted   —   № 10
6,900 Views

Page 2 of 2

Initialising

Assuming your installation went well, Marty should now be able to ROS around in simulation!

Note: in order for the interface to be loaded correctly, a roscore must be running somewhere, preferably one on your machine set to a localhost.

Before we get started, let’s first check everything installed as planned. From a terminal, navigate to your V-REP root folder and run vrep.sh. This will launch V-REP but also show the status of the plugins that are being loaded within the terminal. If the interface installation was successful, V-REP will detect the plugin and will output Plugin 'RosInterface': load succeeded to the terminal.

Now, in the top left corner click File/Open Scene... and from the list open rosInterfaceTopicPublisherAndSubscriber.ttt. This is the ROS demo as provided by V-REP and is designed to show the operation of a simple Publisher/Subscriber setup. Feel free to examine the source code if you wish. Next, click the Play button located on the toolbar. Your vision sensor should start sweeping the scene and display two video feeds, one that is being published and one that is being received, as shown below.

ROS Demo

Marty the (Simulated) Robot

Note: the ros_marty stack must be executed and set to simulation mode before running V-REP for Marty to ROS around.

Before we start, execute the stack by entering the following in a terminal:

roslaunch ros_marty startup.launch

This must be running in order to do anything with Marty in simulation.

Let’s open a new scene (File/New Scene) and see what Marty can do.

Within the Model browser, under robots, click mobile. This will list V-REP’s selection of mobile robots. Now, on the bottom left, scroll down and drag Marty on to the scene.

Drag and drop

Now, click Play. Go ahead and open up a new terminal and enter rostopic list. A list of Marty’s visible topics should be shown.

As a final test, we can try running a demo script:

$ rosrun ros_marty servo_test

This should continously move Marty’s arms and eyes, like so:

Happy Marty

Congrats, Marty is now officially ROSing around!

Tip: use Tab autocompletion to save time and errors typing long ROS commands in the terminal.