Git Product home page Git Product logo

scrimmage's Introduction

SCRIMMAGE Multi-Agent Simulator

Build Status contributions welcome Docker Pulls Join the chat at https://gitter.im/gtri-scrimmage/community

SCRIMMAGE Logo

Welcome to SCRIMMAGE

SCRIMMAGE is a multi-agent simulator for robotics research. It has been used to conduct studies in multi-agent task assignment, differential game theory, novel controllers, and reinforcement learning.

SCRIMMAGE Demonstration Video

SCRIMMAGE Demo Video

Online Documentation

Tutorials

Citation

If you use SCRIMMAGE in your research, please cite our research paper:

@inproceedings{demarco2018,
    title={Simulating Collaborative Robots in a Massive Multi-Agent Game Environment ({SCRIMMAGE})},
    author={DeMarco, Kevin and Squires, Eric and Day, Michael and Pippin, Charles},
    booktitle={Int. Symp. on Distributed Autonomous Robotic Systems},
    year={2018},
}

Build SCRIMMAGE

Directory Setup

SCRIMMAGE developers and users may use multiple scrimmage-related projects and repositories. Thus, it is recommended to group your scrimmage-related projects under a single directory, but it is not necessary. To create a directory to hold your scrimmage projects and clone this scrimmage repo, run the following commands:

mkdir -p ~/scrimmage && cd ~/scrimmage
git clone https://github.com/gtri/scrimmage.git

Install Binary Dependencies

A list of the Ubuntu packages required is provided in ./setup/install-binaries.sh in the "DEPS_DPKG" array. Run our automated installer to install the required packages:

cd scrimmage
sudo ./setup/install-binaries.sh [--external] [--python <version>]

If the first option --external is passed, the script only installs what is necessary for an external build (see EXTERNAL flag to project CMakeLists.txt). The second argument --python <version> selects the version of python for which to install dependencies. Supported values for <version> are "2", "3", and "a", with "a" installing dependencies for both python 2 and 3. This option defaults to "a" if no valid version is specified.

Additional Binary Dependencies Ubuntu 20.04

sudo apt install libgrpc++-dev
(optional) sudo ln -s usr/bin/python3 usr/bin/python

Install Custom Built Binary Dependencies

Some of SCRIMMAGE's dependencies have to be custom built from source. We provide debian package binaries for both Ubuntu 16.04 (xenial) and 18.04 (bionic) via the SCRIMMAGE PPA on Launchpad for these custom built packages. For Ubuntu 16.04 (xenial) and 18.04 (bionic), and 20.04 (focal) add the following PPA to your apt-get sources:

sudo add-apt-repository ppa:kevin-demarco/scrimmage

For both distributions, update your sources list:

sudo apt-get update

Now, install the SCRIMMAGE custom built binary dependencies:

sudo apt-get install scrimmage-dependencies scrimmage-jsbsim

Run the SCRIMMAGE setup script, which adds the ~/.scrimmage directory to your local system and sets up some environment variables:

source /opt/scrimmage/*/setup.sh

Note: If you need to build the dependencies from source or generate binary packages, see Build Dependencies from Source

Build SCRIMMAGE Core

mkdir build && cd build
cmake ..
make
source ~/.scrimmage/setup.bash

Environment Setup

Whenever you want to use scrimmage, you need to source the ~/.scrimmage/setup.bash file or you can place a line in your ~/.bashrc file to source it automatically:

echo "source ~/.scrimmage/setup.bash" >> ~/.bashrc

Run SCRIMMAGE

Open a new terminal, change to the scrimmage directory, and execute a mission.

cd </path/to/>scrimmage
scrimmage ./missions/straight.xml

You should see the visualization GUI open up and display the simulation.

GUI Commands

The GUI responds to the following input keys:

'q'                     : Quit the simulation
'b'                     : (Break) Pauses and unpauses the simulation.
'space bar'             : When paused, take a single simulation step.
'a'                     : Rotate through the camera views
'right/left arrows'     : Change the aircraft to follow
'['                     : Decrease simulation warp speed
']'                     : Increase simulation warp speed
'+'                     : Increase visual scale of all entities
'-'                     : Decrease visual scale of all entities
'r'                     : Reset visual scale and reset camera position
'z'                     : Zoom out from entity
'Z'                     : Zoom in to entity (z+shift)
'w'                     : Display wireframe
's'                     : Display solids (vs. wireframe)
'CTRL + Left Click'     : Rotate world
'SHIFT + Left Click'    : Translate camera through world

The GUI's camera can operate in three modes (cycle with 'a' key):

  1. Follow the entity and point towards the entity's heading
  2. Free floating camera
  3. Follow the entity from a fixed viewpoint

Note: If all of the terrain data does not appear, click on the GUI window with your mouse.

Building on macOS

Support for macOS has been deprecated. Refer here for legacy homebrew instructions, but this is not guaranteed to build without intervention from the user. Any user wishing to develop on macOS is free to do so and make pull requests for patches, but the platform is no longer supported by SCRIMMAGE core developers.

Python Bindings

It is recommended to build scrimmage's Python bindings in a python virtual environment:

cd /path/to/scrimmage
sudo apt-get install python3 libpython3-dev python3-venv
python3 -m venv env
source ./env/bin/activate

Install the python dependencies with specific version numbers:

(env)$ pip install -r ./python/requirements.txt

Re-build the scrimmage project within the virtual environment:

(env)$ cmake .. -DPYTHON_MIN_VERSION=3.6
(env)$ make

Scrimmage's cmake build procedures will choose the environment default Python in its configuration process when running plain cmake ... To specify a specific minimum version of Python to be used, use the cmake .. -DPYTHON_MIN_VERSION=2.7 flag during the cmake process.

Install SCRIMMAGE Python Bindings

To install scrimmage's python bindings:

(env)$ cd /path/to/scrimmage/python
(env)$ python setup.py develop

Build SCRIMMAGE Documentation

cd build
cmake .. -DBUILD_DOCS=ON
make docs

View SCRIMMAGE API (Doxygen) Documentation

firefox ./docs/doxygen/html/index.html

View SCRIMMAGE Tutorial (Sphinx) Documentation

firefox ./docs/sphinx/html/index.html

Build and Run Tests

cmake .. -DBUILD_TESTS=ON
make
make test

Cleaning SCRIMMAGE

The scrimmage source code can be cleaned with the standard clean command:

make clean

However, if you want to clean everything, you can remove your build directory:

cd /path/to/scrimmage && rm -rf build

ROS Integration

To build SCRIMMAGE's ROS plugins, you must have ROS installed, the ROS environment sourced, and the BUILD_ROS_PLUGINS cmake variable must be set:

sudo apt-get install ros-${ROS_VERSION}-desktop-full ros-${ROS_VERSION}-mavros-msgs
source /opt/ros/${ROS_VERSION}/setup.sh
cmake .. -DBUILD_ROS_PLUGINS=ON

The ${ROS_VERSION} should be substituted with an appropriate ROS version (e.g., "kinetic", "melodic", etc.).

An example of using SCRIMMAGE to simulate robots running the ROS 2D Navigation stack can be found in the scrimmage_ros package.

MOOS Integration

If you want to use MOOS with SCRIMMAGE, you will first need to download and build MOOS/MOOS-IVP according to the instructions at: http://oceanai.mit.edu/moos-ivp/pmwiki/pmwiki.php?n=Site.Download

The MOOSAutonomy plugin interacts with the MOOSDB to synchronize time, exchange contact information, and receive desired state from the IvP Helm. To build MOOSAutonomy, you have to provide cmake with the path to the moos-ivp source tree:

cmake .. -DMOOSIVP_SOURCE_TREE_BASE=/path/to/moos-ivp

FlightGear Multiplayer Server (FGMS) Integration

If you want to use FGMS with SCRIMMAGE, you will first need to download and build FGMS according to the instructions at: https://github.com/FlightGear/fgms

Clone the flight gear multiplayer server repository and build it:

git clone https://github.com/FlightGear/fgms.git
cd fgms
git checkout 6669ac222b9f6ca34b0d56ba1bc6cac9cc0324b2
mkdir build && cd build
cmake .. -DBUILD_SHARED_LIB=ON
make

The FGMS plugin interacts with SCRIMMAGE to receive the state variables of each entity. To build FGMS, you have to provide SCRIMMAGE's CMake project the path to the FGMS root source:

cmake .. -DFGMS_SOURCE_TREE_BASE=/path/to/fgms

Running SCRIMMAGE inside of Docker

The SCRIMMAGE docker image is pushed to a public repository after a successful build on Travis. If docker is installed on your machine, you can obtain the SCRIMMAGE docker image by running the following command:

docker pull syllogismrxs/scrimmage:latest

You can pass mission files from your host machine to the scrimmage executable inside of the docker container with the following command:

cd /path/to/scrimmage/missions
docker run --name my-scrimmage \
    -v ${PWD}/straight_jsbsim.xml:/straight_jsbsim.xml \
    syllogismrxs/scrimmage:latest /straight_jsbsim.xml

The previous command mounts the straight_jsbsim.xml mission file on your host machine into the scrimmage container and then the /straight_jsbsim.xml portion at the end of the command overwrites the default docker CMD, which is defined in the Dockerfile. Finally, the scrimmage executable is passed the /straight_jsbsim.xml mission file.

Since we provided a name for our container, we can easily extract the SCRIMMAGE log files from the docker container:

docker cp my-scrimmage:/root/.scrimmage/logs .

If you need to drop into a shell inside of the scrimmage container, you will need to overwrite the docker image's ENTRYPOINT.

docker run -it --entrypoint="/bin/bash" syllogismrxs/scrimmage:latest

Once inside of the container, you will need to source the setup.bash file manually before running a mission.

source ~/.scrimmage/setup.bash
scrimmage ./missions/straight-no-gui.xml

Building SCRIMMAGE for CentOS or RedHat

This repository contains a Dockerfile that builds a compiler with C++14 support, SCRIMMAGE's dependencies, and SCRIMMAGE for CentOS6 or RedHat6. RPMs are built inside of the docker image and they can be extracted and install on a CentOS or RedHat system. The user can change the package install prefix for all RPMs by specifying the PKG_PREFIX docker build argument. Building the docker image can take several hours:

cd /path/to/scrimmage/ci/dockerfiles
docker build --build-arg PKG_PREFIX=/opt/scrimmage \
               --tag scrimmage/centos6:latest \
               --file centos6 .

Extract the RPMs that were built to the host's rpms folder:

docker create --name mycontainer scrimmage/centos6:latest
docker cp mycontainer:/root/rpms ./rpms     # extract the rpms
docker rm mycontainer                       # clean up container

Copy the rpms folder to your CentOS or RedHat system and install the run-time dependencies:

cd /path/to/rpms
rpm -ivh scrimmage_gcc*.rpm \
         scrimmage_python*.rpm \
         scrimmage_boost*.rpm \
         scrimmage_geographiclib*.rpm \
         scrimmage_jsbsim*.rpm \
         scrimmage_grpc*.rpm \
         scrimmage_protobuf*.rpm \
         scrimmage_0.2.0*.rpm

To test that SCRIMMAGE was installed correctly, run the following command:

export JSBSIM_ROOT=/opt/scrimmage/etc/JSBSim \
    && source /opt/scrimmage/etc/scrimmage/env/scrimmage-setenv \
    && scrimmage /opt/scrimmage/share/scrimmage/missions/straight-no-gui.xml

Installing and Configuring Open Grid Engine

Instructions modified from: https://scidom.wordpress.com/2012/01/18/sge-on-single-pc/ http://www.bu.edu/tech/support/research/system-usage/running-jobs/tracking-jobs/

Install Grid Engine:

sudo apt-get install gridengine-master gridengine-exec \
  gridengine-common gridengine-qmon gridengine-client

Note that you can configure how qsub is called with a .sge_request in your home directory. Further, you can set the number of available slots (cores available) when running grid engine under the Queue Control tab.

Installing and Configuring PostgreSQL

Install PostgreSQL and configure the database scrimmage, create user scrimmage with password scrimmage, and add that user to the scrimmage database:

sudo apt-get install postgresql postgresql-contrib
sudo update-rc.d postgresql enable &&\
  sudo service postgresql restart &&\
  sudo -u postgres createdb scrimmage &&\
  sudo -u postgres psql -c "CREATE USER scrimmage with password 'scrimmage';" &&\
  sudo -u postgres psql -c "alter user scrimmage with encrypted password 'scrimmage'" &&\
  sudo -u postgres psql -c "grant all privileges on database scrimmage to scrimmage;"

Go into /etc/postgresql/9.5/main/pg_hba.conf (or similar path to your postgres install) and change the line:

local all all peer

to

local all all md5

Then run:

sudo service postgresql restart

This will allow us to authenticate the scrimmage user on postgres with the password scrimmage that we created.

To use the python scripts for pulling .csv files to postgres, install psycopg2, the python interface for postgres:

pip install psycopg2

The scripts are located in the scripts directory.

Troubleshooting

Problem: I can't run the SCRIMMAGE GUI in a Virtual Machine (VirtualBox)

There are some OpenGL issues with VTK6 in Virtualbox. To run SCRIMMAGE in VirtualBox with VTK5, run the following commands:

sudo apt-get install libvtk5-dev
cd ~/scrimmage/scrimmage/build      # Note: Path may vary
cmake ..

At this point, cmake should output a message about finding VTK Version 5. Now, you have to rebuild SCRIMMAGE:

make

Problem: I cannot load python libraries through scrimmage

Make sure that when you run the cmake command it is using the version of python that you want to use with the following:

cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python      \  # adjust path to your needs
        -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7  \  # adjust path to your needs
        -DPYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.so   # adjust path to your needs

Problem: vtkRenderingPythonTkWidgets cmake Warning

When running cmake, the user gets the cmake warning:

-- The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

This is a VTK6 Ubuntu package bug. It can be ignored.

Problem: I do not see building extrusions in the SCRIMMAGE GUI

SCRIMMAGE uses vtkGeoJSONReader to load polygon extrusion data from a GeoJSON file. This VTK feature was added in VTK7. Since this feature is not available in older versions, SCRIMMAGE does not load building data if the installed VTK version is less than 7. Therefore, the remedy is to upgrade VTK. To install VTK7 on Ubuntu, run the following command:

sudo apt-get install libvtk7-dev

Problem: Docker Container Can't Access Internet

Docker can have DNS issues. If you can ping a public ip address within a docker image (such as 8.8.8.8), but you can't ping archive.ubuntu.com, create the file /etc/docker/daemon.json with the following contents:

{
    "dns": ["<DNS-IP>", "8.8.8.8"]
}

Where <DNS-IP> is the first DNS IP address and is a network interface with internet access from the commands:

nmcli dev list | grep 'IP4.DNS'                    # Ubuntu <= 14
nmcli device show <interfacename> | grep IP4.DNS   # Ubuntu >= 15

Restart docker:

sudo service docker restart

scrimmage's People

Contributors

avelte3 avatar chacalnoir avatar christomaszewski avatar crichardson332 avatar daniellevy-gtri avatar dburke3 avatar devoncurrent avatar dmagree avatar dr-parker avatar esquires avatar fracturedshader avatar frazierbaker avatar gitter-badger avatar gtcooke94 avatar jamesmichaelmatthews avatar jddj137 avatar jlstack avatar jordan-jhuapl avatar jpfeltracco avatar laserjetprinter avatar laurathepluralized avatar nrakoski3 avatar nruano3 avatar olasanni1 avatar shaun-d-anderson avatar steventhynes avatar syllogismrxs avatar tm132 avatar travisvatter avatar wfsyre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scrimmage's Issues

Some xml tags inside the mission files wont work

XML tags like inside the entity parameter wont actually change the color of the entity, it will always remain blue, which I beleive is the original color. Also, setting start_paused inside the parameters to false will not work, it will always start the simmulation in paused mode.

Multi-Agent Independant Interactions

By setting the number of agents and xml file in the python file, we can get the independant observations for each agent, given an independant action for each agent. However, a reward is return but in the form of a accumulative reward, meaning that the reward reflects the amount of reward of all agents together. I tried different settings (combine actors, global sensors) but it will always return a cumulative reward.
Is there a way that the rewards can be recived as a array like the observation values?

MoveToGoalMS goal Parsing Inconsistency

In some uses of MoveToGoalMS, the goal in defined in the mission xml file as goal='x y z'. This causes the params dictionary to just contain goal: x, which then causes the goal to be defined as the default 0,0,0 definition. In other cases in the mission xml file, goal is defined as goal='x,y,z'. This works correctly with the parsing written in MoveToGoalMS and causes the goal to be correctly set.
It seems that the easiest approach is just adding commas to the mission files that aren't being parsed correctly, but since a recent commit just changed the parsing code I wanted to make sure this wasn't a potential change to the parsing that would affect other plugins too.
An example that fails can be seen here:
include/scrimmage/plugins/autonomy/MotorSchemas/MotorSchemas.xml:14: [ MoveToGoalMS gain='1.0' use_initial_heading='true' goal='100 0 0']

create an integrator model

Right now we have a single and double integrator model but higher order models should be available as well. Further, the double integrator model has extra stuff in it that could inherit from this model.

update parameters

It would be nice if the way parameters are handled could accomplish the following:

  • allow params to be changed mid-simulation
  • allow saving of new params to input files
  • allow re-use of params across plugins and entities
  • eliminate the need to save all params in the init function to member functions
  • allow scrimmage to interact more easily with a ros param server

It would need to be able to handle nested blocks, global/entity/plugin scoping

External class bug with error message on variableIO mismatch

The external class, when given a controller whose variableIO output does not match the External class's input vars, will print an error message showing the controller's output variables. However, with SimpleAircraftControllerPID, it seems to display the input vars (altitude, airspeed, bank) instead of the output vars (throttle, roll rate, pitch rate).

OpenAI Continuous Action Issue

Hi, one more issue with the OpenAI plugin. I tried to add 2 ranges to the continuous_extrema list:

action_space.continuous_extrema.push_back(std::make_pair(-inf,inf)); action_space.continuous_extrema.push_back(std::make_pair(-inf,inf));
When I run openai.py, I get the following error:

File "test_openai.py", line 46, in
test_openai()
File "test_openai.py", line 18, in test_openai
env = gym.make('scrimmage-v0')
File "/home/rajan/.local/lib/python2.7/site-packages/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/home/rajan/.local/lib/python2.7/site-packages/gym/envs/registration.py", line 130, in make
max_episode_seconds=env.spec.max_episode_seconds)
File "/home/rajan/.local/lib/python2.7/site-packages/gym/wrappers/time_limit.py", line 6, in init
super(TimeLimit, self).init(env)
File "/home/rajan/.local/lib/python2.7/site-packages/gym/core.py", line 243, in init
self.action_space = self.env.action_space
TypeError: Unable to convert function return value to a Python type! The signature was
(self: scrimmage.bindings.py_bindings.ScrimmageOpenAIEnv) -> object

No output generated if output type is summary

I realized today that, if I have output_type in my mission file set to summary, no results folder (i.e. ~/swarm-log/<timestamp_job_task> or ~/.scrimmage/logs/<timestamp_job_task>) gets created and no output files are generated. Results directory creation does still work if output_type is frames or all, and possibly others (haven't tested more options yet). The last time a mission file with output_type of summary generated results as expected was 11/16/2017.

write csv data using protobuf

In CSV.h, write_row can take a significant percentage of runtime in a simulation. What do you think about converting it to write binaries with protobuf instead and give the option to additionally output in human-readable csv?

allow bool return in init

There are times when a plugin wants to indicate a failure in initialization. Returning a bool rather than void would allow scrimmage to catch this.

Error: Create an Autonomy Plugin

Hi I'm following this tutorial (http://www.scrimmagesim.org/docs/sphinx/html/tutorials/autonomy-plugin.html ) and run these commands. But when run "make" command I received this error.

~/scrimmage/my-scrimmage-plugins/build$ make
[ 25%] Building CXX object src/plugins/autonomy/ExamplePlugin/CMakeFiles/ExamplePlugin_plugin.dir/ExamplePlugin.cpp.o
In file included from /opt/scrimmage/x86_64-linux-gnu/include/scrimmage/autonomy/Autonomy.h:37:0,
from /home/pinar/scrimmage/my-scrimmage-plugins/include/my-scrimmage-plugins/plugins/autonomy/ExamplePlugin/ExamplePlugin.h:35,
from /home/pinar/scrimmage/my-scrimmage-plugins/src/plugins/autonomy/ExamplePlugin/ExamplePlugin.cpp:33:
/opt/scrimmage/x86_64-linux-gnu/include/scrimmage/plugin_manager/Plugin.h:36:23: fatal error: Eigen/Dense: No such file or directory
compilation terminated.
src/plugins/autonomy/ExamplePlugin/CMakeFiles/ExamplePlugin_plugin.dir/build.make:62: recipe for target 'src/plugins/autonomy/ExamplePlugin/CMakeFiles/ExamplePlugin_plugin.dir/ExamplePlugin.cpp.o' failed
make[2]: *** [src/plugins/autonomy/ExamplePlugin/CMakeFiles/ExamplePlugin_plugin.dir/ExamplePlugin.cpp.o] Error 1
CMakeFiles/Makefile2:207: recipe for target 'src/plugins/autonomy/ExamplePlugin/CMakeFiles/ExamplePlugin_plugin.dir/all' failed
make[1]: *** [src/plugins/autonomy/ExamplePlugin/CMakeFiles/ExamplePlugin_plugin.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

I use 16.04 LTS Ubuntu dual boot.
pip 10.0.1
Python 3.6.3

How can I solve this error?
Thanks.

Update Mission XML Documentation

  •      Missing tags (grid_spacing, grid_size)
    
  •      Missing enum values (“all_dead”?)
    
  •      Valid list delimiters for tags that use them (spaces, commas, etc)
    
  •      <entity_interaction> (make sure it is up-to-date)
    
  •      <enable_screenshots> attributes missing units and/or how they relate to simulation start/end
    
  •      Formatting of values (latitude/longitude format)
    
  •      Default values for all tags/attributes
    
  •      Whether or not the tag is required to be there
    

Mission <start_paused> Tag

The <start_paused> tag will not work. I tried changing the values inside the xml file and inside a function in a python file that recreated the xml with new tags. Setting it to true or false, it will always starts as paused.

quaternion doesn't properly inherit operator overloads

Scrimmage's quaternion does not inherit operator overloads from its base class, so the following code results in a compiler error:

scrimmage::Quaternion q, p;
scrimmage::State state;
state.set_quat(q * p);

Error msg:

error: no matching function for call to ‘scrimmage::State::set_quat(Eigen::Quaternion<double>)’
note: candidate: void scrimmage::State::set_quat(const scrimmage::Quaternion&)

Setup non-root user in docker image

Setup a scrimmage user ("scrimmage") in the docker image. Give the user sudo privs, build, install, run tests, with the scrimmage user, not root user.

VariableIO seems incompatible with Python bindings

Commit 88d750b by @esquires seems to cause issues with PyAutonomy. If you try running python-test.xml, this happens:

$ scrimmage missions/python-test.xml 
Segmentation fault (core dumped)

If I checkout 493a79e, where SimpleAircraftControllerPID used the old way of setting desired states, and rebuild everything, it works fine.

Network/Port Problems

E0507 09:47:17.695580374 13049 server_chttp2.c:53] {"created":"@1525700837.693440183","description":"No address added out of total 1 resolved","file":"src/core/ext/transport/chttp2/server/chttp2_server.c","file_line":259,"referenced_errors":[{"created":"@1525700837.693434142","description":"Unable to configure socket","fd":3,"file":"src/core/lib/iomgr/tcp_server_posix.c","file_line":388,"referenced_errors":[{"created":"@1525700837.693421340","description":"OS Error","errno":98,"file":"src/core/lib/iomgr/tcp_server_posix.c","file_line":362,"os_error":"Address already in use","syscall":"bind"}]}]}

I always get this error when trying to run the test_openai.py file. I have tried using the original code (TutorialOpenAI, RLSimple, SimpleLearner from the tutorial) and also I created one of my own but with no avail. None of the created scripts actually runs, either it stays and Simulation Complete or it says 100% at the end of the terminal.

Reduce docker image size

The docker image currently on the site is 2GB compressed and 4.8GB uncompressed.

As far as docker images go, this is huge. I don't have time to work on this issue myself (although I'd be happy to answer questions), but several suggestions to pare it down:

  • Use multi-stage builds to only include the files that are actually needed to run the program
  • Install only the bare minium of dependencies to run the program. What's ROS used for? Is the entirety of ROS needed here, or just 2-3 smaller components?
  • Each layer adds size to the image, and can never remove size. Therefore, only create layers on logical boundaries, and cleanup the messes you've created in the layer that you create them (e.x. delete your apt cache in same layer that you ran apt)

There's a few more good tips in this article, just ignore the snarky title :)

Running Missions File

This may be a problem on our side, but doing a fresh install on another computer also reporst this problem when running straight.xml. How can this problem be solved?

[libprotobuf FATAL google/protobuf/stubs/common.cc:78] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.3.0). Contact the program author for an update. If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library. (Version verification failed in "/build/mir-O8_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'

The protobuf version reported by scrimmage is 3.3.0.

Thanks!

add custom button press feature

What would you guys think about a button press feature that would allow a custom button press to be configured by the user and trigger a callback in their plugins?

generate_scenarios cannot find SCRIMMAGE_ROOT

This issue is regarding scripts/generate_scenarios.py.

In the qsub function, generate_scenarios.py looks for SCRIMMAGE_ROOT, which is not defined in the current version of scrimmage. Here's the line:

scrimmage_root = os.getenv('SCRIMMAGE_ROOT')

My current workaround is defining SCRIMMAGE_ROOT before the script is run. For instance, in a shell script, I have a line like the following (with python3 for my most recent pull request, python2.7 otherwise):

(export SCRIMMAGE_ROOT=/path/to/scrimmage && source ~/.scrimmage/setup.bash && python3 ${SCRIMMAGE_ROOT}/scripts/generate_scenarios.py --ranges therangesfile.xml --num_runs=100 --nodes '1' /path/to/mission/file.xml /path/to/results/directory)

I haven't found any environment variables in my scrimmage setup that provide the path to scrimmage the way SCRIMMAGE_ROOT is supposed to. Is there a more-correct way to tell generate_scenarios.py where to find the scrimmage repo than my workaround? Thanks!

mistakes in some codes of tutorials

As a potential third-party developer, I found it is difficult to realize my designation follow tutorials and API document.
For some mistakes in tutorials and various parameters which i don't know how to use.

eg. the last code segment in Create a Sensor Plugin.
maybe it should be write as below? I can't make sure.

for (auto kv : parent_->sensors()) {
    if (kv.first == "MyNoisyState0") {
        // Take a measurement from the MyNoisyState sensor
        auto msg = kv.second->sense<sc::State>(t);
        if (msg) {
            own_state = msg->data;
        }
    }
}

OpenAI Plugin Error

Hi, I was going through the OpenAI Plugin Tutorial and everything ran/built correctly until I ran test_openai.py. I received the following error

Traceback (most recent call last):
File "test_openai.py", line 34, in
test_openai()
File "test_openai.py", line 18, in test_openai
env = gym.make('scrimmage-v0')
File "/home/rajan/.local/lib/python2.7/site-packages/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/home/rajan/.local/lib/python2.7/site-packages/gym/envs/registration.py", line 119, in make
env = spec.make()
File "/home/rajan/.local/lib/python2.7/site-packages/gym/envs/registration.py", line 86, in make
env = cls(**self._kwargs)
IndexError: map::at

Please let me know how I can resolve this error.

add parameter optimizer

This would be a simple utility that wraps generate scenarios and outputs optimal parameters.

make docs sphinx_git dependency

make docs fails if sphinx_git is not installed:

$ make docs
Scanning dependencies of target sphinx-docs
[ 50%] Building HTML documentation with Sphinx

Extension error:
Could not import extension sphinx_git (exception: No module named sphinx_git)
docs/CMakeFiles/sphinx-docs.dir/build.make:57: recipe for target 'docs/CMakeFiles/sphinx-docs' failed
make[3]: *** [docs/CMakeFiles/sphinx-docs] Error 1
CMakeFiles/Makefile2:3732: recipe for target 'docs/CMakeFiles/sphinx-docs.dir/all' failed
make[2]: *** [docs/CMakeFiles/sphinx-docs.dir/all] Error 2
CMakeFiles/Makefile2:3675: recipe for target 'docs/CMakeFiles/docs.dir/rule' failed
make[1]: *** [docs/CMakeFiles/docs.dir/rule] Error 2
Makefile:951: recipe for target 'docs' failed
make: *** [docs] Error 2

It looks like running setup/install-binaries.sh before starting the rest of the scrimmage build process didn't install sphinx_git, but after I ran sudo python2.7 -m pip install sphinx_git, make docs worked fine.

Text error in missions/waypoint_follower.xml file

Found a text error in the waypoint_follower.xml mission file:

line 12 reads:
<multi_threaded num_threads="8">false</num_threads>

should read:
<multi_threaded num_threads="8">false</multi_threaded>

Multi-Agent Simulation

To my understanding, by having mutliple actors set up, each actor will run its own instance of autonomy. Moving forward to the script, I get each actor new state given a respective action from the environment. On the other hand, I receive a reward that reflects the reward of both actors.
I want to share information between multiple actors while they run in the same environment, is this possible?

Thanks for the help!

Python version specification

The README says that, if I want to specify a particular Python version, I can set Python_ADDITIONAL_VERSIONS when I run cmake. However, this variable doesn't seem to be used in CMakeLists.txt, or anywhere else. Is there some other way to require the use of a specific Python version, and/or is this a planned enhancement? I went into the CMakeCache.txt and modified paths, but would prefer a simpler method if it is feasible. Thanks!

Entity interaction plugin stepped twice with t = 0

Noticed that entity interaction plugins are called twice with t = 0. This is a bug that could cause problems if needing to run some initialization code within the step function just once and relying on the time to do so.

You can re-create by just printing out t in any entity interaction plugin and watching the repeated 0.

bool SomeEntityInteraction::step_entity_interaction(std::list<sc::EntityPtr> &ents,
                                                    double t, double dt) {
  std::cout << "Step Entity Inter " << t << std::endl;
}

It looks like it was introduced by fd0544c

generate_plugin.sh has become dated

For example, if you generate a new autonomy plugin using the generate_plugin.sh script, it still uses the old desired_state_ variable instead of VariableIO.

add shapes to plugin base

Right now autonomies and entity interactions can draw shapes. It would be nice if sensors/network/etc plugins could do so as well.

OpenAI confuse

Today When trying to Install SCRIMMAGE Python Bindings and Create an OpenAI Plugin follow the tutorial.

when running the /path/to/scrimmage/python/test/test_openai.py, An error come
"AttributeError: 'ScrimmageEnv' object has no attribute '_render'"

when running the created test_openai.py referred by the tutorial, I cannot make the environment

Failed to open autonomy plugin: SimpleLearner
Failed to parse entity at start position: x=0, y=0
Failed to generate entity
[> ] 0 %
End of Simulation: No Entities Remaining

Simulation Complete
Traceback (most recent call last):
File "/home/lht/scrimmage/my-scrimmage-plugins/test/test_openai.py", line 39, in
test_openai()
File "/home/lht/scrimmage/my-scrimmage-plugins/test/test_openai.py", line 21, in test_openai
env = gym.make('scrimmage-v0')
File "/home/lht/anaconda3/lib/python3.6/site-packages/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/home/lht/anaconda3/lib/python3.6/site-packages/gym/envs/registration.py", line 119, in make
env = spec.make()
File "/home/lht/anaconda3/lib/python3.6/site-packages/gym/envs/registration.py", line 86, in make
env = cls(**self._kwargs)
File "/home/lht/scrimmage/scrimmage/python/scrimmage/external_control.py", line 101, in init
[self.queues[i]['env'].get() for i in range(num_actors)]
File "/home/lht/scrimmage/scrimmage/python/scrimmage/external_control.py", line 101, in
[self.queues[i]['env'].get() for i in range(num_actors)]
File "/home/lht/anaconda3/lib/python3.6/queue.py", line 164, in get
self.not_empty.wait()
File "/home/lht/anaconda3/lib/python3.6/threading.py", line 295, in wait
waiter.acquire()

ModuleNotFoundError: No module named 'scrimmage'

I followed this tutorial (http://www.scrimmagesim.org/docs/sphinx/html/tutorials/multiple-local-runs.html )
everything is okey when apply this ":~/scrimmage/scrimmage/scripts$ ./scrimmage_runner.sh -t 100 -m ../missions/straight-vs-motorschemas.xml -p 7 " command. Then I received error like this:

Traceback (most recent call last):
File "generate_scenarios.py", line 45, in
import scrimmage.utils as utils
ModuleNotFoundError: No module named 'scrimmage'
Failed to generate scenarios

USAGE:
./scrimmage_runner.sh [OPTIONS]

OPTIONS:
-h Display this usage information
-t Sets the number of simulation runs (tasks)
-m Mission file
-r Ranges file for generating new scenarios
-p Maximum number of parallel runs (tasks)

DEFAULTS:
-t=2 # 2 simulation runs
-p=1 # 1 simulation at-a-time

EXAMPLE:
Run 10 simulations, 4 at-a-time, straight.xml mission,
with test-1.xml ranges file:
./scrimmage_runner.sh -t 10 -p 4 -m ~/scrimmage/scrimmage/missions/straight.xml
-r ~/scrimmage/scrimmage/config/ranges/test-1.xml

I use 16.04 LTS Ubuntu dual boot.
Can you help for this error?
Thanks.

Consistent contact/entity references from all plugins

Some plugins provide access to entity pointers, some plugins prefer the contact map, and some use the id_to_ent_map_ implementation. We should decide if we really need these different ways of referencing entities and determine a single interface that works best.

Multi-Agent State/Observation

Given a multi-agent scenario, an array of x number of states is received. To be 100% sure, does these values, the states, represent a location in the environment for each agent or a x,y location specifically? I am tyring to eliminated position overlapping between agents.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.