Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
README.md update
Browse files Browse the repository at this point in the history
  • Loading branch information
scarrionv committed Apr 17, 2018
1 parent 098dbc0 commit 9f5ace2
Show file tree
Hide file tree
Showing 47 changed files with 16,416 additions and 130 deletions.
77 changes: 60 additions & 17 deletions README.md
@@ -1,11 +1,49 @@
# Installation requirements
# Scratch4Robots

## Prerequisites

### Scratch 2.0

wget -O adobe-air.sh http://drive.noobslab.com/data/apps/AdobeAir/adobe-air.sh
chmod +x adobe-air.sh; sudo ./adobe-air.sh

Download the scratch file from here: https://scratch.mit.edu/scratchr2/static/sa/Scratch-456.0.2.air and then double click to install it.

### ROS

Follow the ROS tutorial installation: http://wiki.ros.org/kinetic/Installation/Ubuntu

### Python requirements

pip install -r requirements.txt

### Gazebo and worlds

Follow the Gazebo tutorial installation: http://gazebosim.org/tutorials?tut=install_ubuntu

With this line we get some prepared worlds based on ROS ready to use:

sudo apt-get install ros-${ROS_DISTRO}-kobuki-gazebo


## Installing

### Install Scartch4Robots extension to use in Scratch

# How to use
In scratch keep pressing shift key while you click on "File" > "Import experimental HTTP extension" and add our extension.
The extension will be stored in the "extension" directory of your package.

Note: This step is necessary each time you initialize Scratch

### Download the tool from git

git clone https://github.com/JdeRobot/Scratch4Robots.git

### With catkin workspace

Follow this steps only if you want to work with catkin workspace

## Prepare your workspace
#### Prepare your workspace

You have a guide for make your own catkin workspace here:
http://wiki.ros.org/catkin/Tutorials/create_a_workspace
Expand All @@ -18,36 +56,41 @@ Once you have your catkin workspace:

Now your package is ready to use.

## How to Use

## Install Scartch4Robots extension to use in Scratch2.0
### Make a scratch project

In scratch keep pressing shift key while you click on "File" > "Import experimental HTTP extension" and add our extension.
The extension will be stored in the "extension" directory of your package.
Make a scratch project and save it.

### Make the translation from Scratch to python

## Make a project
Generate the code:

Make a scratch project and save it.
cd Scratch4Robots/src
./scratch2python.py /your/path/to/scratchfile.sb2

Only if you are working with the tool as ROS package, after source your package:

## Make the translation from Scratch to python
rosrun scratch4robots scratch2python.py /your/path/to/myscratchfile.sb2


rosrun scratch4robots scratch2python.py myscratchfile.sb2
This command will generate the python script on your current work directory


## Launch the simulated world
### Launch the simulated world

for example:
For example:

roslaunch kobuki_gazebo kobuki_empty_world.launch --screen


## Execute the generated code
### Execute the generated code

cd Scratch4Robots/src
./myscratchfile.py /path/to/robot_ros.yml

## Running an example

roscd scratch4robots
cd src
./myscratchfile.py robot_ros.yml
You have all you need for running the examples in the examples folder


# More information about the tool
Expand Down
11 changes: 6 additions & 5 deletions comm_pkg/src/kurt/scratch20/commands_src_extras.py
Expand Up @@ -11,16 +11,17 @@
# extension:Array
extras = []

# robotics:ScratchExtension
# robotics:ScratchExtensio
extras += [
# add extensions code if not auto-generated
[' ', 'stop robot-drone', 'Scratch2JdeRobot/stop'],
[' ', 'move robot %m.robotDirections', 'Scratch2JdeRobot/robot/move', 'forward'],
[' ', 'move drone %m.droneDirections', 'Scratch2JdeRobot/drone/move', 'forward'],
[' ', 'move robot %n', 'Scratch2JdeRobot/robot/move', 'vx,vz'],
[' ', 'move drone %n', 'Scratch2JdeRobot/drone/move', 'vx,vz,vyaw'],
[' ', 'move robot %m.direction speed %n', 'Scratch2JdeRobot/robot/move/speed', 'forward', 1],
[' ', 'turn robot-drone %m.turnDirections', 'Scratch2JdeRobot/turn', 'left'],
[' ', 'turn robot %m.turnDirections speed %n', 'Scratch2JdeRobot/turn/speed', 'left', 1],
[' ', 'take off drone', 'Scratch2JdeRobot/drone/takeoff'],
[' ', 'land drone', 'Scratch2JdeRobot/drone/land'],
['r', 'frontal laser distance', 'Scratch2JdeRobot/laser/frontal']
['r', 'frontal laser distance', 'Scratch2JdeRobot/laser/frontal'],
['r', 'color detection %m.color', 'Scratch2JdeRobot/camera/all', 'red'],
['r', 'get pose3D', 'Scratch2JdeRobot/camera/pose3D'],
]
25 changes: 6 additions & 19 deletions examples/drone_example/README.md
@@ -1,27 +1,10 @@
# Getting started

You have an example here:
https://www.youtube.com/watch?v=IVLTRkUutAk

## Prepare your workspace

This example is ready for work with comm library, ICE and ROS communications are allowed

Source your catkin workspace

cd catkin_workspace
source devel/setup.bash

You can choose between two examples file, drone_example_1.sb2 or drone_example_2.sb2

## Go to example directory

roscd scratch4robots
cd examples/drone_example/src
This example is ready for work with comm library

## Make the translation from Scratch to python

rosrun scratch4robots scratch2python.py drone_example_1.sb2
./scratch2python.py drone_example_2.py

## Launch the simulated world

Expand All @@ -32,3 +15,7 @@ In other terminal run:
## Execute the generated code

./drone_example_1.py ../cfg/drone_ice.yml

## Only with catikin workspace

You have an example here: https://www.youtube.com/watch?v=IVLTRkUutAk

0 comments on commit 9f5ace2

Please sign in to comment.