Skip to content

Commit

Permalink
Merge pull request #1 from gtri/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
kemen209 authored Jun 20, 2019
2 parents 4c52905 + 749cd0f commit 4e447e8
Show file tree
Hide file tree
Showing 218 changed files with 4,530 additions and 1,544 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ devel
tags*
**.swp
**.DS_Store
**.ccls*
.vscode
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ if (${VTK_FOUND})
set(OPENGL_MODULE vtkRenderingOpenGL2)
endif()

set(VTK_MODULES
set(VTK_MODULES
vtkFiltersSources
vtkFiltersTexture
vtkInteractionStyle
Expand All @@ -208,17 +208,15 @@ if (${VTK_FOUND})
${OPENGL_MODULE})

find_package(VTK QUIET NO_MODULE COMPONENTS ${VTK_MODULES})
endif()
endif()

if (NOT EXTERNAL AND ${VTK_FOUND})
if (${VTK_FOUND})
message(STATUS "Found VTK Version: ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
include_directories(SYSTEM ${VTK_INCLUDE_DIRS})
include(${VTK_USE_FILE})
add_definitions(-DENABLE_VIEWER=1)
add_definitions(-DENABLE_TERRAIN=1)
add_definitions(-DENABLE_VTK=1)
else()
add_definitions(-DENABLE_VIEWER=0)
add_definitions(-DENABLE_TERRAIN=0)
add_definitions(-DENABLE_VTK=0)
endif()

########################################################
Expand Down Expand Up @@ -262,6 +260,7 @@ if (OpenCV_FOUND)
add_library(scrimmage-opencv INTERFACE)
target_include_directories(scrimmage-opencv INTERFACE ${OpenCV_INCLUDE_DIRS})
target_compile_definitions(scrimmage-opencv INTERFACE -DENABLE_OPENCV=1)
target_link_libraries(scrimmage-opencv INTERFACE ${OpenCV_LIBRARIES})
install(TARGETS scrimmage-opencv EXPORT ${PROJECT_NAME}-targets)
else()
add_definitions(-DENABLE_OPENCV=0)
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,19 @@ dependencies).
### Install Custom Built Binary Dependencies

Some of SCRIMMAGE's dependencies have to be custom built from source. We
provide deb package binaries via the SCRIMMAGE PPA on Launchpad for these
custom built packages. First, add the PPA to your apt-get sources:
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), add the following PPA to your apt-get
sources:

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

For Ubuntu 18.04 (bionic), add the following PPA:

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

For both distributions, update your sources list:

$ sudo apt-get update

Now, install the SCRIMMAGE custom built binary dependencies:
Expand Down Expand Up @@ -135,8 +144,8 @@ your mouse.

## Building on macOS

