Skip to content

Commit ad2a796

Browse files
committed
[SymForce-External] Epsilon tutorial, rename ops tutorial
Import of #135 ORIGINAL_AUTHOR = Aaron Miller [email protected] - Epsilon tutorial, rename ops tutorial - More docs and tutorials updates - add intro to epsilon tutorial - Update optimization tutorial - Update README.md - Update wording on build in readme - Rename requirements.txt to dev_requirements.txt - Update theme settings - skymarshal updates - update sym packaging - Fix more stuff - Fix dev.rst, new badges + classifiers - Fix skymarshal setup.py - Data files, sym -> symforce-sym, scipy required - Fix tests, hopefully - Bump version to 0.4.0 - Fix tests
1 parent 0bb830d commit ad2a796

22 files changed

+650
-447
lines changed

README.md

Lines changed: 62 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
<a href="https://symforce.org"><img alt="Documentation" src="https://img.shields.io/badge/api-docs-blue" /></a>
99
<a href="https://github.com/symforce-org/symforce"><img alt="Source Code" src="https://img.shields.io/badge/source-code-blue" /></a>
1010
<a href="https://github.com/symforce-org/symforce/issues"><img alt="Issues" src="https://img.shields.io/badge/issue-tracker-blue" /></a>
11-
<img alt="Python 3.8" src="https://img.shields.io/badge/python-3.8-blue" />
11+
<img alt="Python 3.8 | 3.9 | 3.10" src="https://img.shields.io/pypi/pyversions/symforce" />
1212
<img alt="C++14" src="https://img.shields.io/badge/c++-14-blue" />
13+
<a href="https://pypi.org/project/symforce/"><img alt="PyPI" src="https://img.shields.io/pypi/v/symforce" /></a>
14+
<a href="https://github.com/symforce-org/symforce/tree/main/LICENSE"><img alt="Apache License" src="https://img.shields.io/pypi/l/symforce" /></a>
1315
</p>
1416

