Add bullet thirdparty library
BIN
thirdparty/bullet/docs/BulletQuickstart.pdf
vendored
Normal file
BIN
thirdparty/bullet/docs/Bullet_User_Manual.pdf
vendored
Normal file
BIN
thirdparty/bullet/docs/GPU_rigidbody_using_OpenCL.pdf
vendored
Normal file
106
thirdparty/bullet/docs/latex/BulletQuickstart.tex
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
|
||||
% Bullet Physics manual
|
||||
% http://bulletphysics.org
|
||||
% Written by Erwin Coumans
|
||||
|
||||
% Preamble (global definitions of the book/manual)
|
||||
% Use openany option for documentclass to avoid empty page after TOC
|
||||
|
||||
\documentclass[openany]{book}
|
||||
%scrbook is easier on the eyes, and use a bigger font
|
||||
%\documentclass[openany,DIV=calc,16pt]{scrbook}
|
||||
|
||||
% The english package can help breaking words
|
||||
\usepackage[english]{babel}
|
||||
|
||||
%The Charter or Utopia font is easier on the eyes for screen
|
||||
\renewcommand{\familydefault}{bch}%Charter font
|
||||
%\renewcommand{\familydefault}{put} %Utopia font
|
||||
|
||||
|
||||
% Titlepic allows us to use a picture on the frontpage
|
||||
\usepackage{titlepic}
|
||||
\usepackage{graphicx}
|
||||
|
||||
\usepackage[a4paper, left=2cm, right=1cm, top=2cm, bottom=3.5cm]{geometry}
|
||||
\usepackage[latin1]{inputenc}
|
||||
|
||||
% If using \doublespacing include the setspace package
|
||||
% \usepackage{setspace}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{tocloft}
|
||||
|
||||
|
||||
% The hyperref package already include package url
|
||||
\usepackage[colorlinks=true, linkcolor=blue, urlcolor=blue]{hyperref}
|
||||
|
||||
% \setcounter{secnumdepth}{4}
|
||||
\usepackage{makeidx}\makeindex
|
||||
|
||||
%support for C++ source code snippets
|
||||
%you can even import existing C++ code as-is
|
||||
%or a range of lines within markers beween rangeprefix/rangesuffix
|
||||
\usepackage{listings}
|
||||
%\usepackage{color}
|
||||
\renewcommand{\lstlistingname}{Source Code}
|
||||
\renewcommand{\lstlistlistingname}{Source Code Listings}
|
||||
\lstset{
|
||||
tabsize=2, language=C++, keywordstyle=\color[rgb]{0,0,1},
|
||||
commentstyle=\color[rgb]{0.133,0.545,0.133},
|
||||
stringstyle=\color[rgb]{0.627,0.126,0.941},
|
||||
breaklines=true,
|
||||
numberstyle=\small,
|
||||
basicstyle=\ttfamily\small,
|
||||
rangeprefix=///-----, rangesuffix=-----,
|
||||
includerangemarker=false,
|
||||
numbers=left, stepnumber=1,
|
||||
frame=single,
|
||||
}
|
||||
|
||||
|
||||
% Set the tolerance so TeX really breaks the line
|
||||
% and don't run into the right margin (avoid overfull boxes)
|
||||
\tolerance=10000
|
||||
|
||||
%end of preamble
|
||||
|
||||
\begin{document}
|
||||
|
||||
% \pagestyle{fancy}
|
||||
|
||||
%\pagenumbering{}
|
||||
%
|
||||
\title{\textbf{Bullet 2.83 Quickstart Guide}}
|
||||
\titlepic{\includegraphics[width=0.4\textwidth]{bullet_logo_2010_9.eps}}
|
||||
%
|
||||
\author{Erwin Coumans}
|
||||
\maketitle
|
||||
|
||||
|
||||
\renewcommand{\cftchapdotsep}{\cftdotsep}
|
||||
\tableofcontents
|
||||
\pagenumbering{arabic}
|
||||
|
||||
% \fancyhf{}
|
||||
% \doublespacing
|
||||
|
||||
% include all the chapters as separate tex files
|
||||
% on Mac OSX it is really nice to use the Texpad application for automatic navigation
|
||||
|
||||
|
||||
\include{intro}
|
||||
\include{building}
|
||||
\include{helloworld}
|
||||
\include{faq}
|
||||
|
||||
\clearpage
|
||||
\addcontentsline{toc}{chapter}{Source code listings}
|
||||
\lstlistoflistings
|
||||
|
||||
\clearpage
|
||||
\addcontentsline{toc}{chapter}{Index}
|
||||
\printindex
|
||||
|
||||
|
||||
\end{document}
|
||||
|
||||
42
thirdparty/bullet/docs/latex/building.tex
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
\chapter{Building the Bullet SDK and demos}
|
||||
Windows developers can download the zipped sources of Bullet from \url{http://bullet.googlecode.com}. Mac OS X, Linux and other developers should download the gzipped tar archive.
|
||||
Bullet provides several build systems.
|
||||
|
||||
\section{Using Premake}
|
||||
\index{premake}\href{http://industriousone.com/premake}{Premake} is a meta build system based on the Lua scripting language that can generate project files for Microsoft Visual Studio, Apple Xcode as well as Makefiles for GNU make and other build systems. Bullet comes with Premake executables for Windows, Mac OSX and Linux.
|
||||
\subsection{Premake Visual Studio project generation}
|
||||
You can double-click on \path{Bullet/build/vs2010.bat} to generate Visual Studio 2010 project files and solution. This batch file calls Premake. Just open \path{Bullet/build/vs2010/0BulletSolution.sln}. Newer versions of Visual Studio should automatically convert from the 2010 solution.
|
||||
\subsection{Premake Mac OSX Xcode project generation}
|
||||
On Mac OSX it is easiest to open a Terminal window and switch current directory to Bullet/build and use the following command to generate XCode projects:
|
||||
\begin{lstlisting}[caption=Premake for Mac OSX, label=premake_osx]
|
||||
cd Bullet/build
|
||||
./premake_osx xcode4
|
||||
open xcode4/0BulletSolution.xcworkspace
|
||||
\end{lstlisting}
|
||||
|
||||
\subsection{Premake GNU Makefile generation}
|
||||
You can also generate GNU Makefiles for Mac OSX or Linux using premake:
|
||||
\begin{lstlisting}[caption=Premake to GNU Makefile, label=premake_make]
|
||||
cd Bullet/build
|
||||
./premake_osx gmake
|
||||
cd gmake
|
||||
make config=release64
|
||||
\end{lstlisting}
|
||||
\section{Using cmake}
|
||||
Similar to premake, CMake adds support for many other build environments and platforms, including Microsoft Visual Studio, XCode for Mac OSX, KDevelop for Linux and Unix Makefiles. Download and install \index{CMake}CMake from \url{http://cmake.org} and use the CMake cmake-gui tool. Alternatively use a terminal, change to the Bullet root directory and use for example the following commands:
|
||||
|
||||
\begin{lstlisting}[caption=CMake to GNU Makefile, label=cmake_make]
|
||||
cmake .
|
||||
make
|
||||
\end{lstlisting}
|
||||
An example to create an XCode project on Mac OSX using CMake:
|
||||
\begin{lstlisting}[caption=CMake to Xcode, label=cmake_xcode]
|
||||
mkdir xcode
|
||||
cd xcode
|
||||
cmake .. -G Xcode
|
||||
open BULLET_PHYSICS.xcodeproj
|
||||
\end{lstlisting}
|
||||
|
||||
|
||||
\section{Executing the Example Browser}
|
||||
After building the SDK, there are some binary executables in the bin folder. You can execute the $bin/App_ExampleBrowser_*$ to experiment with the Bullet Physics SDK.
|
||||
1815
thirdparty/bullet/docs/latex/bullet_logo_2010_9.eps
vendored
Normal file
3
thirdparty/bullet/docs/latex/faq.tex
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
\chapter{Frequently asked questions}
|
||||
Here is a placeholder for a future FAQ. For more information it is best to visit the Bullet Physics forums and wiki at \url{http://bulletphysics.org}.
|
||||
17
thirdparty/bullet/docs/latex/helloworld.tex
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
\chapter{Hello World}
|
||||
\section{C++ console program}
|
||||
Let's discuss the creation of a basic Bullet simulation from the beginning to the end. For simplicity we print the state of the simulation to console using printf, instead of using 3D graphics to display the objects. The source code of this tutorial is located in \path{examples/HelloWorld/HelloWorld.cpp}.
|
||||
|
||||
It is a good idea to try to compile, link and run this HelloWorld.cpp program first.
|
||||
|
||||
As you can see in \ref{helloworld_includefiles} you can include a convenience header file \path{btBulletDynamicsCommon.h}.
|
||||
|
||||
While linking to Bullet Physics make sure the link order is: BulletSoftBody, BulletDynamics, BulletCollision and LinearMath.
|
||||
|
||||
\lstinputlisting[caption=HelloWorld.cpp include header, label=helloworld_includefiles,linerange=includes_start-includes_end]{../../examples/HelloWorld/HelloWorld.cpp}
|
||||
Now we create the dynamics world:
|
||||
\lstinputlisting[caption=HelloWorld.cpp initialize world, label=stepsimulation,linerange=initialization_start-initialization_end]{../../examples/HelloWorld/HelloWorld.cpp}
|
||||
Once the world is created you can step the simulation as follows:
|
||||
\lstinputlisting[caption=HelloWorld.cpp step simulation, label=stepsimulation,linerange=stepsimulation_start-stepsimulation_end]{../../examples/HelloWorld/HelloWorld.cpp}
|
||||
At the end of the program you delete all objects in the reverse order of creation. Here is the cleanup listing of our HelloWorld.cpp program.
|
||||
\lstinputlisting[caption=HelloWorld.cpp cleanup, label=cleanup,linerange=cleanup_start-cleanup_end]{../../examples/HelloWorld/HelloWorld.cpp}
|
||||
53
thirdparty/bullet/docs/latex/intro.tex
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
%Use the \path{Demos/MyDemo} instead of \texttt{Demos/MyDemo} otherwise text doesn't wrap
|
||||
%and runs into the right margin
|
||||
|
||||
\chapter{Introduction to Bullet}
|
||||
%\section{blablaIntroduction}
|
||||
Bullet Physics is a professional open source collision detection, rigid body and soft body dynamics library. Bullet Physics targets real-time and interactive use in games, visual effects in movies and robotics. The library is free for commercial use under the \index{zlib license} \href{http://opensource.org/licenses/zlib-license.php}{zlib license}.
|
||||
|
||||
\section{Main Features}
|
||||
|
||||
\begin{itemize}
|
||||
\item Open source C++ code under zlib license and free for any commercial use on all platforms including PLAYSTATION 3, XBox 360, Wii, PC, Linux, Mac OSX, Android and iPhone
|
||||
\item Discrete and continuous collision detection including ray and convex sweep test. Collision shapes include concave and convex meshes and all basic primitives
|
||||
\item Fast and stable rigid body dynamics constraint solver, vehicle dynamics, character controller and slider, hinge, generic 6DOF and cone twist constraint for ragdolls
|
||||
\item Soft Body dynamics for cloth, rope and deformable volumes with two-way interaction with rigid bodies, including constraint support
|
||||
\item Native binary .bullet file format and example importers for URDF, Wavefront obj and Quake bsp files.
|
||||
\end{itemize}
|
||||
|
||||
\section{Contact and Support}
|
||||
\begin{itemize}
|
||||
\item Public forum for support and feedback is available at \url{http://bulletphysics.org}
|
||||
\end{itemize}
|
||||
|
||||
\section{What's new}
|
||||
|
||||
\subsection{New in Bullet 2.83}
|
||||
\begin{itemize}
|
||||
\item New ExampleBrowser, replacing the standalone demos. Not all demos have been ported over yet, it will happen in upcoming releases. It is recommended to use an OpenGL 3+ system, although there is limited OpenGL 2 fallback. See \path{examples/ExampleBrowser}.
|
||||
\item Import of Universal Robot Description Files (URDF). See \path{examples/Importers/ImportURDFDemo}. You can use File-Open in the ExampleBrowser.
|
||||
\item Improved support for btMultiBody with multi-degree of freedom mobilizers, thanks to Jakub Stepien. See \path{examples/MultiBody/MultiDofDemo}.
|
||||
\item New btGeneric6DofSpring2Constraint, replacing the old generic 6dof constraint, thanks to Gabor PUHR and Tamas Umenhoffer. See \path{examples/Dof6Spring2Setup}
|
||||
\item OpenCL demo integrated in the ExampleBrowser. The demo is disabled by default, because it only works on high-end desktop GPU systems with compatible up-to-date OpenCL 1.1+ driver. Use $--enable\_experimental\_opencl$ command-line argument in the ExampleBrowser.
|
||||
|
||||
|
||||
\end{itemize}
|
||||
\subsection{New in Bullet 2.82}
|
||||
\begin{itemize}
|
||||
\item Featherstone articulated body algorithm implementation with integration in the Bullet constraint solver. See \path{examples/MultiBodyDemo}
|
||||
\item New MLCP constraint solver interface for higher quality direct solvers. Dantzig (OpenDE), PATH and Projected Gauss Seidel MLCP solvers, with fallback to the original Bullet sequential impulse solver. See \path{src/BulletDynamics/MLCPSolvers}
|
||||
\item New btFixedConstraint as alternative to a btGeneric6DofConstraint with all DOFs locked. See \path{Demos/VoronoiFractureDemo}
|
||||
\item Various bug fixes, related to force feedback and friction. Improved performance between btCompoundShape using the new btCompoundCompoundCollisionAlgorithm. See the commit log at \url{https://code.google.com/p/bullet/source/list}
|
||||
\end{itemize}
|
||||
\subsection{New in Bullet 2.81}
|
||||
\begin{itemize}
|
||||
\item SIMD and Neon optimizations for iOS and Mac OSX, thanks to a contribution from Apple
|
||||
\item Rolling Friction using a constraint, thanks to Erin Catto for the idea. See \path{Demos/RollingFrictionDemo/RollingFrictionDemo.cpp}
|
||||
\item XML serialization. See \path{Bullet/Demos/BulletXmlImportDemo} and \path{Bullet/Demos/SerializeDemo}
|
||||
\item Gear constraint. See \path{Bullet/Demos/ConstraintDemo}.
|
||||
\item Improved continuous collision response, feeding speculative contacts to the constraint solver. See \path{Bullet/Demos/CcdPhysicsDemo}
|
||||
\item Improved premake4 build system including support for Mac OSX, Linux and iOS
|
||||
\item Refactoring of collision detection pipeline using stack allocation instead of modifying the collision object. This will allow better future multithreading optimizations.
|
||||
\end{itemize}
|
||||
|
||||
68
thirdparty/bullet/docs/latex/titlepic.sty
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
% titlepic.sty is a LaTeX package to show a picture on the cover produced by \maketitle.
|
||||
% By Thomas ten Cate <ttencate@gmail.com>. Free software, no warranty of any kind.
|
||||
%
|
||||
% Version history:
|
||||
% 1.1: now more self-contained, comes with a PDF manual
|
||||
% 1.0: first release
|
||||
%
|
||||
% -----------------------------------------------------------------------------
|
||||
|
||||
% No idea whether it works on older LaTeXes.
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
|
||||
% Package identification and version number.
|
||||
\ProvidesPackage{titlepic}[2009/08/03 1.1 Package to display a picture on the title page]
|
||||
|
||||
% Declare the options.
|
||||
\DeclareOption{tt}{\gdef\@tptopspace{}\gdef\@tpsepspace{\vskip 3em}}
|
||||
\DeclareOption{tc}{\gdef\@tptopspace{}\gdef\@tpsepspace{\vfil}}
|
||||
\DeclareOption{cc}{\gdef\@tptopspace{\null\vfil}\gdef\@tpsepspace{\vskip 3em}}
|
||||
\ExecuteOptions{cc}
|
||||
\ProcessOptions
|
||||
|
||||
% Define the sole command introduced by this package.
|
||||
% Very similar to the definition of \title, etc.
|
||||
\def\titlepic#1{\gdef\@titlepic{#1}}
|
||||
\def\@titlepic{\@empty} % default: no picture
|
||||
|
||||
% If a title page was requested from the document class (article/report/book),
|
||||
% override \maketitle to show our picture.
|
||||
\if@titlepage
|
||||
\renewcommand\maketitle{
|
||||
\begin{titlepage}%
|
||||
\let\footnotesize\small
|
||||
\let\footnoterule\relax
|
||||
\let \footnote \thanks
|
||||
\@tptopspace%
|
||||
\begin{center}%
|
||||
{\LARGE \@title \par}%
|
||||
\vskip 3em%
|
||||
{\large
|
||||
\lineskip .75em%
|
||||
\begin{tabular}[t]{c}%
|
||||
\@author
|
||||
\end{tabular}\par%
|
||||
}%
|
||||
\vskip 1.5em%
|
||||
{\large \@date \par}% % Set date in \large size.
|
||||
\end{center}\par
|
||||
\@tpsepspace%
|
||||
{\centering\@titlepic\par}
|
||||
\vfil
|
||||
\@thanks
|
||||
\end{titlepage}%
|
||||
\setcounter{footnote}{0}%
|
||||
\global\let\thanks\relax
|
||||
\global\let\maketitle\relax
|
||||
\global\let\@thanks\@empty
|
||||
\global\let\@author\@empty
|
||||
\global\let\@date\@empty
|
||||
\global\let\@title\@empty
|
||||
\global\let\@titlepic\@empty
|
||||
\global\let\title\relax
|
||||
\global\let\author\relax
|
||||
\global\let\date\relax
|
||||
\global\let\and\relax
|
||||
\global\let\titlepic\relax
|
||||
}
|
||||
\fi
|
||||
BIN
thirdparty/bullet/docs/logo/bullet_logo_2010_9.emf
vendored
Normal file
1815
thirdparty/bullet/docs/logo/bullet_logo_2010_9.eps
vendored
Normal file
BIN
thirdparty/bullet/docs/logo/bullet_logo_2010_9.pdf
vendored
Normal file
BIN
thirdparty/bullet/docs/logo/bullet_logo_2010_9.png
vendored
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
1813
thirdparty/bullet/docs/logo/bullet_logo_2010_9.ps
vendored
Normal file
441
thirdparty/bullet/docs/logo/bullet_logo_2010_9.svg
vendored
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
thirdparty/bullet/docs/logo/bullet_logo_2010_9_1080p.png
vendored
Normal file
|
After Width: | Height: | Size: 48 KiB |
237
thirdparty/bullet/docs/logo/bullet_logo_2010_9_plain.svg
vendored
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
thirdparty/bullet/docs/logo/bullet_logo_original_2005.png
vendored
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
10
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/Article.md.html
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<meta charset="utf-8" lang="en">
|
||||
Hello Markdeep!
|
||||
|
||||
- Hello
|
||||
- lists!
|
||||
|
||||
Hello MathJax:
|
||||
\[f(0)=\frac{1}{2\cdot\pi\cdot i}\cdot \oint_{|z|=1} \frac{f(z)}{z} \textrm{d}z\]
|
||||
|
||||
<script src="MarkdeepUtility.js"></script>
|
||||
44
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/BuildMarkdeepUtility.py
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import re
|
||||
|
||||
if (__name__ == "__main__"):
|
||||
# Assemble the script which embeds the Markdeep page into the preview blog
|
||||
PreviewBlogPage = open("PreviewBlogPage.htm", "rb").read().decode("utf-8")
|
||||
HeadMatch = re.search("<head(.*?)>(.*?)</head>", PreviewBlogPage, re.DOTALL)
|
||||
HeadAttributes = HeadMatch.group(1)
|
||||
FullDocumentHead = HeadMatch.group(2)
|
||||
BodyMatch = re.search("<body(.*?)>(.*?)</body>", PreviewBlogPage, re.DOTALL)
|
||||
BodyAttributes = BodyMatch.group(1)
|
||||
FullPreviewBody = BodyMatch.group(2)
|
||||
ArticleHTMLCodeMacro = "$(ARTICLE_HTML_CODE)"
|
||||
iArticleHTMLCodeMacro = FullPreviewBody.find(ArticleHTMLCodeMacro)
|
||||
DocumentBodyPrefix = FullPreviewBody[0:iArticleHTMLCodeMacro]
|
||||
DocumentBodySuffix = FullPreviewBody[iArticleHTMLCodeMacro + len(ArticleHTMLCodeMacro):]
|
||||
FullPrepareHTMLCode = open("PrepareHTML.js", "rb").read().decode("utf-8")
|
||||
ReplacementList = [("$(FULL_DOCUMENT_HEAD)", FullDocumentHead),
|
||||
("$(DOCUMENT_BODY_PREFIX)", DocumentBodyPrefix),
|
||||
("$(DOCUMENT_BODY_SUFFIX)", DocumentBodySuffix)]
|
||||
for Macro, Replacement in ReplacementList:
|
||||
FullPrepareHTMLCode = FullPrepareHTMLCode.replace(
|
||||
Macro,
|
||||
Replacement.replace("\r\n", "\\r\\n\\\r\n").replace("'", "\\'"))
|
||||
# Generate code which sets body and head attributes appropriately
|
||||
for Element, AttributeCode in [("head", HeadAttributes), ("body", BodyAttributes)]:
|
||||
FullPrepareHTMLCode += "\r\n// Setting " + Element + " attributes\r\n"
|
||||
for Match in re.finditer("(\\w+)=\\\"(.*?)\\\"", AttributeCode):
|
||||
FullPrepareHTMLCode += "document." + Element + ".setAttribute(\"" + Match.group(
|
||||
1) + "\",\"" + Match.group(2) + "\");\r\n"
|
||||
open("PrepareHTML.full.js", "wb").write(FullPrepareHTMLCode.encode("utf-8"))
|
||||
|
||||
# Concatenate all the scripts together
|
||||
SourceFileList = [
|
||||
"PrepareHTML.full.js", "SetMarkdeepMode.js", "markdeep.min.js", "DisplayMarkdeepOutput.js",
|
||||
"InvokeMathJax.js"
|
||||
]
|
||||
OutputCode = "\r\n\r\n".join([
|
||||
"// " + SourceFile + "\r\n\r\n" + open(SourceFile, "rb").read().decode("utf-8")
|
||||
for SourceFile in SourceFileList
|
||||
])
|
||||
OutputFile = open("MarkdeepUtility.js", "wb")
|
||||
OutputFile.write(OutputCode.encode("utf-8"))
|
||||
OutputFile.close()
|
||||
print("Done.")
|
||||
6
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/DisplayMarkdeepOutput.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
BodyHTML=document.body.innerHTML;
|
||||
BeginTag="<!-- MARKDEEP_BEGIN -->";
|
||||
EndTag="<!-- MARKDEEP_END -->";
|
||||
BodyHTML=BodyHTML.slice(BodyHTML.indexOf(BeginTag)+BeginTag.length,BodyHTML.lastIndexOf(EndTag));
|
||||
document.getElementById("BodyDisplayBox").textContent=BodyHTML;
|
||||
document.head.innerHTML=FullDocumentHead;
|
||||
4
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/InvokeMathJax.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var MathjaxScript=document.createElement("script");
|
||||
MathjaxScript.type="text/javascript";
|
||||
MathjaxScript.src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
|
||||
document.head.appendChild(MathjaxScript);
|
||||
152
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/MarkdeepUtility.js
vendored
Normal file
117
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/PrepareHTML.full.js
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/** Converts <>&" to their HTML escape sequences */
|
||||
function escapeHTMLEntities(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
|
||||
/** Restores the original source string's '<' and '>' as entered in
|
||||
the document, before the browser processed it as HTML. There is no
|
||||
way in an HTML document to distinguish an entity that was entered
|
||||
as an entity.*/
|
||||
function unescapeHTMLEntities(str) {
|
||||
// Process & last so that we don't recursively unescape
|
||||
// escaped escape sequences.
|
||||
return str.
|
||||
replace(/</g, '<').
|
||||
replace(/>/g, '>').
|
||||
replace(/"/g, '"').
|
||||
replace(/'/g, "'").
|
||||
replace(/–/g, '--').
|
||||
replace(/—/g, '---').
|
||||
replace(/&/g, '&');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\param node A node from an HTML DOM
|
||||
|
||||
\return A String that is a very good reconstruction of what the
|
||||
original source looked like before the browser tried to correct
|
||||
it to legal HTML.
|
||||
*/
|
||||
function nodeToMarkdeepSource(node, leaveEscapes) {
|
||||
var source = node.innerHTML;
|
||||
|
||||
// Markdown uses <john@bar.com> e-mail syntax, which HTML parsing
|
||||
// will try to close by inserting the matching close tags at the end of the
|
||||
// document. Remove anything that looks like that and comes *after*
|
||||
// the first fallback style.
|
||||
source = source.replace(/(?:<style class="fallback">[\s\S]*?<\/style>[\s\S]*)<\/\S+@\S+\.\S+?>/gim, '');
|
||||
|
||||
// Remove artificially inserted close tags
|
||||
source = source.replace(/<\/h?ttps?:.*>/gi, '');
|
||||
|
||||
// Now try to fix the URLs themselves, which will be
|
||||
// transformed like this: <http: casual-effects.com="" markdeep="">
|
||||
source = source.replace(/<(https?): (.*?)>/gi, function (match, protocol, list) {
|
||||
|
||||
// Remove any quotes--they wouldn't have been legal in the URL anyway
|
||||
var s = '<' + protocol + '://' + list.replace(/=""\s/g, '/');
|
||||
|
||||
if (s.substring(s.length - 3) === '=""') {
|
||||
s = s.substring(0, s.length - 3);
|
||||
}
|
||||
|
||||
// Remove any lingering quotes (since they
|
||||
// wouldn't have been legal in the URL)
|
||||
s = s.replace(/"/g, '');
|
||||
|
||||
return s + '>';
|
||||
});
|
||||
|
||||
// Remove the "fallback" style tags
|
||||
source = source.replace(/<style class=["']fallback["']>.*?<\/style>/gmi, '');
|
||||
|
||||
source = unescapeHTMLEntities(source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
// $ (FULL_DOCUMENT_HEAD) is replaced by the contents of the <head> found in
|
||||
// PreviewBlogPage.htm. This document head will overwrite whatever Markdeep does to
|
||||
// the head at the very end.
|
||||
FullDocumentHead='\
|
||||
\r\n\
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">\r\n\
|
||||
<meta charset="UTF-8">\r\n\
|
||||
\r\n\
|
||||
<!-- Markdeep styles -->\r\n\
|
||||
<style>body{counter-reset: h1 h2 h3 h4 h5 h6}.md code,pre{font-family:Menlo,Consolas,monospace;font-size:15.018802542857143px;line-height:140%}.md div.title{font-size:26px;font-weight:800;line-height:120%;text-align:center}.md div.afterTitles{height:10px}.md div.subtitle{text-align:center}.md .image{display:inline-block}.md div.imagecaption,.md div.tablecaption,.md div.listingcaption{margin:0.2em 5px 10px 5px;text-align: justify;font-style:italic}.md div.imagecaption{margin-bottom:0}.md img{max-width:100%;page-break-inside:avoid}li{text-align:left};.md div.tilde{margin:20px 0 -10px;text-align:center}.md blockquote.fancyquote{margin:25px 0 25px;text-align:left;line-height:160%}.md blockquote.fancyquote::before{content:"“";color:#DDD;font-family:Times New Roman;font-size:45px;line-height:0;margin-right:6px;vertical-align:-0.3em}.md span.fancyquote{font-size:118%;color:#777;font-style:italic}.md span.fancyquote::after{content:"”";font-style:normal;color:#DDD;font-family:Times New Roman;font-size:45px;line-height:0;margin-left:6px;vertical-align:-0.3em}.md blockquote.fancyquote .author{width:100%;margin-top:10px;display:inline-block;text-align:right}.md small{font-size:60%}.md div.title,contents,.md .tocHeader,h1,h2,h3,h4,h5,h6,.md .shortTOC,.md .mediumTOC,.nonumberh1,.nonumberh2,.nonumberh3,.nonumberh4,.nonumberh5,.nonumberh6{font-family:Verdana,Helvetica,Arial,sans-serif;margin:13.4px 0 13.4px;padding:15px 0 3px;border-top:none;clear:both}.md svg.diagram{display:block;font-family:Menlo,Consolas,monospace;font-size:15.018802542857143px;text-align:center;stroke-linecap:round;stroke-width:2px;page-break-inside:avoid;stroke:#000;fill:#000}.md svg.diagram .opendot{fill:#FFF}.md svg.diagram text{stroke:none}.md h1,.tocHeader,.nonumberh1{border-bottom:3px solid;font-size:20px;font-weight:bold;}h1,.nonumberh1{counter-reset: h2 h3 h4 h5 h6}h2,.nonumberh2{counter-reset: h3 h4 h5 h6;border-bottom:2px solid #999;color:#555;font-size:18px;}h3,h4,h5,h6,.nonumberh3,.nonumberh4,.nonumberh5,.nonumberh6{font-family:Helvetica,Arial,sans-serif;color:#555;font-size:16px;}h3{counter-reset:h4 h5 h6}h4{counter-reset:h5 h6}h5{counter-reset:h6}.md table{border-collapse:collapse;line-height:140%;page-break-inside:avoid}.md table.table{margin:auto}.md table.calendar{width:100%;margin:auto;font-size:11px;font-family:Helvetica,Arial,sans-serif}.md table.calendar th{font-size:16px}.md .today{background:#ECF8FA}.md .calendar .parenthesized{color:#999;font-style:italic}.md div.tablecaption{text-align:center}.md table.table th{color:#FFF;background-color:#AAA;border:1px solid #888;padding:8px 15px 8px 15px}.md table.table td{padding:5px 15px 5px 15px;border:1px solid #888}.md table.table tr:nth-child(even){background:#EEE}.md pre.tilde{border-top: 1px solid #CCC;border-bottom: 1px solid #CCC;padding: 5px 0 5px 20px;margin:0 0 30px 0;background:#FCFCFC;page-break-inside:avoid}.md a:link, .md a:visited{color:#38A;text-decoration:none}.md a:link:hover{text-decoration:underline}.md dt{font-weight:700}dl>.md dd{padding:0 0 18px}.md dl>table{margin:35px 0 30px}.md code{white-space:pre;page-break-inside:avoid}.md .endnote{font-size:13px;line-height:15px;padding-left:10px;text-indent:-10px}.md .bib{padding-left:80px;text-indent:-80px;text-align:left}.markdeepFooter{font-size:9px;text-align:right;padding-top:80px;color:#999}.md .mediumTOC{float:right;font-size:12px;line-height:15px;border-left:1px solid #CCC;padding-left:15px;margin:15px 0px 15px 25px}.md .mediumTOC .level1{font-weight:600}.md .longTOC .level1{font-weight:600;display:block;padding-top:12px;margin:0 0 -20px}.md .shortTOC{text-align:center;font-weight:bold;margin-top:15px;font-size:14px}</style>\r\n\
|
||||
\r\n\
|
||||
<!-- hljs styles -->\r\n\
|
||||
<style>.hljs{display:block;overflow-x:auto;padding:0.5em;background:#fff;color:#000;-webkit-text-size-adjust:none}.hljs-comment{color:#006a00}.hljs-keyword{color:#02E}.hljs-literal,.nginx .hljs-title{color:#aa0d91}.method,.hljs-list .hljs-title,.hljs-tag .hljs-title,.setting .hljs-value,.hljs-winutils,.tex .hljs-command,.http .hljs-title,.hljs-request,.hljs-status,.hljs-name{color:#008}.hljs-envvar,.tex .hljs-special{color:#660}.hljs-string{color:#c41a16}.hljs-tag .hljs-value,.hljs-cdata,.hljs-filter .hljs-argument,.hljs-attr_selector,.apache .hljs-cbracket,.hljs-date,.hljs-regexp{color:#080}.hljs-sub .hljs-identifier,.hljs-pi,.hljs-tag,.hljs-tag .hljs-keyword,.hljs-decorator,.ini .hljs-title,.hljs-shebang,.hljs-prompt,.hljs-hexcolor,.hljs-rule .hljs-value,.hljs-symbol,.hljs-symbol .hljs-string,.hljs-number,.css .hljs-function,.hljs-function .hljs-title,.coffeescript .hljs-attribute{color:#A0C}.hljs-function .hljs-title{font-weight:bold;color:#000}.hljs-class .hljs-title,.smalltalk .hljs-class,.hljs-type,.hljs-typename,.hljs-tag .hljs-attribute,.hljs-doctype,.hljs-class .hljs-id,.hljs-built_in,.setting,.hljs-params,.clojure .hljs-attribute{color:#5c2699}.hljs-variable{color:#3f6e74}.css .hljs-tag,.hljs-rule .hljs-property,.hljs-pseudo,.hljs-subst{color:#000}.css .hljs-class,.css .hljs-id{color:#9b703f}.hljs-value .hljs-important{color:#ff7700;font-weight:bold}.hljs-rule .hljs-keyword{color:#c5af75}.hljs-annotation,.apache .hljs-sqbracket,.nginx .hljs-built_in{color:#9b859d}.hljs-preprocessor,.hljs-preprocessor *,.hljs-pragma{color:#643820}.tex .hljs-formula{background-color:#eee;font-style:italic}.diff .hljs-header,.hljs-chunk{color:#808080;font-weight:bold}.diff .hljs-change{background-color:#bccff9}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-comment .hljs-doctag{font-weight:bold}.method .hljs-id{color:#000}</style>\r\n\
|
||||
\
|
||||
';
|
||||
|
||||
// This code is placed at the beginning of the body before the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_PREFIX) is everything in the body of PreviewBlogPage.htm up to
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodyPrefix='\
|
||||
\r\n\
|
||||
\
|
||||
<!-- MARKDEEP_BEGIN -->\
|
||||
<pre class="markdeep">\
|
||||
';
|
||||
// This code is placed at the end of the body after the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_SUFFIX) is everything in the body of PreviewBlogPage.htm after
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodySuffix='\
|
||||
</pre>\
|
||||
<!-- MARKDEEP_END -->\
|
||||
<div>Document <body> code:<br/>\
|
||||
<textarea cols="40" rows="10" id="BodyDisplayBox"></textarea></div>\
|
||||
\r\n\
|
||||
\
|
||||
';
|
||||
|
||||
// Get the full Markdeep code from the .md.html file without the script invocation
|
||||
MarkdeepCode=nodeToMarkdeepSource(document.body);
|
||||
MarkdeepCode=MarkdeepCode.slice(0,MarkdeepCode.lastIndexOf("<script"));
|
||||
// Bring it into a form where it can be pasted into an HTML document
|
||||
SanitizedMarkdeepCode=escapeHTMLEntities(MarkdeepCode);
|
||||
// Surround it by the prefix and suffix code and set that as body code
|
||||
document.body.innerHTML=DocumentBodyPrefix+SanitizedMarkdeepCode+DocumentBodySuffix;
|
||||
|
||||
// Setting head attributes
|
||||
|
||||
// Setting body attributes
|
||||
102
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/PrepareHTML.js
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
/** Converts <>&" to their HTML escape sequences */
|
||||
function escapeHTMLEntities(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
|
||||
/** Restores the original source string's '<' and '>' as entered in
|
||||
the document, before the browser processed it as HTML. There is no
|
||||
way in an HTML document to distinguish an entity that was entered
|
||||
as an entity.*/
|
||||
function unescapeHTMLEntities(str) {
|
||||
// Process & last so that we don't recursively unescape
|
||||
// escaped escape sequences.
|
||||
return str.
|
||||
replace(/</g, '<').
|
||||
replace(/>/g, '>').
|
||||
replace(/"/g, '"').
|
||||
replace(/'/g, "'").
|
||||
replace(/–/g, '--').
|
||||
replace(/—/g, '---').
|
||||
replace(/&/g, '&');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\param node A node from an HTML DOM
|
||||
|
||||
\return A String that is a very good reconstruction of what the
|
||||
original source looked like before the browser tried to correct
|
||||
it to legal HTML.
|
||||
*/
|
||||
function nodeToMarkdeepSource(node, leaveEscapes) {
|
||||
var source = node.innerHTML;
|
||||
|
||||
// Markdown uses <john@bar.com> e-mail syntax, which HTML parsing
|
||||
// will try to close by inserting the matching close tags at the end of the
|
||||
// document. Remove anything that looks like that and comes *after*
|
||||
// the first fallback style.
|
||||
source = source.replace(/(?:<style class="fallback">[\s\S]*?<\/style>[\s\S]*)<\/\S+@\S+\.\S+?>/gim, '');
|
||||
|
||||
// Remove artificially inserted close tags
|
||||
source = source.replace(/<\/h?ttps?:.*>/gi, '');
|
||||
|
||||
// Now try to fix the URLs themselves, which will be
|
||||
// transformed like this: <http: casual-effects.com="" markdeep="">
|
||||
source = source.replace(/<(https?): (.*?)>/gi, function (match, protocol, list) {
|
||||
|
||||
// Remove any quotes--they wouldn't have been legal in the URL anyway
|
||||
var s = '<' + protocol + '://' + list.replace(/=""\s/g, '/');
|
||||
|
||||
if (s.substring(s.length - 3) === '=""') {
|
||||
s = s.substring(0, s.length - 3);
|
||||
}
|
||||
|
||||
// Remove any lingering quotes (since they
|
||||
// wouldn't have been legal in the URL)
|
||||
s = s.replace(/"/g, '');
|
||||
|
||||
return s + '>';
|
||||
});
|
||||
|
||||
// Remove the "fallback" style tags
|
||||
source = source.replace(/<style class=["']fallback["']>.*?<\/style>/gmi, '');
|
||||
|
||||
source = unescapeHTMLEntities(source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
// $ (FULL_DOCUMENT_HEAD) is replaced by the contents of the <head> found in
|
||||
// PreviewBlogPage.htm. This document head will overwrite whatever Markdeep does to
|
||||
// the head at the very end.
|
||||
FullDocumentHead='\
|
||||
$(FULL_DOCUMENT_HEAD)\
|
||||
';
|
||||
|
||||
// This code is placed at the beginning of the body before the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_PREFIX) is everything in the body of PreviewBlogPage.htm up to
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodyPrefix='\
|
||||
$(DOCUMENT_BODY_PREFIX)\
|
||||
<!-- MARKDEEP_BEGIN -->\
|
||||
<pre class="markdeep">\
|
||||
';
|
||||
// This code is placed at the end of the body after the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_SUFFIX) is everything in the body of PreviewBlogPage.htm after
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodySuffix='\
|
||||
</pre>\
|
||||
<!-- MARKDEEP_END -->\
|
||||
<div>Document <body> code:<br/>\
|
||||
<textarea cols="40" rows="10" id="BodyDisplayBox"></textarea></div>\
|
||||
$(DOCUMENT_BODY_SUFFIX)\
|
||||
';
|
||||
|
||||
// Get the full Markdeep code from the .md.html file without the script invocation
|
||||
MarkdeepCode=nodeToMarkdeepSource(document.body);
|
||||
MarkdeepCode=MarkdeepCode.slice(0,MarkdeepCode.lastIndexOf("<script"));
|
||||
// Bring it into a form where it can be pasted into an HTML document
|
||||
SanitizedMarkdeepCode=escapeHTMLEntities(MarkdeepCode);
|
||||
// Surround it by the prefix and suffix code and set that as body code
|
||||
document.body.innerHTML=DocumentBodyPrefix+SanitizedMarkdeepCode+DocumentBodySuffix;
|
||||
17
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/PreviewBlogPage.htm
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<!-- Markdeep styles -->
|
||||
<style>body{counter-reset: h1 h2 h3 h4 h5 h6}.md code,pre{font-family:Menlo,Consolas,monospace;font-size:15.018802542857143px;line-height:140%}.md div.title{font-size:26px;font-weight:800;line-height:120%;text-align:center}.md div.afterTitles{height:10px}.md div.subtitle{text-align:center}.md .image{display:inline-block}.md div.imagecaption,.md div.tablecaption,.md div.listingcaption{margin:0.2em 5px 10px 5px;text-align: justify;font-style:italic}.md div.imagecaption{margin-bottom:0}.md img{max-width:100%;page-break-inside:avoid}li{text-align:left};.md div.tilde{margin:20px 0 -10px;text-align:center}.md blockquote.fancyquote{margin:25px 0 25px;text-align:left;line-height:160%}.md blockquote.fancyquote::before{content:"“";color:#DDD;font-family:Times New Roman;font-size:45px;line-height:0;margin-right:6px;vertical-align:-0.3em}.md span.fancyquote{font-size:118%;color:#777;font-style:italic}.md span.fancyquote::after{content:"”";font-style:normal;color:#DDD;font-family:Times New Roman;font-size:45px;line-height:0;margin-left:6px;vertical-align:-0.3em}.md blockquote.fancyquote .author{width:100%;margin-top:10px;display:inline-block;text-align:right}.md small{font-size:60%}.md div.title,contents,.md .tocHeader,h1,h2,h3,h4,h5,h6,.md .shortTOC,.md .mediumTOC,.nonumberh1,.nonumberh2,.nonumberh3,.nonumberh4,.nonumberh5,.nonumberh6{font-family:Verdana,Helvetica,Arial,sans-serif;margin:13.4px 0 13.4px;padding:15px 0 3px;border-top:none;clear:both}.md svg.diagram{display:block;font-family:Menlo,Consolas,monospace;font-size:15.018802542857143px;text-align:center;stroke-linecap:round;stroke-width:2px;page-break-inside:avoid;stroke:#000;fill:#000}.md svg.diagram .opendot{fill:#FFF}.md svg.diagram text{stroke:none}.md h1,.tocHeader,.nonumberh1{border-bottom:3px solid;font-size:20px;font-weight:bold;}h1,.nonumberh1{counter-reset: h2 h3 h4 h5 h6}h2,.nonumberh2{counter-reset: h3 h4 h5 h6;border-bottom:2px solid #999;color:#555;font-size:18px;}h3,h4,h5,h6,.nonumberh3,.nonumberh4,.nonumberh5,.nonumberh6{font-family:Helvetica,Arial,sans-serif;color:#555;font-size:16px;}h3{counter-reset:h4 h5 h6}h4{counter-reset:h5 h6}h5{counter-reset:h6}.md table{border-collapse:collapse;line-height:140%;page-break-inside:avoid}.md table.table{margin:auto}.md table.calendar{width:100%;margin:auto;font-size:11px;font-family:Helvetica,Arial,sans-serif}.md table.calendar th{font-size:16px}.md .today{background:#ECF8FA}.md .calendar .parenthesized{color:#999;font-style:italic}.md div.tablecaption{text-align:center}.md table.table th{color:#FFF;background-color:#AAA;border:1px solid #888;padding:8px 15px 8px 15px}.md table.table td{padding:5px 15px 5px 15px;border:1px solid #888}.md table.table tr:nth-child(even){background:#EEE}.md pre.tilde{border-top: 1px solid #CCC;border-bottom: 1px solid #CCC;padding: 5px 0 5px 20px;margin:0 0 30px 0;background:#FCFCFC;page-break-inside:avoid}.md a:link, .md a:visited{color:#38A;text-decoration:none}.md a:link:hover{text-decoration:underline}.md dt{font-weight:700}dl>.md dd{padding:0 0 18px}.md dl>table{margin:35px 0 30px}.md code{white-space:pre;page-break-inside:avoid}.md .endnote{font-size:13px;line-height:15px;padding-left:10px;text-indent:-10px}.md .bib{padding-left:80px;text-indent:-80px;text-align:left}.markdeepFooter{font-size:9px;text-align:right;padding-top:80px;color:#999}.md .mediumTOC{float:right;font-size:12px;line-height:15px;border-left:1px solid #CCC;padding-left:15px;margin:15px 0px 15px 25px}.md .mediumTOC .level1{font-weight:600}.md .longTOC .level1{font-weight:600;display:block;padding-top:12px;margin:0 0 -20px}.md .shortTOC{text-align:center;font-weight:bold;margin-top:15px;font-size:14px}</style>
|
||||
|
||||
<!-- hljs styles -->
|
||||
<style>.hljs{display:block;overflow-x:auto;padding:0.5em;background:#fff;color:#000;-webkit-text-size-adjust:none}.hljs-comment{color:#006a00}.hljs-keyword{color:#02E}.hljs-literal,.nginx .hljs-title{color:#aa0d91}.method,.hljs-list .hljs-title,.hljs-tag .hljs-title,.setting .hljs-value,.hljs-winutils,.tex .hljs-command,.http .hljs-title,.hljs-request,.hljs-status,.hljs-name{color:#008}.hljs-envvar,.tex .hljs-special{color:#660}.hljs-string{color:#c41a16}.hljs-tag .hljs-value,.hljs-cdata,.hljs-filter .hljs-argument,.hljs-attr_selector,.apache .hljs-cbracket,.hljs-date,.hljs-regexp{color:#080}.hljs-sub .hljs-identifier,.hljs-pi,.hljs-tag,.hljs-tag .hljs-keyword,.hljs-decorator,.ini .hljs-title,.hljs-shebang,.hljs-prompt,.hljs-hexcolor,.hljs-rule .hljs-value,.hljs-symbol,.hljs-symbol .hljs-string,.hljs-number,.css .hljs-function,.hljs-function .hljs-title,.coffeescript .hljs-attribute{color:#A0C}.hljs-function .hljs-title{font-weight:bold;color:#000}.hljs-class .hljs-title,.smalltalk .hljs-class,.hljs-type,.hljs-typename,.hljs-tag .hljs-attribute,.hljs-doctype,.hljs-class .hljs-id,.hljs-built_in,.setting,.hljs-params,.clojure .hljs-attribute{color:#5c2699}.hljs-variable{color:#3f6e74}.css .hljs-tag,.hljs-rule .hljs-property,.hljs-pseudo,.hljs-subst{color:#000}.css .hljs-class,.css .hljs-id{color:#9b703f}.hljs-value .hljs-important{color:#ff7700;font-weight:bold}.hljs-rule .hljs-keyword{color:#c5af75}.hljs-annotation,.apache .hljs-sqbracket,.nginx .hljs-built_in{color:#9b859d}.hljs-preprocessor,.hljs-preprocessor *,.hljs-pragma{color:#643820}.tex .hljs-formula{background-color:#eee;font-style:italic}.diff .hljs-header,.hljs-chunk{color:#808080;font-weight:bold}.diff .hljs-change{background-color:#bccff9}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-comment .hljs-doctag{font-weight:bold}.method .hljs-id{color:#000}</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
$(ARTICLE_HTML_CODE)
|
||||
</body>
|
||||
</html>
|
||||
1
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/SetMarkdeepMode.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
window.markdeepOptions={mode:"html"};
|
||||
29
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/ShowHeadAdditions.html
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<body>
|
||||
<script>window.markdeepOptions={mode:"script"};</script>
|
||||
<script src="./markdeep.min.js"></script>
|
||||
<div>Document <head> additions:<br/>
|
||||
<textarea cols="80" rows="40" id="HeadDisplayBox"></textarea></div>
|
||||
<script>
|
||||
// Get the complete Markdeep and hljs stylesheet
|
||||
FullStylesheet=window.markdeep.stylesheet();
|
||||
// It should consist of three <style> tags which we pick apart
|
||||
StyleTagList=FullStylesheet.split("<style>");
|
||||
// The second one defines section number, which we do not want, so we
|
||||
// just drop it. The other two are Markdeep and hljs styles.
|
||||
MarkdeepStylesheet="<style>"+StyleTagList[1];
|
||||
HLJSStylesheet="<style>"+StyleTagList[3];
|
||||
// Now lets show the user what we found
|
||||
document.getElementById("HeadDisplayBox").textContent=
|
||||
"<!-- Markdeep styles -->\r\n"
|
||||
+MarkdeepStylesheet
|
||||
+"\r\n\r\n<!-- hljs styles -->\r\n"
|
||||
+HLJSStylesheet
|
||||
+"\r\n\r\n<!-- MathJax invocation -->\r\n<script type=\"text/javascript\" async=\"\" src=\"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">\r\n";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
6
thirdparty/bullet/docs/pybullet_quickstart_guide/PlainPreview/markdeep.min.js
vendored
Normal file
466
thirdparty/bullet/docs/pybullet_quickstart_guide/PyBulletQuickstartGuide.md.html
vendored
Normal file
@@ -0,0 +1,466 @@
|
||||
<meta charset="utf-8"><!-- -*- markdown -*- -->
|
||||
|
||||
|
||||
**PyBullet Quickstart Guide**
|
||||
[Erwin Coumans](http://twitter.com/erwincoumans), [Google Brain Robotics](https://research.google.com/teams/brain/robotics), <erwincoumans@google.com>
|
||||
[Yunfei Bai](http://yunfei-bai.com), [X](https://x.company), <yunfeibai@x.team>
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
======================================================================================
|
||||
|
||||
pybullet is an easy to use Python module for physics simulation for robotics, games, visual effects and machine learning. With pybullet you can load articulated bodies from URDF, SDF, MJCF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics, collision detection and ray intersection queries. The Bullet Physics SDK includes pybullet robotic examples such as a simulated Minitaur quadruped, humanoids running using TensorFlow inference and KUKA arms grasping objects.
|
||||
|
||||

|
||||
</small>](images/CoRL_VR_demo.png width="80%" border="2")
|
||||
|
||||
Aside from physics simulation, there are bindings to rendering, with a CPU renderer (TinyRenderer) and OpenGL visualization and support for Virtual Reality headsets such as HTC Vive and Oculus Rift. pybullet also has functionality to perform collision detection queries (closest points, overlapping pairs, ray intersection test etc) and to add debug rendering (debug lines and text). pybullet has cross-platform built-in client-server support for shared memory, UDP and TCP networking. So you can run pybullet on Linux connecting to a Windows VR server.
|
||||
|
||||
pybullet wraps the new Bullet C-API, which is designed to be independent from the underlying physics engine and render engine, so we can easily migrate to newer versions of Bullet, or use a different physics engine or render engine. By default, pybullet uses the Bullet 2.x API on the CPU. We will expose Bullet 3.x running on GPU using OpenCL as well. There is also a C++ API similar to pybullet, see b3RobotSimulatorClientAPI.
|
||||
|
||||
pybullet can be easily used with TensorFlow and frameworks such as OpenAI Gym. Researchers from Google Brain [1,2], X, Stanford AI Lab and OpenAI use pybullet/Bullet C-API.
|
||||
|
||||
The installation of pybullet is as simple as (sudo) pip install pybullet (Python 2.x), pip3 install pybullet. This will expose the pybullet module as well as pybullet_envs Gym environments.
|
||||
|
||||
Hello pybullet World
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ python
|
||||
import pybullet as p
|
||||
import pybullet_data
|
||||
physicsClient = p.connect(p.GUI)#or p.DIRECT for non-graphical version
|
||||
p.setAdditionalSearchPath(pybullet_data.getDataPath()) #used by loadURDF
|
||||
p.setGravity(0,0,-10)
|
||||
planeId = p.loadURDF("plane.urdf")
|
||||
cubeStartPos = [0,0,1]
|
||||
cubeStartOrientation = p.getQuaternionFromEuler([0,0,0])
|
||||
boxId = p.loadURDF("r2d2.urdf",cubeStartPos, cubeStartOrientation)
|
||||
p.stepSimulation()
|
||||
cubePos, cubeOrn = p.getBasePositionAndOrientation(boxId)
|
||||
print(cubePos,cubeOrn)
|
||||
p.disconnect()
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
connect, disconnect
|
||||
--------------------------------------------------------------------------------------------
|
||||
After importing the pybullet module, the first thing to do is 'connecting' to the physics simulation. pybullet is designed around a client-server driven API, with a client sending commands and a physics server returning the status. pybullet has some built-in physics servers: DIRECT and GUI. Both GUI and DIRECT connections will execute the physics simulation and rendering in the same process as pybullet.
|
||||
|
||||
Note that in DIRECT mode you cannot access the OpenGL and VR hardware features, as described in the "Virtual Reality" and "Debug GUI, Lines, Text, Parameters" chapters. DIRECT mode does allow rendering of images using the built-in software renderer through the 'getCameraImage' API. This can be useful for running simulations in the cloud on servers without GPU.
|
||||
|
||||
You can provide your own data files, or you can use the pybullet_data package that ships with pybullet. For this, import pybullet_data and register the directory using pybullet.setAdditionalSearchPath(pybullet_data.getDataPath()).
|
||||
|
||||
getConnectionInfo
|
||||
--------------------------------------------------------------------------------------------
|
||||
Given a physicsClientId will return the list [isConnected, connectionMethod]
|
||||
|
||||
connect using DIRECT, GUI
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
The DIRECT connection sends the commands directly to the physics engine, without using any transport layer and no graphics visualization window, and directly returns the status after executing the command.
|
||||
|
||||
The GUI connection will create a new graphical user interface (GUI) with 3D OpenGL rendering, within the same process space as pybullet. On Linux and Windows this GUI runs in a separate thread, while on OSX it runs in the same thread due to operating system limitations. On Mac OSX you may see a spinning wheel in the OpenGL Window, until you run a 'stepSimulation' or other pybullet command.
|
||||
The commands and status messages are sent between pybullet client and the GUI physics simulation server using an ordinary memory buffer.
|
||||
|
||||
It is also possible to connect to a physics server in a different process on the same machine or on a remote machine using SHARED_MEMORY, UDP or TCP networking. See the section about Shared Memory, UDP and TCP for details.
|
||||
|
||||
Unlike almost all other methods, this method doesn't parse keyword arguments, due to backward compatibility.
|
||||
|
||||
The connect input arguments are:
|
||||
|
||||
|
||||
| field | name | type | description |
|
||||
|----------|---------------------------------|-----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| required | connection mode | integer: DIRECT, GUI, SHARED_MEMORY, UDP, TCP | DIRECT mode create a new physics engine and directly communicates with it. GUI will create a physics engine with graphical GUI frontend and communicates with it. SHARED_MEMORY will connect to an existing physics engine process on the same machine, and communicates with it over shared memory. TCP or UDP will connect to an existing physics server over TCP or UDP networking. |
|
||||
| optional | key | int | in SHARED_MEMORY mode, optional shared memory key. When starting ExampleBrowser or SharedMemoryPhysics_* you can use optional command-line --shared_memory_key to set the key. This allows to run multiple servers on the same machine. |
|
||||
| optional | UdpNetworkAddress (UDP and TCP) | string | IP address or host name, for example "127.0.0.1" or "localhost" or "mymachine.domain.com" |
|
||||
| optional | UdpNetworkPort (UDP and TCP) | integer | UDP port number. Default UDP port is 1234, default TCP port is 6667 (matching the defaults in the server) |
|
||||
| optional | options | string | command-line option passed into the GUI server. At the moment, only the --opengl2 flag is enabled: by default, Bullet uses OpenGL3, but some environments such as virtual machines or remote desktop clients only support OpenGL2. Only one command-line argument can be passed on at the moment. |
|
||||
|
||||
connect returns a physics client id or -1 if not connected. The physics client Id is an optional argument to most of the other pybullet commands. If you don't provide it, it will assume physics client id = 0. You can connect to multiple different physics servers, except for GUI.
|
||||
|
||||
For example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ python
|
||||
pybullet.connect(pybullet.DIRECT)
|
||||
pybullet.connect(pybullet.GUI, options="--opengl2")
|
||||
pybullet.connect(pybullet.SHARED_MEMORY,1234)
|
||||
pybullet.connect(pybullet.UDP,"192.168.0.1")
|
||||
pybullet.connect(pybullet.UDP,"localhost", 1234)
|
||||
pybullet.connect(pybullet.TCP,"localhost", 6667)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
connect using Shared Memory
|
||||
--------------------------------------------------------------------------------------------
|
||||
There are a few physics servers that allow shared memory connection: the App_SharedMemoryPhysics, App_SharedMemoryPhysics_GUI and the Bullet Example Browser has one example under Experimental/Physics Server that allows shared memory connection. This will let you execute the physics simulation and rendering in a separate process.
|
||||
|
||||
You can also connect over shared memory to the App_SharedMemoryPhysics_VR, the Virtual Reality application with support for head-mounted display and 6-dof tracked controllers such as HTC Vive and Oculus Rift with Touch controllers. Since the Valve OpenVR SDK only works properly under Windows, the App_SharedMemoryPhysics_VR can only be build under Windows using premake (preferably) or cmake.
|
||||
|
||||
connect using UDP or TCP networking
|
||||
--------------------------------------------------------------------------------------------
|
||||
For UDP networking, there is a App_PhysicsServerUDP that listens to a certain UDP port. It uses the open source enet library for reliable UDP networking. This allows you to execute the physics simulation and rendering on a separate machine. For TCP pybullet uses the clsocket library. This can be useful when using SSH tunneling from a machine behind a firewall to a robot simulation. For example you can run a control stack or machine learning using pybullet on Linux, while running the physics server on Windows in Virtual Reality using HTC Vive or Rift.
|
||||
|
||||
One more UDP application is the App_PhysicsServerSharedMemoryBridgeUDP application that acts as a bridge to an existing physics server: you can connect over UDP to this bridge, and the bridge connects to a physics server using shared memory: the bridge passes messages between client and server. In a similar way there is a TCP version (replace UDP by TCP).
|
||||
|
||||
Note: at the moment, both client and server need to be either 32bit or 64bit builds!
|
||||
|
||||
disconnect
|
||||
--------------------------------------------------------------------------------------------
|
||||
You can disconnect from a physics server, using the physics client Id returned by the connect call (if non-negative). A 'DIRECT' or 'GUI' physics server will shutdown. A separate (out-of-process) physics server will keep on running. See also 'resetSimulation' to remove all items.
|
||||
|
||||
Parameters of disconnect:
|
||||
|
||||
| field | name | type | description |
|
||||
|----------|-----------------|------|---------------------------------------------------------------------|
|
||||
| optional | physicsClientId | int | if you connect to multiple physics servers, you can pick which one. |
|
||||
|
||||
setGravity
|
||||
--------------------------------------------------------------------------------------------
|
||||
By default, there is no gravitational force enabled. setGravity lets you set the default gravity force for all objects.
|
||||
The setGravity input parameters are: (no return value)
|
||||
|
||||
| field | name | type | description |
|
||||
|----------|-----------------|-------|---------------------------------------------------------------------|
|
||||
| required | gravityX | float | gravity force along the X world axis |
|
||||
| required | gravityY | float | gravity force along the Y world axis |
|
||||
| required | gravityZ | float | gravity force along the Z world axis |
|
||||
| required | physicsClientId | int | if you connect to multiple physics servers, you can pick which one. |
|
||||
|
||||
|
||||
loadURDF
|
||||
--------------------------------------------------------------------------------------------
|
||||
The loadURDF will send a command to the physics server to load a physics model from a Universal Robot Description File (URDF). The URDF file is used by the ROS project (Robot Operating System) to describe robots and other objects, it was created by the WillowGarage and the Open Source Robotics Foundation (OSRF). Many robots have public URDF files, you can find a description and tutorial here: http://wiki.ros.org/urdf/Tutorials
|
||||
|
||||
Important note: most joints (slider, revolute, continuous) have motors enabled by default that prevent free motion. This is similar to a robot joint with a very high-friction harmonic drive. You should set the joint motor control mode and target settings using pybullet.setJointMotorControl2. See the setJointMotorControl2 API for more information.
|
||||
|
||||
Warning: by default, pybullet will cache some files to speed up loading. You can disable file caching using setPhysicsEngineParameter(enableFileCaching=0).
|
||||
|
||||
The loadURDF arguments are:
|
||||
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| required | fileName | string | a relative or absolute path to the URDF file on the file system of the physics server. |
|
||||
| optional | basePosition | vec3 | create the base of the object at the specified position in world space coordinates [X,Y,Z] |
|
||||
| optional | baseOrientation | vec4 | create the base of the object at the specified orientation as world space quaternion [X,Y,Z,W] |
|
||||
| optional | useMaximalCoordinates | int | Experimental. By default, the joints in the URDF file are created using the reduced coordinate method: the joints are simulated using the Featherstone Articulated Body algorithm (btMultiBody in Bullet 2.x). The useMaximalCoordinates option will create a 6 degree of freedom rigid body for each link, and constraints between those rigid bodies are used to model joints. |
|
||||
| optional | useFixedBase | int | force the base of the loaded object to be static |
|
||||
| optional | flags | int | URDF_USE_INERTIA_FROM_FILE: by default, Bullet recomputed the inertia tensor based on mass and volume of the collision shape. If you can provide more accurate inertia tensor, use this flag.URDF_USE_SELF_COLLISION: by default, Bullet disables self-collision. This flag let's you enable it. You can customize the self-collision behavior using the following flags: URDF_USE_SELF_COLLISION_EXCLUDE_PARENT will discard self-collision between links that are directly connected (parent and child).URDF_USE_SELF_COLLISION_EXCLUDE_ALL_PARENTS will discard self-collisions between a child link and any of its ancestors (parents, parents of parents, up to the base). |
|
||||
| optional | globalScaling | float | globalScaling will apply a scale factor to the URDF model. |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
loadURDF returns a body unique id, a non-negative integer value. If the URDF file cannot be loaded, this integer will be negative and not a valid body unique id.
|
||||
|
||||
loadBullet, loadSDF, loadMJCF
|
||||
--------------------------------------------------------------------------------------------
|
||||
You can also load objects from other file formats, such as .bullet, .sdf and .mjcf. Those file formats support multiple objects, so the return value is a list of object unique ids. The SDF format is explained in detail at http://sdformat.org. The loadSDF command only extracts some essential parts of the SDF related to the robot models and geometry, and ignores many elements related to cameras, lights and so on. The loadMJCF command performs basic import of MuJoCo MJCF xml files, used in OpenAI Gym. See also the Important note under loadURDF related to default joint motor settings, and make sure to use setJointMotorControl2.
|
||||
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------------|--------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
| required | fileName | string | a relative or absolute path to the URDF file on the file system of the physics server. |
|
||||
| optional | useMaximalCoordinates | int | Experimental. See loadURDF for more details. |
|
||||
| optional | globalScaling | float | every object will be scaled using this scale factor (including links, link frames, joint attachments and linear joint limits) |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
loadBullet, loadSDF and loadMJCF will return an array of object unique ids:
|
||||
|
||||
| name | type | description |
|
||||
|-----------------|-------------|----------------------------------------------------------------|
|
||||
| objectUniqueIds | list of int | the list includes the object unique id for each object loaded. |
|
||||
|
||||
|
||||
createCollisionShape/VisualShape
|
||||
--------------------------------------------------------------------------------------------
|
||||
Although the recommended and easiest way to create stuff in the world is using the loading functions (loadURDF/SDF/MJCF/Bullet), you can also create collision and visual shapes programmatically and use them to create a multi body using createMultiBody. See the createMultiBodyLinks.py and createVisualShape.py example in the Bullet Physics SDK.
|
||||
|
||||
The input parameters for createCollisionShape are
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| required | shapeType | int | GEOM_SPHERE, GEOM_BOX, GEOM_CAPSULE, GEOM_CYLINDER, GEOM_PLANE, GEOM_MESH |
|
||||
| optional | radius | float | default 0.5: GEOM_SPHERE, GEOM_CAPSULE, GEOM_CYLINDER |
|
||||
| optional | halfExtents | vec3 list of 3 floats | default [1,1,1]: for GEOM_BOX |
|
||||
| optional | height | float | default: 1: for GEOM_CAPSULE, GEOM_CYLINDER |
|
||||
| optional | fileName | string | Filename for GEOM_MESH, currently only Wavefront .obj. Will create convex hulls for each object (marked as 'o') in the .obj file. |
|
||||
| optional | meshScale | vec3 list of 3 floats | default: [1,1,1], for GEOM_MESH |
|
||||
| optional | planeNormal | vec3 list of 3 floats | default: [0,0,1] for GEOM_PLANE |
|
||||
| optional | flags | int | GEOM_FORCE_CONCAVE_TRIMESH: for GEOM_MESH, this will create a concave static triangle mesh. This should not be used with dynamic / moving objects, only for static (mass = 0) terrain. |
|
||||
| optional | physicsClientId | int | If you are connected to multiple servers, you can pick one. |
|
||||
|
||||
The return value is a non-negative int unique id for the collision shape or -1 if the call failed.
|
||||
|
||||
createVisualShape
|
||||
--------------------------------------------------------------------------------------------
|
||||
You can create a visual shape in a similar way to creating a collision shape, with some additional arguments to control the visual appearance, such as diffuse and specular color. When you use the GEOM_MESH type, you can point to a Wavefront OBJ file, and the visual shape will parse some parameters from the material file (.mtl) and load a texture. Note that large textures (above 1024x1024 pixels) can slow down the loading and run-time performance.
|
||||
|
||||
The input parameters are
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|------------------------|------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| required | shapeType | int | GEOM_SPHERE, GEOM_BOX, GEOM_CAPSULE, GEOM_CYLINDER, GEOM_PLANE, GEOM_MESH |
|
||||
| optional | radius | float | default 0.5: GEOM_SPHERE, GEOM_CAPSULE, GEOM_CYLINDER |
|
||||
| optional | halfExtents | vec3 list of 3 floats | default [1,1,1]: for GEOM_BOX |
|
||||
| optional | height | float | default: 1: for GEOM_CAPSULE, GEOM_CYLINDER |
|
||||
| optional | fileName | string | Filename for GEOM_MESH, currently only Wavefront .obj. Will create convex hulls for each object (marked as 'o') in the .obj file. |
|
||||
| optional | meshScale | vec3 list of 3 floats | default: [1,1,1], for GEOM_MESH |
|
||||
| optional | planeNormal | vec3 list of 3 floats | default: [0,0,1] for GEOM_PLANE |
|
||||
| optional | flags | int | unused at the moment |
|
||||
| optional | rgbaColor | vec4, list of 4 floats | color components for red, green, blue and alpha, each in range [0..1]. |
|
||||
| optional | specularColor | vec3, list of 3 floats | specular reflection color, red, green, blue components in range [0..1] |
|
||||
| optional | visualFramePosition | vec3, list of 3 floats | translational offset of the visual shape with respect to the link frame |
|
||||
| optional | visualFrameOrientation | vec4, list of 4 floats | rotational offset (quaternion x,y,z,w) of the visual shape with respect to the link frame |
|
||||
| optional | physicsClientId | int | If you are connected to multiple servers, you can pick one. |
|
||||
|
||||
The return value is a non-negative int unique id for the visual shape or -1 if the call failed.
|
||||
|
||||
createMultiBody
|
||||
--------------------------------------------------------------------------------------------
|
||||
Although the easiest way to create stuff in the world is using the loading functions (loadURDF/SDF/MJCF/Bullet), you can create a multi body using createMultiBody.
|
||||
See the createMultiBodyLinks.py example in the Bullet Physics SDK. The parameters of createMultiBody are very similar to URDF and SDF parameters.
|
||||
|
||||
You can create a multi body with only a single base without joints/child links or you can create a multi body with joints/child links. If you provide links, make sure the size of every list is the same (len(linkMasses) == len(linkCollisionShapeIndices) etc). The input parameters for createMultiBody are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-------------------------------|------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||
| optional | baseMass | float | mass of the base, in kg (if using SI units) |
|
||||
| optional | baseCollisionShapeIndex | int | unique id from createCollisionShape or -1. You can re-use the collision shape for multiple multibodies (instancing) |
|
||||
| optional | baseVisualShapeIndex | int | unique id from createVisualShape or -1. You can reuse the visual shape (instancing) |
|
||||
| optional | basePosition | vec3, list of 3 floats | Cartesian world position of the base |
|
||||
| optional | baseOrientation | vec4, list of 4 floats | Orientation of base as quaternion [x,y,z,w] |
|
||||
| optional | baseInertialFramePosition | vec3, list of 3 floats | Local position of inertial frame |
|
||||
| optional | baseInertialFrameOrientation | vec4, list of 4 floats | Local orientation of inertial frame, [x,y,z,w] |
|
||||
| optional | linkMasses | list of float | List of the mass values, one for each link. |
|
||||
| optional | linkCollisionShapeIndices | list of int | List of the unique id, one for each link. |
|
||||
| optional | linkVisualShapeIndices | list of int | list of the visual shape unique id for each link |
|
||||
| optional | linkPositions | list of vec3 | list of local link positions, with respect to parent |
|
||||
| optional | linkOrientations | list of vec4 | list of local link orientations, w.r.t. parent |
|
||||
| optional | linkInertialFramePositions | list of vec3 | list of local inertial frame pos. in link frame |
|
||||
| optional | linkInertialFrameOrientations | list of vec4 | list of local inertial frame orn. in link frame |
|
||||
| optional | linkParentIndices | list of int | Link index of the parent link or 0 for the base. |
|
||||
| optional | linkJointTypes | list of int | list of joint types, one for each link. Only JOINT_REVOLUTE, JOINT_PRISMATIC, and JOINT_FIXED is supported at the moment. |
|
||||
| optional | linkJointAxis | list of vec3 | Joint axis in local frame |
|
||||
| optional | useMaximalCoordinates | int | experimental, best to leave it 0/false. |
|
||||
| optional | physicsClientId | int | If you are connected to multiple servers, you can pick one. |
|
||||
|
||||
|
||||
The return value of createMultiBody is a non-negative unique id or -1 for failure. Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ python
|
||||
cuid = pybullet.createCollisionShape(pybullet.GEOM_BOX, halfExtents = [1, 1, 1])
|
||||
mass= 0 #static box
|
||||
pybullet.createMultiBody(mass,cuid)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
See also createMultiBodyLinks.py, createObstacleCourse.py and createVisualShape.py in the Bullet/examples/pybullet/examples folder.
|
||||
|
||||
saveWorld
|
||||
--------------------------------------------------------------------------------------------
|
||||
You can create a snapshot of the current world as a pybullet Python file, stored on the server. saveWorld can be useful as a basic editing feature, setting up the robot, joint angles, object positions and environment for example in VR. Later you can just load the pybullet Python file to re-create the world. Note that not all settings are stored in the world file at the moment.
|
||||
The input arguments are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|----------------|--------|------------------------------------------------------------|
|
||||
| required | fileName | string | filename of the pybullet file. |
|
||||
| optional | clientServerId | int | if you are connected to multiple servers, you can pick one |
|
||||
|
||||
stepSimulation
|
||||
--------------------------------------------------------------------------------------------
|
||||
stepSimulation will perform all the actions in a single forward dynamics simulation step such as collision detection, constraint solving and integration.
|
||||
|
||||
stepSimulation input arguments are optional:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------|-------------------------------------------------------------|
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
|
||||
stepSimulation has no return values.
|
||||
|
||||
See also setRealTimeSimulation to automatically let the physics server run forward dynamics simulation based on its real-time clock.
|
||||
|
||||
setRealTimeSimulation
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
By default, the physics server will not step the simulation, unless you explicitly send a 'stepSimulation' command. This way you can maintain control determinism of the simulation. It is possible to run the simulation in real-time by letting the physics server automatically step the simulation according to its real-time-clock (RTC) using the setRealTimeSimulation command. If you enable the real-time simulation, you don't need to call 'stepSimulation'.
|
||||
|
||||
Note that setRealTimeSimulation has no effect in DIRECT mode: in DIRECT mode the physics server and client happen in the same thread and you trigger every command. In GUI mode and in Virtual Reality mode, and TCP/UDP mode, the physics server runs in a separate thread from the client (pybullet), and setRealTimeSimulation allows the physicsserver thread to add additional calls to stepSimulation.
|
||||
|
||||
|
||||
The input parameters are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|--------------------------|------|-------------------------------------------------------------|
|
||||
| required | enableRealTimeSimulation | int | 0 to disable real-time simulation, 1 to enable |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
|
||||
getBasePositionAndOrientation
|
||||
--------------------------------------------------------------------------------------------
|
||||
getBasePositionAndOrientation reports the current position and orientation of the base (or root link) of the body in Cartesian world coordinates. The orientation is a quaternion in [x,y,z,w] format.
|
||||
|
||||
The getBasePositionAndOrientation input parameters are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|--------------------------|------|-------------------------------------------------------------|
|
||||
| required | objectUniqueId | int | object unique id, as returned from loadURDF. |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
|
||||
getBasePositionAndOrientation returns the position list of 3 floats and orientation as list of 4 floats in [x,y,z,w] order. Use getEulerFromQuaternion to convert the quaternion to Euler if needed.
|
||||
|
||||
See also resetBasePositionAndOrientation to reset the position and orientation of the object.
|
||||
|
||||
This completes the first pybullet script. Bullet ships with several URDF files in the Bullet/data folder.
|
||||
|
||||
resetBasePositionAndOrientation
|
||||
--------------------------------------------------------------------------------------------
|
||||
You can reset the position and orientation of the base (root) of each object. It is best only to do this at the start, and not during a running simulation, since the command will override the effect of all physics simulation. The linear and angular velocity is set to zero. You can use resetBaseVelocity to reset to a non-zero linear and/or angular velocity.
|
||||
|
||||
The input arguments to resetBasePositionAndOrientation are:
|
||||
|
||||
| required | objectUniqueId | int | object unique id, as returned from loadURDF. |
|
||||
|----------|-----------------|------|-----------------------------------------------------------------------------------------------|
|
||||
| required | posObj | vec3 | reset the base of the object at the specified position in world space coordinates [X,Y,Z] |
|
||||
| required | ornObj | vec4 | reset the base of the object at the specified orientation as world space quaternion [X,Y,Z,W] |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
There are no return arguments.
|
||||
|
||||
Transforms: Position and Orientation
|
||||
--------------------------------------------------------------------------------------------
|
||||
The position of objects can be expressed in Cartesian world space coordinates [x,y,z]. The orientation (or rotation) of objects can be expressed using quaternions [x,y,z,w], euler angles [yaw, pitch, roll] or 3x3 matrices. pybullet provides a few helper functions to convert between quaternions, euler angles and 3x3 matrices. In additions there are some functions to multiply and invert transforms.
|
||||
|
||||
getQuaternionFromEuler and getEulerFromQuaternion
|
||||
--------------------------------------------------------------------------------------------
|
||||
The pybullet API uses quaternions to represent orientations. Since quaternions are not very intuitive for people, there are two APIs to convert between quaternions and Euler angles.
|
||||
The getQuaternionFromEuler input arguments are:
|
||||
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| required | eulerAngle | vec3: list of 3 floats | The X,Y,Z Euler angles are in radians, accumulating 3 rotations expressing the roll around the X, pitch around Y and yaw around the Z axis. |
|
||||
| optional | physicsClientId | int | unused, added for API consistency. |
|
||||
|
||||
|
||||
getQuaternionFromEuler returns a quaternion, vec4 list of 4 floating point values [X,Y,Z,W].
|
||||
|
||||
getEulerFromQuaternion
|
||||
--------------------------------------------------------------------------------------------
|
||||
The getEulerFromQuaternion input arguments are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------------------------|------------------------------------|
|
||||
| required | quaternion | vec4: list of 4 floats | The quaternion format is [x,y,z,w] |
|
||||
| optional | physicsClientId | int | unused, added for API consistency. |
|
||||
|
||||
getEulerFromQuaternion returns alist of 3 floating point values, a vec3.
|
||||
|
||||
getMatrixFromQuaternion
|
||||
--------------------------------------------------------------------------------------------
|
||||
getMatrixFromQuaternion is a utility API to create a 3x3 matrix from a quaternion. The input is a quaternion and output a list of 9 floats, representing the matrix.
|
||||
|
||||
multiplyTransforms, invertTransform
|
||||
--------------------------------------------------------------------------------------------
|
||||
pybullet provides a few helper functions to multiply and inverse transforms. This can be helpful to transform coordinates from one to the other coordinate system.
|
||||
|
||||
The input parameters of multiplyTransforms are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------------------------|------------------------------------|
|
||||
| required | positionA | vec3, list of 3 floats | position A |
|
||||
| required | orientationA | vec4, list of 4 floats | quaternion [x,y,z,w] |
|
||||
| required | positionB | vec3, list of 3 floats | position B |
|
||||
| required | orientationB | vec4, list of 4 floats | quaternion [x,y,z,w] |
|
||||
| optional | physicsClientId | int | unused, added for API consistency. |
|
||||
|
||||
The return value is a list of position (vec3) and orientation (vec4, quaternion x,y,x,w).
|
||||
|
||||
The input and output parameters of invertTransform are:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-------------|------------------------|----------------------|
|
||||
| required | position | vec3, list of 3 floats | |
|
||||
| required | orientation | vec4, list of 4 floats | quaternion [x,y,z,w] |
|
||||
|
||||
|
||||
The output of invertTransform is a position (vec3) and orientation (vec4, quaternion x,y,x,w).
|
||||
getAPIVersion
|
||||
You can query for the API version in a year-month-0-day format. You can only connect between physics client/server of the same API version, with the same number of bits (32-bit / 64bit). There is a optional unused argument physicsClientId, added for API consistency.
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------|------------------------------------|
|
||||
| optional | physicsClientId | int | unused, added for API consistency. |
|
||||
|
||||
Controlling a robot
|
||||
======================================================================================
|
||||
|
||||
In the Introduction we already showed how to initialize pybullet and load some objects. If you replace the file name in the loadURDF command with "r2d2.urdf" you can simulate a R2D2 robot from the ROS tutorial. Let's control this R2D2 robot to move, look around and control the gripper. For this we need to know how to access its joint motors.
|
||||
|
||||
Base, Joints, Links
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||

|
||||
|
||||
A simulated robot as described in a URDF file has a base, and optionally links connected by joints. Each joint connects one parent link to a child link. At the root of the hierarchy there is a single root parent that we call base. The base can be either fully fixed, 0 degrees of freedom, or fully free, with 6 degrees of freedom. Since each link is connected to a parent with a single joint, the number of joints is equal to the number of links. Regular links have link indices in the range [0..getNumJoints()] Since the base is not a regular 'link', we use the convention of -1 as its link index. We use the convention that joint frames are expressed relative to the parents center of mass inertial frame, which is aligned with the principle axis of inertia.
|
||||
|
||||
getNumJoints, getJointInfo
|
||||
--------------------------------------------------------------------------------------------
|
||||
After you load a robot you can query the number of joints using the getNumJoints API. For the r2d2.urdf this should return 15.
|
||||
|
||||
getNumJoints input parameters:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------|-------------------------------------------------------------|
|
||||
| required | bodyUniqueId | int | the body unique id, as returned by loadURDF etc. |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
getNumJoints returns an integer value representing the number of joints.
|
||||
|
||||
getJointInfo
|
||||
--------------------------------------------------------------------------------------------
|
||||
For each joint we can query some information, such as its name and type.
|
||||
|
||||
getJointInfo input parameters:
|
||||
|
||||
| option | name | type | description |
|
||||
|----------|-----------------|------|-------------------------------------------------------------|
|
||||
| required | bodyUniqueId | int | the body unique id, as returned by loadURDF etc. |
|
||||
| required | jointIndex | int | an index in the range [0 .. getNumJoints(bodyUniqueId)) |
|
||||
| optional | physicsClientId | int | if you are connected to multiple servers, you can pick one. |
|
||||
|
||||
getJointInfo returns a list of information:
|
||||
|
||||
| name | type | description |
|
||||
|------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| jointIndex | int | the same joint index as the input parameter |
|
||||
| jointName | string | the name of the joint, as specified in the URDF (or SDF etc) file |
|
||||
| jointType | int | "type of the joint, this also implies the number of position and velocity variables. JOINT_REVOLUTE, JOINT_PRISMATIC, JOINT_SPHERICAL, JOINT_PLANAR, JOINT_FIXED. See the section on Base, Joint and Links for more details." |
|
||||
| qIndex | int | the first position index in the positional state variables for this body |
|
||||
| uIndex | int | the first velocity index in the velocity state variables for this body |
|
||||
| flags | int | reserved |
|
||||
| jointDamping | float | the joint damping value, as specified in the URDF file |
|
||||
| jointFriction | float | the joint friction value, as specified in the URDF file |
|
||||
| jointLowerLimit | float | Positional lower limit for slider and revolute (hinge) joints. |
|
||||
| jointUpperLimit | float | Positional upper limit for slider and revolute joints. Values ignored in case upper limit smaller than lower limit.. |
|
||||
| jointMaxForce | float | Maximum force specified in URDF (possibly other file formats) Note that this value is not automatically used. You can use maxForce in 'setJointMotorControl2'. |
|
||||
| jointMaxVelocity | float | Maximum velocity specified in URDF. Note that the maximum velocity is not used in actual motor control commands at the moment. |
|
||||
| linkName | string | the name of the link, as specified in the URDF (or SDF etc.) file |
|
||||
|
||||
setJointMotorControl2/Array
|
||||
--------------------------------------------------------------------------------------------
|
||||
Note: setJointMotorControl is obsolete and replaced by setJointMotorControl2 API. (Or even better use setJointMotorControlArray).
|
||||
|
||||
We can control a robot by setting a desired control mode for one or more joint motors. During the stepSimulation the physics engine will simulate the motors to reach the given target value that can be reached within the maximum motor forces and other constraints. Each revolute joint and prismatic joint is motorized by default. There are 3 different motor control modes: position control, velocity control and torque control.
|
||||
|
||||
You can effectively disable the motor by using a force of 0. You need to disable motor in order to use direct torque control. For example:
|
||||
|
||||
|
||||
|
||||
|
||||
<!--Hello MathJax:
|
||||
\[f(0)=\frac{1}{2\cdot\pi\cdot i}\cdot \oint_{|z|=1} \frac{f(z)}{z} \textrm{d}z\]
|
||||
-->
|
||||
|
||||
|
||||
<script window.markdeepOptions={};
|
||||
window.markdeepOptions.tocStyle="long"; src="cs371-common.js"></script>
|
||||
|
||||
10
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/Article.md.html
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
<meta charset="utf-8" lang="en">
|
||||
Hello Markdeep!
|
||||
|
||||
- Hello
|
||||
- lists!
|
||||
|
||||
Hello MathJax:
|
||||
\[f(0)=\frac{1}{2\cdot\pi\cdot i}\cdot \oint_{|z|=1} \frac{f(z)}{z} \textrm{d}z\]
|
||||
|
||||
<script src="MarkdeepUtility.js"></script>
|
||||
44
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/BuildMarkdeepUtility.py
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import re
|
||||
|
||||
if (__name__ == "__main__"):
|
||||
# Assemble the script which embeds the Markdeep page into the preview blog
|
||||
PreviewBlogPage = open("PreviewBlogPage.htm", "rb").read().decode("utf-8")
|
||||
HeadMatch = re.search("<head(.*?)>(.*?)</head>", PreviewBlogPage, re.DOTALL)
|
||||
HeadAttributes = HeadMatch.group(1)
|
||||
FullDocumentHead = HeadMatch.group(2)
|
||||
BodyMatch = re.search("<body(.*?)>(.*?)</body>", PreviewBlogPage, re.DOTALL)
|
||||
BodyAttributes = BodyMatch.group(1)
|
||||
FullPreviewBody = BodyMatch.group(2)
|
||||
ArticleHTMLCodeMacro = "$(ARTICLE_HTML_CODE)"
|
||||
iArticleHTMLCodeMacro = FullPreviewBody.find(ArticleHTMLCodeMacro)
|
||||
DocumentBodyPrefix = FullPreviewBody[0:iArticleHTMLCodeMacro]
|
||||
DocumentBodySuffix = FullPreviewBody[iArticleHTMLCodeMacro + len(ArticleHTMLCodeMacro):]
|
||||
FullPrepareHTMLCode = open("PrepareHTML.js", "rb").read().decode("utf-8")
|
||||
ReplacementList = [("$(FULL_DOCUMENT_HEAD)", FullDocumentHead),
|
||||
("$(DOCUMENT_BODY_PREFIX)", DocumentBodyPrefix),
|
||||
("$(DOCUMENT_BODY_SUFFIX)", DocumentBodySuffix)]
|
||||
for Macro, Replacement in ReplacementList:
|
||||
FullPrepareHTMLCode = FullPrepareHTMLCode.replace(
|
||||
Macro,
|
||||
Replacement.replace("\r\n", "\\r\\n\\\r\n").replace("'", "\\'"))
|
||||
# Generate code which sets body and head attributes appropriately
|
||||
for Element, AttributeCode in [("head", HeadAttributes), ("body", BodyAttributes)]:
|
||||
FullPrepareHTMLCode += "\r\n// Setting " + Element + " attributes\r\n"
|
||||
for Match in re.finditer("(\\w+)=\\\"(.*?)\\\"", AttributeCode):
|
||||
FullPrepareHTMLCode += "document." + Element + ".setAttribute(\"" + Match.group(
|
||||
1) + "\",\"" + Match.group(2) + "\");\r\n"
|
||||
open("PrepareHTML.full.js", "wb").write(FullPrepareHTMLCode.encode("utf-8"))
|
||||
|
||||
# Concatenate all the scripts together
|
||||
SourceFileList = [
|
||||
"PrepareHTML.full.js", "SetMarkdeepMode.js", "markdeep.min.js", "DisplayMarkdeepOutput.js",
|
||||
"InvokeMathJax.js"
|
||||
]
|
||||
OutputCode = "\r\n\r\n".join([
|
||||
"// " + SourceFile + "\r\n\r\n" + open(SourceFile, "rb").read().decode("utf-8")
|
||||
for SourceFile in SourceFileList
|
||||
])
|
||||
OutputFile = open("MarkdeepUtility.js", "wb")
|
||||
OutputFile.write(OutputCode.encode("utf-8"))
|
||||
OutputFile.close()
|
||||
print("Done.")
|
||||
6
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/DisplayMarkdeepOutput.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
BodyHTML=document.body.innerHTML;
|
||||
BeginTag="<!-- MARKDEEP_BEGIN -->";
|
||||
EndTag="<!-- MARKDEEP_END -->";
|
||||
BodyHTML=BodyHTML.slice(BodyHTML.indexOf(BeginTag)+BeginTag.length,BodyHTML.lastIndexOf(EndTag));
|
||||
document.getElementById("BodyDisplayBox").textContent=BodyHTML;
|
||||
document.head.innerHTML=FullDocumentHead;
|
||||
4
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/InvokeMathJax.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var MathjaxScript=document.createElement("script");
|
||||
MathjaxScript.type="text/javascript";
|
||||
MathjaxScript.src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
|
||||
document.head.appendChild(MathjaxScript);
|
||||
4680
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/MarkdeepUtility.js
vendored
Normal file
4645
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/PrepareHTML.full.js
vendored
Normal file
102
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/PrepareHTML.js
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
/** Converts <>&" to their HTML escape sequences */
|
||||
function escapeHTMLEntities(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
|
||||
/** Restores the original source string's '<' and '>' as entered in
|
||||
the document, before the browser processed it as HTML. There is no
|
||||
way in an HTML document to distinguish an entity that was entered
|
||||
as an entity.*/
|
||||
function unescapeHTMLEntities(str) {
|
||||
// Process & last so that we don't recursively unescape
|
||||
// escaped escape sequences.
|
||||
return str.
|
||||
replace(/</g, '<').
|
||||
replace(/>/g, '>').
|
||||
replace(/"/g, '"').
|
||||
replace(/'/g, "'").
|
||||
replace(/–/g, '--').
|
||||
replace(/—/g, '---').
|
||||
replace(/&/g, '&');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\param node A node from an HTML DOM
|
||||
|
||||
\return A String that is a very good reconstruction of what the
|
||||
original source looked like before the browser tried to correct
|
||||
it to legal HTML.
|
||||
*/
|
||||
function nodeToMarkdeepSource(node, leaveEscapes) {
|
||||
var source = node.innerHTML;
|
||||
|
||||
// Markdown uses <john@bar.com> e-mail syntax, which HTML parsing
|
||||
// will try to close by inserting the matching close tags at the end of the
|
||||
// document. Remove anything that looks like that and comes *after*
|
||||
// the first fallback style.
|
||||
source = source.replace(/(?:<style class="fallback">[\s\S]*?<\/style>[\s\S]*)<\/\S+@\S+\.\S+?>/gim, '');
|
||||
|
||||
// Remove artificially inserted close tags
|
||||
source = source.replace(/<\/h?ttps?:.*>/gi, '');
|
||||
|
||||
// Now try to fix the URLs themselves, which will be
|
||||
// transformed like this: <http: casual-effects.com="" markdeep="">
|
||||
source = source.replace(/<(https?): (.*?)>/gi, function (match, protocol, list) {
|
||||
|
||||
// Remove any quotes--they wouldn't have been legal in the URL anyway
|
||||
var s = '<' + protocol + '://' + list.replace(/=""\s/g, '/');
|
||||
|
||||
if (s.substring(s.length - 3) === '=""') {
|
||||
s = s.substring(0, s.length - 3);
|
||||
}
|
||||
|
||||
// Remove any lingering quotes (since they
|
||||
// wouldn't have been legal in the URL)
|
||||
s = s.replace(/"/g, '');
|
||||
|
||||
return s + '>';
|
||||
});
|
||||
|
||||
// Remove the "fallback" style tags
|
||||
source = source.replace(/<style class=["']fallback["']>.*?<\/style>/gmi, '');
|
||||
|
||||
source = unescapeHTMLEntities(source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
// $ (FULL_DOCUMENT_HEAD) is replaced by the contents of the <head> found in
|
||||
// PreviewBlogPage.htm. This document head will overwrite whatever Markdeep does to
|
||||
// the head at the very end.
|
||||
FullDocumentHead='\
|
||||
$(FULL_DOCUMENT_HEAD)\
|
||||
';
|
||||
|
||||
// This code is placed at the beginning of the body before the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_PREFIX) is everything in the body of PreviewBlogPage.htm up to
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodyPrefix='\
|
||||
$(DOCUMENT_BODY_PREFIX)\
|
||||
<!-- MARKDEEP_BEGIN -->\
|
||||
<pre class="markdeep">\
|
||||
';
|
||||
// This code is placed at the end of the body after the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_SUFFIX) is everything in the body of PreviewBlogPage.htm after
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodySuffix='\
|
||||
</pre>\
|
||||
<!-- MARKDEEP_END -->\
|
||||
<div>Document <body> code:<br/>\
|
||||
<textarea cols="40" rows="10" id="BodyDisplayBox"></textarea></div>\
|
||||
$(DOCUMENT_BODY_SUFFIX)\
|
||||
';
|
||||
|
||||
// Get the full Markdeep code from the .md.html file without the script invocation
|
||||
MarkdeepCode=nodeToMarkdeepSource(document.body);
|
||||
MarkdeepCode=MarkdeepCode.slice(0,MarkdeepCode.lastIndexOf("<script"));
|
||||
// Bring it into a form where it can be pasted into an HTML document
|
||||
SanitizedMarkdeepCode=escapeHTMLEntities(MarkdeepCode);
|
||||
// Surround it by the prefix and suffix code and set that as body code
|
||||
document.body.innerHTML=DocumentBodyPrefix+SanitizedMarkdeepCode+DocumentBodySuffix;
|
||||
4549
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/PreviewBlogPage.htm
vendored
Normal file
1
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/SetMarkdeepMode.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
window.markdeepOptions={mode:"html"};
|
||||
29
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/ShowHeadAdditions.html
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<body>
|
||||
<script>window.markdeepOptions={mode:"script"};</script>
|
||||
<script src="./markdeep.min.js"></script>
|
||||
<div>Document <head> additions:<br/>
|
||||
<textarea cols="80" rows="40" id="HeadDisplayBox"></textarea></div>
|
||||
<script>
|
||||
// Get the complete Markdeep and hljs stylesheet
|
||||
FullStylesheet=window.markdeep.stylesheet();
|
||||
// It should consist of three <style> tags which we pick apart
|
||||
StyleTagList=FullStylesheet.split("<style>");
|
||||
// The second one defines section number, which we do not want, so we
|
||||
// just drop it. The other two are Markdeep and hljs styles.
|
||||
MarkdeepStylesheet="<style>"+StyleTagList[1];
|
||||
HLJSStylesheet="<style>"+StyleTagList[3];
|
||||
// Now lets show the user what we found
|
||||
document.getElementById("HeadDisplayBox").textContent=
|
||||
"<!-- Markdeep styles -->\r\n"
|
||||
+MarkdeepStylesheet
|
||||
+"\r\n\r\n<!-- hljs styles -->\r\n"
|
||||
+HLJSStylesheet
|
||||
+"\r\n\r\n<!-- MathJax invocation -->\r\n<script type=\"text/javascript\" async=\"\" src=\"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">\r\n";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
6
thirdparty/bullet/docs/pybullet_quickstart_guide/WordpressPreview/markdeep.min.js
vendored
Normal file
24
thirdparty/bullet/docs/pybullet_quickstart_guide/cs371-common.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
// Common code for styling all CS371 web pages
|
||||
|
||||
if (location.href.indexOf('?') == -1) {
|
||||
// Force a reload by making a bogus query.
|
||||
var i = ((location.href.indexOf('#') + 1) || (location.href.length + 1)) - 1;
|
||||
location = location.href.substring(0, i) + '?' + location.href.substring(i);
|
||||
}
|
||||
|
||||
markdeepOptions = {tocStyle: 'long'};
|
||||
|
||||
document.write("<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,100,100italic,300italic,400italic,700' rel='stylesheet' type='text/css'>" +
|
||||
"<link rel='stylesheet' type='text/css' href='cs371.css'>");
|
||||
|
||||
// Conceal list items that use a '+', except when viewed locally
|
||||
if (/^file:\/{3}/i.test(window.location.href)) {
|
||||
document.write('<style>li.plus { color: #D88; }</style>');
|
||||
} else {
|
||||
document.write('<style>li.plus { display: none; }</style>');
|
||||
}
|
||||
|
||||
document.write('<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.js"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>');
|
||||
|
||||
|
||||
21
thirdparty/bullet/docs/pybullet_quickstart_guide/cs371.css
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
.md table {
|
||||
font-size: 6px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Roboto", sans-serif;
|
||||
background: #FFFDF9;
|
||||
}
|
||||
|
||||
body, table {
|
||||
font-weight: 300;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
|
||||
em.asterisk {
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
/* color: #333; */
|
||||
}
|
||||
|
||||
BIN
thirdparty/bullet/docs/pybullet_quickstart_guide/images/CoRL_VR_demo.png
vendored
Normal file
|
After Width: | Height: | Size: 562 KiB |
BIN
thirdparty/bullet/docs/pybullet_quickstart_guide/images/joints_and_links.png
vendored
Normal file
|
After Width: | Height: | Size: 8.8 KiB |