Refer [here](https://github.com/crichardson332/homebrew-crich_brews) for instructions on installing dependencies and running
SCRIMMAGE on macOS.
Refer [here](https://github.com/crichardson332/homebrew-crich_brews) for
instructions on installing dependencies and running SCRIMMAGE on macOS.

## Python Bindings

Expand Down Expand Up @@ -427,4 +436,3 @@ interface with internet access from the commands:
Restart docker:

$ sudo service docker restart

26 changes: 13 additions & 13 deletions ci/dockerfiles/ubuntu-16.04
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ SHELL ["/bin/bash", "-c"]

# Install initial dependencies and setup .bashrc
RUN echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 \
&& apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
&& apt-get update \
&& apt-get install -y \
ros-kinetic-desktop-full \
software-properties-common \
python-software-properties \
python3-software-properties \
cppcheck \
python-pytest \
python-pip \
python3-pytest \
python3-pip \
git \
ninja-build \
clang \
Expand All @@ -31,11 +31,12 @@ RUN echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources
&& rosdep init && rosdep update \
&& echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc \
&& /opt/scrimmage/*/setup.sh \
&& pip install cpplint \
&& pip3 install cpplint \
protobuf==3.3.0 \
grpcio==1.2.1 \
gym==0.10.11 \
sphinx-git
sphinx-git \
sphinx_rtd_theme

# Install jekyll
RUN echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc \
Expand All @@ -46,7 +47,7 @@ RUN echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc \

# Copy install binaries script into image and run
COPY ./setup/install-binaries.sh /root/install-binaries.sh
RUN /root/install-binaries.sh -e 0 -p 3 \
RUN /root/install-binaries.sh -e 0 --python 3 \
&& rm -rf /var/lib/apt/lists/*

FROM dependencies as builder
Expand All @@ -58,8 +59,7 @@ COPY ./ /root/scrimmage/scrimmage
# Run static analysis tests
WORKDIR /root/scrimmage/scrimmage
RUN find -name __pycache__ -o -name "*.pyc" | xargs rm -rfv \
&& py.test test/test_cppcheck.py \
&& python test/test_cpplint.py
&& py.test-3 test/test_cppcheck.py

# Test Plugin Generation
WORKDIR /root/scrimmage/scrimmage/scripts
Expand All @@ -78,20 +78,20 @@ RUN mkdir -p build \
&& cd build \
&& source ~/.bashrc \
&& source ~/.scrimmage/setup.bash \
&& cmake .. -G Ninja -DBUILD_TESTS=ON -DBUILD_DOCS=ON -DCMAKE_CXX_FLAGS="-Werror" \
&& cmake .. -DPYTHON_MIN_VERSION=3 -G Ninja -DBUILD_TESTS=ON -DBUILD_DOCS=ON -DCMAKE_CXX_FLAGS="-Werror" \
&& ninja \
&& ninja docs website-docs

# install python package and run tests
WORKDIR /root/scrimmage/scrimmage/python
RUN pip install -e .
RUN pip3 install -e .

# run tests
WORKDIR /root/scrimmage/scrimmage/build
RUN source ~/.scrimmage/setup.bash && \
export SCRIMMAGE_MISSION_PATH=$SCRIMMAGE_MISSION_PATH:$PWD && \
export PYTHONPATH=$PYTHONPATH:$PWD/../test && \
py.test ../test/test_openai.py && \
py.test-3 ../test/test_openai.py && \
export CTEST_OUTPUT_ON_FAILURE=1 && \
ninja test && \
scrimmage ../missions/straight-no-gui.xml && \
Expand All @@ -113,7 +113,7 @@ RUN mkdir -p /root/catkin_ws/src \
&& make test

WORKDIR /root/scrimmage/scrimmage
RUN /bin/bash -c "source ~/.scrimmage/setup.bash && py.test python/tests"
RUN /bin/bash -c "source ~/.scrimmage/setup.bash && py.test-3 python/tests"

# Setup the scrimmage docker image to run as an executable
ENTRYPOINT ["/root/scrimmage/scrimmage/ci/scripts/scrimmage-wrapper.sh"]
Expand Down
2 changes: 1 addition & 1 deletion ci/dockerfiles/ubuntu-18.04
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apt-get update \
&& apt-get install -y \
gnupg \
&& echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 \
&& apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
&& apt-get update \
&& apt-get install -y \
ros-melodic-desktop-full \
Expand Down
Binary file added data/gui/obj/zephyr/wing-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions data/gui/obj/zephyr/zephyr-green.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://gtri.gatech.edu"?>
<params>
<model>wing.obj</model>
<texture>wing-green.png</texture>
<!--<visual_scale>0.004598789</visual_scale> -->
<visual_scale>0.000658892</visual_scale> <!-- 1 m width -->
<visual_rpy>0 0 90</visual_rpy>
</params>
2 changes: 1 addition & 1 deletion docs/jekyll/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ plugins:
# - about.md
# - other.md

baseurl: "/scrimmage"
#baseurl: "/scrimmage"
69 changes: 69 additions & 0 deletions docs/source/overview/design-principles.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Design Principles
======================

Entity state() vs state_truth()
-------------------------------

The purpose of the separate ``state()`` and ``state_truth()`` shared pointers
is to allow the researcher to simulate the effects of introducing noise into
the entity's own position, velocity, orientation, etc. When the researcher is
not concerned with introducing state noise, the ``state()`` and
``state_truth()`` pointers point to the same memory location. However, if the
researcher wants to introduce state noise, a sensor plugin can be used to
create a new state pointer instance and assign the pointers appropriately. For
example, in the ``init()`` function of the ``SimpleINS`` plugin, the following
code creates a new State pointer to hold noisy state information:

.. code-block:: c++
:linenos:

// Create a new State instance
parent_->state() = std::make_shared<State>();

// Initialize the new state's values with the ground truth values
*(parent_->state()) = *(parent_->state_truth());
In the ``step()`` function, the plugin copies the ``state_truth()`` pointer,

.. code-block:: c++
:linenos:

StateWithCovariance ns(*(parent_->state_truth()));
adds noise to the copied state values, and then assigns the ``state()`` pointer
with the noisy values:

.. code-block:: c++
:linenos:

*(parent_->state()) = static_cast<sc::State>(msg->data);
This allows the autonomy and controller plugins to only have to consider the
``state_`` pointer without having to consider whether ground truth or noisy
state information is being used in the simulation. However, the developer has
to determine whether they need to access the possibly noisy ``state()`` or the
``state_truth()`` pointers when writing sensor, interaction, metric, and
network plugins. Motion model plugins only need to consider the ``state_``
pointer since they are always initialized with the ``ground_truth_`` pointer in
``Entity.cpp``.

Testing a Real INS System
~~~~~~~~~~~~~~~~~~~~~~~~~

A real inertial navigation system (INS) will take inputs from GPS, LIDAR,
accelerometers, and gyroscopes. If the researcher wants to develop and simulate
an INS implementation, GPS, LIDAR, accelerometer, and gyroscope sensor plugins
should be configured to publish their respective data to an INS sensor
plugin. The INS sensor plugin should be the only the sensor plugin that makes
and reassigns the ``state()`` pointer in its ``init()`` function. After each
step of the INS sensor plugin, it should assign the ``state()`` pointer with
its best estimate of the entity's state. This will allow the entity's autonomy
and controller plugins to use this best estimated state for later calculations.


Noisy Contacts
--------------

For now, the developer can use the NoisyContacts sensor plugin. However, we
will soon be developing a noisy / ground truth interface to contacts that is
similar to the entity's interface.
Loading

0 comments on commit 4e447e8

Please sign in to comment.