2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# Instructions
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Images on Docker Hub
  
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								There are 4 images available on https://hub.docker.com/orgs/borglab/repositories:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  `borglab/ubuntu-boost-tbb` : 18.06 Linux (nicknamed `bionic` ) base image, with Boost and TBB installed. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  `borglab/ubuntu-gtsam` : GTSAM Release version installed in `/usr/local` . 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  `borglab/ubuntu-gtsam-python` : installed GTSAM with python wrapper. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  `borglab/ubuntu-gtsam-python-vnc` : image with GTSAM+python wrapper that will run a VNC server to connect to. 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Using the images
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## Just GTSAM
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To start the Docker image, execute
							 
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								docker run -it borglab/ubuntu-gtsam:bionic 
							 
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								after you will find yourself in a bash shell, in the directory `/usr/src/gtsam/build` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## GTSAM with Python wrapper
  
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								To use GTSAM via the python wrapper, similarly execute
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								docker run -it borglab/ubuntu-gtsam-python:bionic 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								and then launch `python3` :
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								python3
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								>>> import gtsam
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								>>> gtsam.Pose2(1,2,3)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								(1, 2, 3)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## GTSAM with Python wrapper and VNC
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								First, start the docker image, which will run a VNC server on port 5900:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								docker run -p 5900:5900 borglab/ubuntu-gtsam-python-vnc:bionic
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:33:25 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Then open a remote VNC X client, for example:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Linux
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								sudo apt-get install tigervnc-viewer
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								xtigervncviewer :5900
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Mac
  
						 
					
						
							
								
									
										
										
										
											2021-09-07 10:35:58 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								The Finder's "Connect to Server..." with `vnc://127.0.0.1`  does not work, for some reason. Using the free [VNC Viewer ](https://www.realvnc.com/en/connect/download/viewer/ ), enter `0.0.0.0:5900`  as the server.
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# Re-building the images locally
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To build all docker images, in order:
							 
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								(cd ubuntu-boost-tbb & &  ./build.sh)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								(cd ubuntu-gtsam & &  ./build.sh)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								(cd ubuntu-gtsam-python & &  ./build.sh)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								(cd ubuntu-gtsam-python-vnc & &  ./build.sh)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-07-15 05:24:47 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-09-07 04:14:36 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Note: building GTSAM can take a lot of memory because of the heavy templating. It is advisable to give Docker enough resources, e.g., 8GB, to avoid OOM errors while compiling.