-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fab7d7b
Showing
3,124 changed files
with
584,403 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 56ec7544e57e96ef6ff56b72104934f0 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rktl.purduearc.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
API Reference | ||
============= | ||
|
||
This page contains auto-generated API reference documentation [#f1]_. | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
|
||
/autoapi/rktl_autonomy/index | ||
/autoapi/rktl_planner/index | ||
/autoapi/simulator/index | ||
/autoapi/visualizer/index | ||
|
||
.. [#f1] Created with `sphinx-autoapi <https://github.com/readthedocs/sphinx-autoapi>`_ |
149 changes: 149 additions & 0 deletions
149
_sources/autoapi/rktl_autonomy/_ros_interface/index.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
:py:mod:`rktl_autonomy._ros_interface` | ||
====================================== | ||
|
||
.. py:module:: rktl_autonomy._ros_interface | ||
.. autoapi-nested-parse:: | ||
|
||
This handles the base behavior of manipulating time and interfacing with ROS. | ||
It gets subclassed to customize it to a specific ROS network's environment. | ||
|
||
License: | ||
BSD 3-Clause License | ||
Copyright (c) 2023, Autonomous Robotics Club of Purdue (Purdue ARC) | ||
All rights reserved. | ||
|
||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
rktl_autonomy._ros_interface.ROSInterface | ||
|
||
|
||
|
||
|
||
.. py:exception:: SimTimeException | ||
Bases: :py:obj:`Exception` | ||
|
||
For when advancing sim time does not go as planned. | ||
|
||
|
||
.. py:class:: ROSInterface(node_name='gym_interface', eval=False, launch_file=None, launch_args=[], run_id=None) | ||
Bases: :py:obj:`gym.Env` | ||
|
||
Extension of the Gym environment class for all specific interfaces | ||
to extend. This class handles logic regarding timesteps in ROS, and | ||
allows users to treat any ROS system as a Gym environment once the | ||
interface is created. | ||
|
||
All classes extending this for a particular environment must do the following: | ||
- implement all abstract properties: | ||
- action_space | ||
- observation_space | ||
- implement all abstract methods: | ||
- _reset_env() | ||
- _reset_self() | ||
- _has_state() | ||
- _clear_state() | ||
- _get_state() | ||
- _publish_action() | ||
- notify _cond when _has_state() may have turned true | ||
|
||
.. py:property:: action_space | ||
:abstractmethod: | ||
|
||
The Space object corresponding to valid actions. | ||
|
||
|
||
.. py:property:: observation_space | ||
:abstractmethod: | ||
|
||
The Space object corresponding to valid observations. | ||
|
||
|
||
.. py:method:: step(action) | ||
Implementation of gym.Env.step. This function will intentionally block | ||
if the ROS environment is not ready. | ||
|
||
Run one timestep of the environment's dynamics. When end of | ||
episode is reached, you are responsible for calling `reset()` | ||
to reset this environment's state. | ||
Accepts an action and returns a tuple (observation, reward, done, info). | ||
Args: | ||
action (object): an action provided by the agent | ||
Returns: | ||
observation (object): agent's observation of the current environment | ||
reward (float) : amount of reward returned after previous action | ||
done (bool): whether the episode has ended, in which case further step() calls will return undefined results | ||
info (dict): contains auxiliary diagnostic information (helpful for debugging, and sometimes learning) | ||
|
||
|
||
.. py:method:: reset() | ||
Resets the environment to an initial state and returns an initial observation. | ||
|
||
Note that this function should not reset the environment's random | ||
number generator(s); random variables in the environment's state should | ||
be sampled independently between multiple calls to `reset()`. In other | ||
words, each call of `reset()` should yield an environment suitable for | ||
a new episode, independent of previous episodes. | ||
Returns: | ||
observation (object): the initial observation. | ||
|
||
|
||
.. py:method:: __step_time_and_wait_for_state(max_retries=1) | ||
Step time until a state is known. | ||
|
||
|
||
.. py:method:: __wait_once_for_state() | ||
Wait and allow other threads to run. | ||
|
||
|
||
.. py:method:: _reset_env() | ||
:abstractmethod: | ||
|
||
Reset environment for a new episode. | ||
|
||
|
||
.. py:method:: _reset_self() | ||
:abstractmethod: | ||
|
||
Reset internally for a new episode. | ||
|
||
|
||
.. py:method:: _has_state() | ||
:abstractmethod: | ||
|
||
Determine if the new state is ready. | ||
|
||
|
||
.. py:method:: _clear_state() | ||
:abstractmethod: | ||
|
||
Clear state variables / flags in preparation for new ones. | ||
|
||
|
||
.. py:method:: _get_state() | ||
:abstractmethod: | ||
|
||
Get state tuple (observation, reward, done, info). | ||
|
||
|
||
.. py:method:: _publish_action(action) | ||
:abstractmethod: | ||
|
||
Publish an action to the ROS network. | ||
|
||
|
||
|
81 changes: 81 additions & 0 deletions
81
_sources/autoapi/rktl_autonomy/cartpole_direct_interface/index.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
:py:mod:`rktl_autonomy.cartpole_direct_interface` | ||
================================================= | ||
|
||
.. py:module:: rktl_autonomy.cartpole_direct_interface | ||
.. autoapi-nested-parse:: | ||
|
||
Cartpole is a very simple environment included within OpenAI Gym. There is not | ||
much of a reason to use it, except for verifying the functionality of this | ||
library. Two different interfaces are provided, `CartpoleInterface` and | ||
`CartpoleDirectInterface`. The former uses the `ROSInterface` class and the | ||
latter directly owns the Gym environment. To verify the `ROSInterface` worked, | ||
it was confirmed that they both behave the same way. | ||
|
||
License: | ||
BSD 3-Clause License | ||
Copyright (c) 2023, Autonomous Robotics Club of Purdue (Purdue ARC) | ||
All rights reserved. | ||
|
||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
rktl_autonomy.cartpole_direct_interface.CartpoleDirectInterface | ||
|
||
|
||
|
||
|
||
.. py:class:: CartpoleDirectInterface(eval=False, launch_file=['rktl_autonomy', 'cartpole_train.launch'], launch_args=[], run_id=None) | ||
Bases: :py:obj:`rktl_autonomy.ROSInterface` | ||
|
||
ROS interface for the cartpole game. | ||
|
||
.. py:property:: action_space | ||
The Space object corresponding to valid actions. | ||
|
||
|
||
.. py:property:: observation_space | ||
The Space object corresponding to valid observations. | ||
|
||
|
||
.. py:method:: _reset_env() | ||
Reset environment for a new training episode. | ||
|
||
|
||
.. py:method:: _reset_self() | ||
Reset internally for a new episode. | ||
|
||
|
||
.. py:method:: _has_state() | ||
Determine if the new state is ready. | ||
|
||
|
||
.. py:method:: _clear_state() | ||
Clear state variables / flags in preparation for new ones. | ||
|
||
|
||
.. py:method:: _get_state() | ||
Get state tuple (observation, reward, done, info). | ||
|
||
|
||
.. py:method:: _publish_action(action) | ||
Publish an action to the ROS network. | ||
|
||
|
||
|
117 changes: 117 additions & 0 deletions
117
_sources/autoapi/rktl_autonomy/cartpole_interface/index.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
:py:mod:`rktl_autonomy.cartpole_interface` | ||
========================================== | ||
|
||
.. py:module:: rktl_autonomy.cartpole_interface | ||
.. autoapi-nested-parse:: | ||
|
||
Cartpole is a very simple environment included within OpenAI Gym. There is not | ||
much of a reason to use it, except for verifying the functionality of this | ||
library. Two different interfaces are provided, `CartpoleInterface` and | ||
`CartpoleDirectInterface`. The former uses the `ROSInterface` class and the | ||
latter directly owns the Gym environment. To verify the `ROSInterface` worked, | ||
it was confirmed that they both behave the same way. | ||
|
||
License: | ||
BSD 3-Clause License | ||
Copyright (c) 2023, Autonomous Robotics Club of Purdue (Purdue ARC) | ||
All rights reserved. | ||
|
||
|
||
|
||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. autoapisummary:: | ||
|
||
rktl_autonomy.cartpole_interface.CartpoleActions | ||
rktl_autonomy.cartpole_interface.CartpoleInterface | ||
|
||
|
||
|
||
|
||
.. py:class:: CartpoleActions | ||
Bases: :py:obj:`enum.IntEnum` | ||
|
||
Possible actions for deep learner. | ||
|
||
.. py:attribute:: LEFT | ||
:value: 0 | ||
|
||
|
||
|
||
.. py:attribute:: RIGHT | ||
.. py:attribute:: SIZE | ||
.. py:class:: CartpoleInterface(eval=False, launch_file=['rktl_autonomy', 'cartpole_train.launch'], launch_args=[], run_id=None) | ||
Bases: :py:obj:`rktl_autonomy.ROSInterface` | ||
|
||
ROS interface for the cartpole game. | ||
|
||
.. py:property:: action_space | ||
The Space object corresponding to valid actions. | ||
|
||
|
||
.. py:property:: observation_space | ||
The Space object corresponding to valid observations. | ||
|
||
|
||
.. py:method:: _reset_env() | ||
Reset environment for a new training episode. | ||
|
||
|
||
.. py:method:: _reset_self() | ||
Reset internally for a new episode. | ||
|
||
|
||
.. py:method:: _has_state() | ||
Determine if the new state is ready. | ||
|
||
|
||
.. py:method:: _clear_state() | ||
Clear state variables / flags in preparation for new ones. | ||
|
||
|
||
.. py:method:: _get_state() | ||
Get state tuple (observation, reward, done, info). | ||
|
||
|
||
.. py:method:: _publish_action(action) | ||
Publish an action to the ROS network. | ||
|
||
|
||
.. py:method:: _obs_cb(obs_msg) | ||
Callback for observation of game. | ||
|
||
|
||
.. py:method:: _reward_cb(reward_msg) | ||
Callback for reward of game. | ||
|
||
|
||
.. py:method:: _done_cb(done_msg) | ||
Callback for if episode is done. | ||
|
||
|
||
|
Oops, something went wrong.