1517
---
@@ -48,88 +50,30 @@ SymForce is developed and maintained by [Skydio](https://skydio.com/). It is use
4850
SymForce was published to [RSS 2022](https://roboticsconference.org/). Please cite it as follows:
4951

5052
```
51-
@inproceedings{Martiros-RSS-22,
52-
author = {Hayk Martiros AND Aaron Miller AND Nathan Bucki AND Bradley Solliday AND Ryan Kennedy AND Jack Zhu AND Tung Dang AND Dominic Pattison AND Harrison Zheng AND Teo Tomic AND Peter Henry AND Gareth Cross AND Josiah VanderMey AND Alvin Sun AND Samuel Wang AND Kristen Holtz},
53-
title = {{SymForce: Symbolic Computation and Code Generation for Robotics}},
54-
booktitle = {Proceedings of Robotics: Science and Systems},
55-
year = {2022},
56-
doi = {10.15607/RSS.2022.XVIII.041}
57-
}
53+
@inproceedings{Martiros-RSS-22,
54+
author = {Hayk Martiros AND Aaron Miller AND Nathan Bucki AND Bradley Solliday AND Ryan Kennedy AND Jack Zhu AND Tung Dang AND Dominic Pattison AND Harrison Zheng AND Teo Tomic AND Peter Henry AND Gareth Cross AND Josiah VanderMey AND Alvin Sun AND Samuel Wang AND Kristen Holtz},
55+
title = {{SymForce: Symbolic Computation and Code Generation for Robotics}},
56+
booktitle = {Proceedings of Robotics: Science and Systems},
57+
year = {2022},
58+
doi = {10.15607/RSS.2022.XVIII.041}
59+
}
5860
```
5961

60-
# Build from pip
62+
# Install
6163

62-
SymForce requires Python 3.8 or later. We suggest creating a virtual python environment.
64+
Install with pip:
6365

64-
Install the `gmp` package with one of:
65-
```
66-
apt install libgmp-dev # Linux
67-
brew install gmp # Mac
68-
conda install -c conda-forge gmp # Conda
69-
```
70-
71-
Install SymForce
72-
```
73-
pip install -e .
66+
```bash
67+
pip install symforce
7468
```
7569

7670
Verify the installation in Python:
7771
```python
7872
>>> from symforce import geo
7973
>>> geo.Rot3()
8074
```
81-
<span style="color:blue">TODO: Create wheels for <code style="color:blue"><b>pip install symforce</b></code></span>
82-
83-
# Build CMake yourself (TODO deconflict)
84-
85-
SymForce requires Python 3.8 or later. We suggest creating a virtual python environment.
86-
87-
Install packages:
88-
```
89-
# Linux
90-
apt install doxygen libgmp-dev pandoc
91-
92-
# Mac
93-
brew install doxygen gmp pandoc
94-
95-
# Conda
96-
conda install -c conda-forge doxygen gmp pandoc
97-
```
98-
99-
Install python requirements:
100-
```
101-
pip install -r requirements.txt
102-
```
10375

104-
Install CMake if you don't already have a recent version:
105-
```
106-
pip install "cmake>=3.19"
107-
```
108-
109-
Build SymForce (requires C++14 or later):
110-
```
111-
mkdir build
112-
cd build
113-
cmake ..
114-
make -j 7
115-
```
116-
If you have build errors, try updating CMake.
117-
118-
Install built Python packages:
119-
```
120-
cd ..
121-
pip install -e build/lcmtypes/python2.7
122-
pip install -e gen/python
123-
pip install -e .
124-
```
125-
126-
Verify the installation in Python:
127-
```python
128-
>>> from symforce import geo
129-
>>> geo.Rot3()
130-
```
131-
132-
<span style="color:blue">TODO: Create wheels for <code style="color:blue"><b>pip install symforce</b></code></span>
76+
This installs pre-compiled C++ components of SymForce on Linux and Mac using pip wheels, but does not include C++ headers. If you want to compile against C++ SymForce types (like `sym::Optimizer`), you currently need to [build from source](#build-from-source).
13377

13478
# Tutorial
13579

@@ -226,7 +170,7 @@ geo.V3.symbolic("x").norm(epsilon=sm.epsilon)
226170

227171
<!-- $\sqrt{x_0^2 + x_1^2 + x_2^2 + \epsilon}$ -->
228172

229-
<span style="color:blue">TODO: Link to a detailed epsilon tutorial once created.</span>
173+
See the [Epsilon Tutorial](https://symforce.org/notebooks/epsilon_tutorial.html) in the SymForce Docs for more information.
230174

231175
## Build an optimization problem
232176

@@ -574,6 +518,52 @@ $ -->
574518

575519
To learn more, visit the SymForce tutorials [here](https://symforce.org/#guides).
576520

521+
# Build from Source
522+
523+
SymForce requires Python 3.8 or later. We strongly suggest creating a virtual python environment.
524+
525+
Install the `gmp` package with one of:
526+
```bash
527+
apt install libgmp-dev # Ubuntu
528+
brew install gmp # Mac
529+
conda install -c conda-forge gmp # Conda
530+
```
531+
532+
SymForce contains both C++ and Python code. The C++ code is built using CMake. You can build the package either by calling pip, or by calling CMake directly. If building with `pip`, this will call CMake under the hood, and run the same CMake build for the C++ components.
533+
534+
If you encounter build issues, please file an [issue](https://github.com/symforce-org/symforce/issues).
535+
536+
## Build with pip
537+
538+
The recommended way to build and install SymForce if you only plan on making Python changes is with pip. From the symforce directory:
539+
```bash
540+
pip install -e .
541+
```
542+
543+
This will build the C++ components of SymForce, but you won't be able to run `pip install -e .` repeatedly if you need to rebuild C++ code. If you're changing C++ code and rebuilding, you should build with CMake directly as described [below](#build-with-cmake).
544+
545+
`pip install .` will not install pinned versions of SymForce's dependencies, it'll install any compatible versions. It also won't install all packages required to run all of the SymForce tests and build all of the targets (e.g. building the docs or running the linters). If you want all packages required for that, you should `pip install .[dev]` instead (or one of the other groups of extra requirements in our `setup.py`). If you additionally want pinned versions of our dependencies, which are the exact versions guaranteed by CI to pass all of our tests, you can install them from `pip install -r dev_requirements.txt`.
546+
547+
## Build with CMake
548+
549+
If you'll be modifying the C++ parts of SymForce, you should build with CMake directly instead - this method will not install
550+
SymForce into your Python environment, so you'll need to add it to your PYTHONPATH separately.
551+
552+
Install python requirements:
553+
```bash
554+
pip install -r dev_requirements.txt
555+
```
556+
557+
Build SymForce (requires C++14 or later):
558+
```bash
559+
mkdir build
560+
cd build
561+
cmake ..
562+
make -j $(nproc)
563+
```
564+
565+
You'll then need to add SymForce (along with `gen/python` and `third_party/skymarshal` within symforce) to your PYTHONPATH in order to use them.
566+
577567
# License
578568

579569
SymForce is released under the [Apache 2.0](https://spdx.org/licenses/Apache-2.0.html) license.
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ docutils==0.17.1
6565
# myst-parser
6666
# nbsphinx
6767
# sphinx
68-
# sphinx-rtd-theme
6968
entrypoints==0.4
7069
# via
7170
# jupyter-client
@@ -177,15 +176,19 @@ nest-asyncio==1.5.5
177176
numpy==1.22.3
178177
# via
179178
# matplotlib
179+
# pandas
180180
# scipy
181181
# skymarshal
182182
# symforce (setup.py)
183+
# symforce-sym
183184
packaging==21.3
184185
# via
185186
# ipykernel
186187
# matplotlib
187188
# nbconvert
188189
# sphinx
190+
pandas==1.4.2
191+
# via symforce (setup.py)
189192
pandocfilters==1.5.0
190193
# via nbconvert
191194
parso==0.8.3
@@ -206,6 +209,8 @@ platformdirs==2.5.1
206209
# via
207210
# black
208211
# pylint
212+
plotly==5.8.0
213+
# via symforce (setup.py)
209214
ply==3.11
210215
# via skymarshal
211216
prompt-toolkit==3.0.29
@@ -235,8 +240,11 @@ python-dateutil==2.8.2
235240
# via
236241
# jupyter-client
237242
# matplotlib
243+
# pandas
238244
pytz==2022.1
239-
# via babel
245+
# via
246+
# babel
247+
# pandas
240248
pyyaml==6.0
241249
# via myst-parser
242250
pyzmq==22.3.0
@@ -263,12 +271,9 @@ sphinx==4.5.0
263271
# myst-parser
264272
# nbsphinx
265273
# sphinx-autodoc-typehints
266-
# sphinx-rtd-theme
267274
# symforce (setup.py)
268275
sphinx-autodoc-typehints==1.14.1
269276
# via symforce (setup.py)
270-
sphinx-rtd-theme==1.0.0
271-
# via symforce (setup.py)
272277
sphinxcontrib-applehelp==1.0.2
273278
# via sphinx
274279
sphinxcontrib-devhelp==1.0.2
@@ -287,6 +292,8 @@ file:./gen/python
287292
# via symforce (setup.py)
288293
sympy==1.10.1
289294
# via symforce (setup.py)
295+
tenacity==8.0.1
296+
# via plotly
290297
tinycss2==1.1.1
291298
# via nbconvert
292299
tokenize-rt==4.2.1

docs/conf.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,34 @@
114114
# The theme to use for HTML and HTML Help pages. See the documentation for
115115
# a list of builtin themes.
116116
#
117-
html_theme = "sphinx_rtd_theme"
117+
html_theme = "alabaster"
118118

119119
# Theme options are theme-specific and customize the look and feel of a theme
120120
# further. For a list of options available for each theme, see the
121121
# documentation.
122122
#
123123
html_theme_options = {
124+
"description": "Fast symbolic computation, code generation, and nonlinear optimization for robotics",
125+
"fixed_sidebar": False,
126+
"page_width": "1200px",
127+
"github_button": True,
128+
"github_user": "symforce-org",
129+
"github_repo": "symforce",
130+
"github_type": "star",
124131
# 'canonical_url': '',
125132
# 'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
126133
# 'logo_only': False,
127-
"display_version": True,
134+
# "display_version": True,
128135
# 'prev_next_buttons_location': 'bottom',
129136
# 'style_external_links': False,
130137
# 'vcs_pageview_mode': '',
131138
# 'style_nav_header_background': 'white',
132139
# Toc options
133-
"collapse_navigation": False,
134-
"sticky_navigation": True,
135-
"navigation_depth": -1,
136-
"includehidden": True,
137-
"titles_only": True,
140+
# "collapse_navigation": False,
141+
# "sticky_navigation": True,
142+
# "navigation_depth": -1,
143+
"sidebar_includehidden": True,
144+
# "titles_only": True,
138145
}
139146

140147
# Add any paths that contain custom static files (such as style sheets) here,

docs/development.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ See the :ref:`module reference <api-reference>` for the core package structure.
1515
*************************************************
1616
Build
1717
*************************************************
18-
SymForce is primarily written in Python, aimed to be 3.8+ compatible. It has a top level Makefile to execute high level commands:
18+
SymForce is primarily written in Python and C++, and is Python 3.8+ and C++14 compatible. The build
19+
system is CMake for the C++ components, and optionally pip / setuptools on top for Python packaging.
20+
See the Build section on the [Homepage](/index.html#build-from-source) for build instructions.
21+
22+
23+
*************************************************
24+
Additional useful commands
25+
*************************************************
26+
SymForce also has a top level Makefile which is not used by the build, but provides some high
27+
level commands for development:
1928

2029
+----------------------------------------------+--------------------------+
21-
| Install requirements | ``make all_reqs`` |
22-
+----------------------------------------------+--------------------------+
23-
| Run tests | ``make test`` |
30+
| Run Python tests | ``make test`` |
2431
+----------------------------------------------+--------------------------+
2532
| Run tests which update (most) generated code | ``make test_update`` |
2633
+----------------------------------------------+--------------------------+
@@ -32,18 +39,12 @@ SymForce is primarily written in Python, aimed to be 3.8+ compatible. It has a t
3239
+----------------------------------------------+--------------------------+
3340
| Build docs + open in browser | ``make docs_open`` |
3441
+----------------------------------------------+--------------------------+
35-
| Launch Jupyter server | ``make notebook`` |
36-
+----------------------------------------------+--------------------------+
37-
| Launch Jupyter server + browser | ``make notebook_open`` |
38-
+----------------------------------------------+--------------------------+
3942
| Run the code formatter (black, clang-format) | ``make format`` |
4043
+----------------------------------------------+--------------------------+
4144
| Check types with mypy | ``make check_types`` |
4245
+----------------------------------------------+--------------------------+
4346
| Check formatting and types | ``make lint`` |
4447
+----------------------------------------------+--------------------------+
45-
| Clean all build products | ``make clean`` |
46-
+----------------------------------------------+--------------------------+
4748

4849
*************************************************
4950
Documentation

docs/index.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
SymForce Docs
1+
SymForce Home
22
=============
33

44
.. include:: ../README.md
55
:parser: myst_parser.sphinx_
66

7-
Guides
8-
======
9-
107
.. toctree::
118
:caption: Pages
129
:hidden:
1310

1411
self
1512
development
13+
14+
.. toctree::
15+
:caption: Tutorials
16+
:hidden:
17+
1618
notebooks/sympy_tutorial
1719
notebooks/geometry_tutorial
1820
notebooks/ops_tutorial
1921
notebooks/cameras_tutorial
2022
notebooks/values_tutorial
2123
notebooks/codegen_tutorial
2224
notebooks/optimization_tutorial
25+
notebooks/epsilon_tutorial
26+
27+
Guides
28+
======
2329

2430
:doc:`development`
2531
How to build, configure, and develop
@@ -31,7 +37,7 @@ Guides
3137
Introductory guide to doing math and geometry
3238

3339
:doc:`notebooks/ops_tutorial`
34-
Introductory guide to using Concepts in symforce
40+
Introductory guide to using Ops in symforce
3541

3642
:doc:`notebooks/cameras_tutorial`
3743
Introductory guide to using camera models
@@ -45,6 +51,9 @@ Guides
4551
:doc:`notebooks/optimization_tutorial`
4652
Basic example of using generated code to do optimization
4753

54+
:doc:`notebooks/epsilon_tutorial`
55+
Guide to how Epsilon is used to prevent singularities
56+
4857
.. _api-reference:
4958
.. toctree::
5059
:hidden:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../notebooks/epsilon_tutorial.ipynb

0 commit comments

Comments
 (0)