-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Playful is a software for robotic bevahior design. See : playful.is.tuebingen.mpg.de/
This repository shows examples of ROS turtlesim applications developed using Playful. It is mostly here to present an example of interfacing between ROS and Playful.
Useful to non-playful users: this repository also shows how to create a python API over ROS.
- Ubuntu 64bits with ROS installed (any relatively recent version)
- ROS turtlesim packages installed
- Playful downloaded and in the $PATH (see tutorial)
- Decent understanding of Python, ROS and Playful.
Turtlesim packages can typically be installed via (replace "kinetic" by the ros distro you use):
sudo apt-get install ros-kinetic-turtlesim*
To learn how to use Playful, including download, installation and tutorial, visit the wiki at:
https://github.com/vincentberenz/playful_tutorial/wiki
To get support: playful-support .at. tuebingen mpg de
playful_turtlesim has been tested on Ubuntu 14.04 running ROS indigo, and on Ubuntu 16.04 running ROS kinetic. Thanks for letting us know your result on other distros.
In a terminal, start turtlesim:
rosrun turtlesim turtlesim_node
In another terminal, go to the folder of the example you want to run and type 'playful execute'. For example:
cd playful_turtlesim/examples/run_after_in_turn
playful execute
To exit the application, press 'q'.
A python interface for controlling turtlesim. It abstracts calls to publishers, subscribers and services. test_turtlesim_wrapper.py shows an example of usage.
Code for managing an "aquarium", i.e. a set of turtles moving randomly in the simulation. test_world.py for an example of usage
Code for a robot turtle which has limited battery life. Stops moving when battery reaches zero.
- globals.py : create instances of a world with 3 turtles and a robot.
- on_start.py : start the world and the robot
- on_stop.py : stop the world and the robot
- resources.txt : declaration of the playful resources "legs" (to go forward), "tail" (to turn) and "brush" (to set the color of the trail left by the robot)
-
swimming_play.py : code for the playful nodes for swimming forward, turning, stopping and changing robot's brush's color
-
sensors_play.py : code that transform world scan (position of all turtles in the aquarium) into playful schemes which are pushed to the shared memory. Schemes are created based on the properties declared in properties_play.py
-
display_play.py : code for displaying in playful's terminal the current level of the robot's battery
-
filter_play.py : code for estimating the future position of the turtle in the aquarium in one seconde (based on current velocity), and pushing corresponding scheme in the shared memory
-
evaluations_play.py : code for various evaluations, e.g. measuring the distance between the robot and a turtle in the aquarium
-
schemes.play : declaration of the two schemes used in the example applications. "target", which will refer to any turtle swimming in the aquarium, and "predicted_target" which corresponds to virtual objects at the position the turtle will be in a second (based on current velocity)
-
chase.play : playful code for the robot to reactively swim toward a (moving) object
for each of these application, check the program ./play/program.play for related playful code.
The robot applies a constant velocity.
The robot navigates to a fixed target.
The robot navigates toward the closest "target" turtle (dynamically re-evaluated). When the battery gets to low, the robot redirects itself to the charger (at the bottom right of the aquarium, invisible) to recharge. Once recharged, it resumes its navigation. When navigating to a turtle, the robot does not aim at the turtle itself, but at the estimated position of the turtle one second in the future.
Same as "run_after_closest", but instead of navigating to the closest turtle, it navigates to each turtle alternatively (switching every 10 seconds)
Playful was created at the Max Planck Institute for Intelligent Systems, Tuebingen, Germany