\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{gonzalocasas} \pdfinfo{ /Title (compas-fab.pdf) /Creator (Cheatography) /Author (gonzalocasas) /Subject (COMPAS FAB Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{0092D2} \definecolor{LightBackground}{HTML}{EFF8FC} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{COMPAS FAB Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{gonzalocasas} via \textcolor{DarkBackground}{\uline{cheatography.com/101168/cs/21156/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}gonzalocasas \\ \uline{cheatography.com/gonzalocasas} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 17th November, 2019.\\ Updated 17th November, 2019.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Installation}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{`conda install compas\_fab` \newline % Row Count 1 (+ 1) {\emph{Anaconda/Miniconda must be installed and the conda-forge channel must be added. Use virtual environments to avoid dependency issues.}}% Row Count 4 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Frames}} \tn % Row 0 \SetRowColor{LightBackground} `Frame.worldXY()` & World XY frame. \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `Frame(pt, xaxis, yaxis)` & Create new frame with origin and\{\{nl\}\}vectors `x` and `y`. \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} `Frame(pt1, pt2, pt3)` & Create new frame from 3 points. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \{\{nobreak\}\}`Frame.from\_euler\_angles(y, p, r)` & Create new frame from euler angles (yaw, pitch, roll). \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} `frame.point` & Origin of the frame. \tn % Row Count 10 (+ 1) % Row 5 \SetRowColor{white} `frame.normal`, `frame.zaxis` & Normal of the frame. \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} `frame.quaternion` & Rotation as quaternion. \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \{\{noshy\}\}`frame.axis\_angle\_vector` & Rotation as axis-angle vector. \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} \seqsplit{`frame.euler\_angles()`} & Rotation as euler angles. \tn % Row Count 18 (+ 2) % Row 9 \SetRowColor{white} \{\{noshy\}\}`frame.euler\_angles(False)` & Rotation as non-static euler angles. \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Frames belong to the robotics fundamentals. Each joint contains a frame and there are several frames as coordinate systems involved (eg. `wcf`, `rcf`). \newline \newline `from compas.geometry import Frame`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Frames as cartesian coordinate systems}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/gonzalocasas_1573979014_frames.jpg}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.68 cm} x{4.32 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Coordinate systems}} \tn % Row 0 \SetRowColor{LightBackground} `wcf` & Root coordinate frame of the world. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `rcf` & Robot coordinate frame, usually on the base of the robot. \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} `t0cf` & Tool0 coordinate frame on the last link of the robot. \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} `tcf` & Tool coordinate frame on the tool of the robot. \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} `ocf` & Object coordinate frame, origin of the work area. \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} \{\{noshy\}\}`rcf.to\_world\_coords(pt)` & Transform point in local coordinates of `rcf` to world coordinates. \tn % Row Count 18 (+ 4) % Row 6 \SetRowColor{LightBackground} \{\{noshy\}\}`rcf.to\_local\_coords(pt)` & Transform point in world coordinates to local coordinates of `rcf`. \tn % Row Count 22 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Transformations}} \tn % Row 0 \SetRowColor{LightBackground} \{\{noshy\}\}`Transformation.from\_frame(f)` & Create transformation from world XY to `f` frame. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{noshy\}\}`Translation({[}10,~5,~0{]})` & Create translation along `x=10.0, y=5.0, z=0.0` vector. \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} `t.inverse()` & Calculate inverse of `t` transformation. \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} `pt.transform(t)` & In-place transform point `pt` with `t` transformation. \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} `pt.transform(t * t2 * t3)` & In-place transform point `pt` with `t`, `t2` and `t3` transformations. \tn % Row Count 15 (+ 4) % Row 5 \SetRowColor{white} `pt2 = pt.transformed(t)` & Return a transformed copy of point `pt` with `t` transformation. \tn % Row Count 19 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{`Transformation` represents a 4x4 transformation matrix. `Translation`, `Scale`, `Reflection`, `Shear` and `Projection` are specialized sub-classes of it. \newline \newline `from compas.geometry import Transformation, Translation, Rotation \# , ...`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Geometric primitives}} \tn % Row 0 \SetRowColor{LightBackground} \{\{noshy\}\}`Point(3,~2,~5)` or `{[}3,~2,~5{]}` & 3D point with `x=3.0, y=2.0, z=5.0` coordinates. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \{\{noshy\}\}`Vector(1,~0,~0)` or `{[}1,~0,~0{]}` & Vector `x=1.0, y=0.0, z=0.0` \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} \{\{noshy\}\}`Frame(point,~xaxis,~yaxis)` or `(point,~xaxis,~yaxis)` & Frame at `point` origin and `xaxis` and `yaxis` vectors. \tn % Row Count 12 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{In COMPAS, geometric primitives can be created either as objects or as iterables (lists, tuples, etc). \newline \newline `from compas.geometry import Point, Vector, Frame`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Robot models}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/gonzalocasas_1573986187_model.jpg}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.84 cm} x{6.16 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Parts of robot model}} \tn % Row 0 \SetRowColor{LightBackground} `Link` & Contains visual \& collision meshes, inertial info, etc. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `Joint` & Contains parent, child links, origin frame, etc. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{`RobotModel`} & Root of robot model tree. \tn % Row Count 6 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Robot models are a tree structure of {\bf{links}} and {\bf{joints}} based on `URDF` format. \newline \newline `from compas.robots import RobotModel, Link, Joint`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{5.76 cm} x{2.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Joint types and units}} \tn % Row 0 \SetRowColor{LightBackground} `Joint.PRISMATIC` & Meters \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} `Joint.REVOLUTE` & Radians \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} `Joint.CONTINUOUS` & Radians \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} `Joint.FIXED` & - \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Configuration examples}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Configuration({[}.5, pi{]}, {[}Joint.PRISMATIC, Joint.REVOLUTE{]}) \newline \newline Configuration.from\_revolute\_values({[}0, 0, pi, 0, 0, 0{]}) \newline \newline Configuration.from\_prismatic\_and\_revolute\_values({[}8.3{]}, {[}0.0{]} * 6)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Configuration describes the positions of each of the joints of a robot model in its corresponding unit. \newline \newline `from compas\_fab.robots import Configuration`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{ROS backend}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/gonzalocasas_1573988981_ros.PNG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Start ROS backend}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Download or create a `docker-compose.yml` file (\{\{link="https://gramaziokohler.github.io/compas\_fab/latest/backends/ros.html\#complete-ros-systems-1"\}\}examples\{\{/link\}\}) and start up with: \newline % Row Count 4 (+ 4) `docker-compose up -d`% Row Count 5 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Load robot from ROS}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{from compas\_fab.backends import RosClient \newline \newline with RosClient('localhost') as client: \newline robot = client.load\_robot()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{If using Docker Toolbox, replace localhost with {\bf{192.168.99.100}}.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Robotic planning with MoveIt!}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/gonzalocasas_1573992708_moveit.PNG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{2.08 cm} x{5.92 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Forward Kinematics (FK)}} \tn % Row 0 \SetRowColor{LightBackground} Input & `Configuration`. \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Output & `Frame` in `rcf`. \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Calculate end-effector frame in `rcf` for a given configuration.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Code example}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{config = Configuration.from\_revolute\_values({[}0, 0, 0, 3.14, 0, 0{]}) \newline frame\_rcf = \seqsplit{robot.forward\_kinematics(config)}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{1.04 cm} x{6.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Inverse Kinematics (IK)}} \tn % Row 0 \SetRowColor{LightBackground} Input & `Frame` in `wcf` and start `Configuration`. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Output} & `Configuration` \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Calculate possible configuration(s) for a given frame in `wcf`.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Code example}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{frame\_wcf = Frame({[}0.3, 0.1, 0.5{]}, {[}1, 0, 0{]}, {[}0, 1, 0{]}) \newline start\_config = \seqsplit{robot.init\_configuration()} \newline config = \seqsplit{robot.inverse\_kinematics(frame\_wcf}, start\_config)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Path planning}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/gonzalocasas_1573993985_cartesian-vs-kinematic.PNG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{\{\{ac\}\}Cartesian vs free-space planning} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{1.04 cm} x{6.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Plan cartesian path}} \tn % Row 0 \SetRowColor{LightBackground} Input & List of `Frame` in `wcf` and start `Configuration` \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Output} & `JointTrajectory` \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Calculate linear joint trajectory for a given list of waypoints defined by frames. \newline \newline This might return partial solutions, `fraction` attribute indicates degree of completion, e.g. `trajectory.fraction = 0.5` means 50\% of trajectory completed.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Code example}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{f1 = Frame({[}0.3, 0.1, 0.5{]}, {[}1, 0, 0{]}, {[}0, 1, 0{]}) \newline f2 = Frame({[}0.6, 0.1, 0.4{]}, {[}1, 0, 0{]}, {[}0, 1, 0{]}) \newline start\_config = \seqsplit{robot.init\_configuration()} \newline \newline trajectory = robot.plan\_cartesian\_motion({[}f1, f2{]}, start\_config)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{1.04 cm} x{6.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Plan free-space motion}} \tn % Row 0 \SetRowColor{LightBackground} Input & List of goal `Constraint` and start `Configuration`. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{Output} & `JointTrajectory`. \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Calculate joint trajectory for a given start configuration and a list of goal constraints. \newline \newline `from compas\_fab.robots import JointTrajectory, Constraint, JointConstraint, PositionConstraint, OrientationConstraint`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Code example}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{pc = \seqsplit{robot.constraints\_from\_frame(f1)} \newline start\_config = \seqsplit{robot.init\_configuration()} \newline \newline trajectory = robot.plan\_motion(pc, start\_config, planner\_id='RRT')} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Planning scene operations}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{scene = PlanningScene(robot) \newline scene.add\_collision\_mesh(CollisionMesh(mesh, 'floor')) \newline scene.remove\_collision\_mesh('floor') \newline scene.append\_collision\_mesh(CollisionMesh(mesh, 'brick'))} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Append will group multiple meshes under the same name, and they can be removed with a single call to remove for that name. \newline \newline `from compas\_fab.robots import PlanningScene, CollisionMesh`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Attach meshes to robot}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{scene = PlanningScene(robot) \newline \newline gripper = CollisionMesh(mesh, 'gripper') \newline scene.attach\_collision\_mesh\_to\_robot\_end\_effector(gripper) \newline scene.remove\_attached\_collision\_mesh('gripper') \newline \newline beam = CollisionMesh(mesh, 'beam') \newline acm = \seqsplit{AttachedCollisionMesh(beam}, 'ee\_link', {[}'ee\_link'{]}) \newline scene.add\_attached\_collision\_mesh(acm)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{These operations can be used to attach an end-effector geometry, or to attach an element to the end-effector itself. \newline \newline `from compas\_fab.robots import PlanningScene, CollisionMesh, AttachedCollisionMesh`} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}